Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

You are asked to write a program for a game using a Brain-Computer-Interface whe

ID: 3837187 • Letter: Y

Question

You are asked to write a program for a game using a Brain-Computer-Interface where the user gives left/right/up/down commands to move on a board and collect points. Write a function bciboardgame(m,x,y,moves) that takes a matrix m representing the board and x,y coordinates representing the row and column indices of the user's current location. The moves represents the sequence of user commands, as a vector of integers between 1 and 4 (1: left, 2:right, 3:up, 4:down). Your program should start at x,y coordinates, and move around the board according to user's commands and return the total number of points the user collects, including the points on the starting position. Assume that the user will not try to move off the board.

Please also explain how and what was done because I want to understand, not just the answer. Like how does one go to computing this

Explanation / Answer

I have developed the program using the Brain Computer Interface technique which is basically means to elaborate and communicate with the people without any movement based on brain signals. I have included the comments for each part of the code for the better understanding of what each class and methods does.

Let me explain you in more simpler and step-by-step manner:-

Step-1:

The initial part of Brain Computer interface is to come across different modules which are needed to satisfy the requirement for working of Interface properly.

The Electroencephalography (EEG) is plays an vital role in the development of the nerve signals crossing from the paths i.e, Axons by measuring the electrical activity,

Step-2:

The brain is displayed on the computer screen with the following process:-

Step-3:

The EEG Signal is in the form of four types of brain wave, namely Beta Brain Wave, Alpha Brain Wave, Theta Brain Wave and Delta Brain Wave.

Let me elaborate more on this as it deals with the frequencies ranges for each Brain Waves.

Step-4:

To run the Brain Computer Interface, You need to download the Emotive software development Kit(SDK) for interacting it with the user headset.

Program:-


# Created a function basicComputerInterface
function basicComputerInterface = RoboticArmControl(board)

gui_Singeton = 1;

# Declared the properties

gui_State = struct('gui_Name', mfilename,
                   'gui_Singeton', gui_singeton,
                   'gui_OpeningFcn', @RoboticArmControl_OpeningFcn,
                   'gui_OutputFcn', @RoboticArmControl_OutputFcn,
                   'gui_LayoutFcn', [],
                   'gui_Callback', []
                   );
                  
   # If-else statement for checking the condition      
                  
if boardIgn && ischar(board{1})
gui_State.gui_Callback = str2func(board{1});

if boardOutin
{basicComputerInterface {1:boardOutin} = gui_mainfcn(gui_State,board{:});
else
gui_mainfcn(gui_State,board{:});
end

function bciboardgame(m,y, moves)

bciHandle = guidata(m);
hobject = bciHandle.output;
switch y,moves

case '1'
closehand_Callback(hobject,0,bciHandle);
case '2'
openhand_Callback(hobject,0,bciHandle);
case '3'
extension_Callback(hobject,0,bciHandle);
case '4'
flexion_Callback(hobject,0,bciHandle);
case '4'
relax_Callback(hobject,0,bciHandle);

end

function openhand_Callback(hobject,eventdata,bciHandle);
global a;
servoWrite(a,6,0);

function closehand_Callback(hobject,eventdata,bciHandle);
global a;
servoWrite(a,6,175);

function extension_Callback(hobject,eventdata,bciHandle);
global a;
servoWrite(a,7,0);

function relax_Callback(hobject,eventdata,bciHandle);
global a;
servoWrite(a,6,0);
servoWrite(a,7,0);

function flexion_Callback(hobject,eventdata,bciHandle);
global a;
servoWrite(a,7,150);

Waveform Frequency (Hz) Beta 12.5 -30 Alpha 7.5-12.5 Theta 4 - 7.5 Delta 0.5 - 3.5
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote