Question: A bionic arm will be one of the future biomedical devices which will help amputee people to increase their life quality. You are supposed to

A bionic arm will be one of the future biomedical devices which will help amputee people to increase their life quality. You are supposed to write a program for a bionic arm which is controlled by the patients eye movements using instructions below. (You are using Arduino Uno.) - Eye motions: Up: DI 3 HIGH Down: DI 4 HIGH Left: DI 5 HIGH Right: DI 6 HIGH Long Wink: DI 7 HIGH Double Wink: DI 8 HIGH Triple Wink: DI 9 HIGH

- Actions: Up: MOVE UP Down: MOVE DOWN Left: MOVE LEFT Right: MOVE RIGHT Long Wink: RELEASE OBJECT Double Wink: HOLD OBJECT Triple Wink: ACTIVATE ARM CONTROL (Remember position) - When USB asks for data by sending 1 to program it will return final status of the arm including all input states. - When no change on actions for 5 seconds, arm will automatically disable itself.

sample solutuion use cod

int sensorPin1=A0; int sensorPin2=A1; int sensorValue = 0; int sensorTotal = 0; byte byteRead; int command=0; boolean mySwitch=true; boolean mySwitch1=false; int i=0; int x=25;

#include

void setup() { pinMode(5,OUTPUT); pinMode(3,OUTPUT); Serial.begin(9600); //begin serial Serial.flush(); //flush existing Serial.println("Welcome To The Measuring System With Spo2 Probe."); delay(500); Serial.println("Press 1 to Automatically Measure The Optical Thickness of Farmers of Different Ages."); Serial.println("If You Want to Stop The Test, Press 2. If You Want to Continue The Test Again, Press 1. "); EEPROM.write(1,25); EEPROM.write(2,0); } void loop() { while (Serial.available()) {

byteRead = Serial.read();

if(byteRead>47 && byteRead<58){ command=(command*10)+(byteRead-48); }

if(byteRead==32){

if(command==1){ x=EEPROM.read(1); i=EEPROM.read(2); int metric=(x-20)/5; analogWrite(3,metric); analogWrite(5,metric); delay(1000); i++; Serial.print("Age: "); Serial.print(x); Serial.print(" Test: "); Serial.println(i); if(i==10){ x=x+5; i=0; } if(x==75&&i==10){ Serial.println ("The Test s Over."); } Serial.print("Press 1 to Continue "); } record(x,i); if(command==2){ Serial.print("The Test was Stopped"); analogWrite(3,0); analogWrite(5,0); } command=0; } } } void record(int x, int i){ EEPROM.write(1,x); EEPROM.write(2,i); }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!