robot movement problem need some help
kindly, have wheelchair robot controlled bio signals...the arduino receive signals sensor through analog pins , out digital signal control movement of robot (right,left,forward or back)...my problem when subject sit out of wheelchair signal controlled arduino when subject sit on wheelchair signal become uncontrolled... use following code guide wheelchair movement...
code: [select]
const int u1=10;
const int u2=10;
int a[u1];
int b[u2];
int right = 3;
int left = 6;
int forward = 9;
int = 11;
int value1= 0;
int min1=1023;
int max1=0;
int value2= 0;
int min2=1023;
int max2=0;
int x = 1;
int c1 = 10;
void setup () {
serial.begin(9600);
pinmode(right, output);
pinmode(left, output);
pinmode(forward, output);
pinmode(back, output);
pinmode(13, output);
digitalwrite(13, high);
while (millis() < 5000) {
value1 = analogread(a8);
value2 = analogread(a12);
if (value1 > max1) {
max1 = value1;
}
if (value2 > max2) {
max2 = value2;
}
if (value1 < min1) {
min1 = value1;
}
if (value2 < min2) {
min2 = value2;
}
}
(int i=0;i<10;i++)
a[i]= 0;
(int j=0;j<10;j++)
b[j]= 0;
digitalwrite(13, low);
}
void loop () {
while(x>0) {
int x1=0;
int x2=0;
int t1=0;
int t2=0;
value1 = 0;
value2 = 0;
while (c1 > 0) {
a[x1] = analogread(a8);
b[x2] = analogread(a12);
t1=t1+a[x1];
t2=t2+b[x2];
x1 = x1+1;
x2 = x2+1;
c1 = c1-1;
}
c1=10;
value1=t1/10;
value2=t2/10;
if (value1 >= max1-50 && value1 <= max1+50) {
digitalwrite(forward,high);
digitalwrite(back,low);
digitalwrite(left,low);
digitalwrite(right,low);
delay(50);
}
else if (value1 <= min1+50 && value1 >= min1-50) {
digitalwrite(forward,low);
digitalwrite(back,high);
digitalwrite(left,low);
digitalwrite(right,low);
delay(50);
}
if (value2 >= max2-50 && value2 <= max2+50 ) {
digitalwrite(forward,low);
digitalwrite(back,low);
digitalwrite(left,high);
digitalwrite(right,low);
delay(50);
}
else if (value2 <= min2+50 && value2 >=min2-50) {
digitalwrite(forward,low);
digitalwrite(back,low);
digitalwrite(left,low);
digitalwrite(right,high);
delay(50);
}
}
delay(200);
}
hi,
the problem seems user's human interface works ok when away wheelchair, fails when user seated on wheelchair??
this sounds emi (electromagnetic interference) problem.
you need tell lot more human interface , it's signals...
the problem seems user's human interface works ok when away wheelchair, fails when user seated on wheelchair??
this sounds emi (electromagnetic interference) problem.
you need tell lot more human interface , it's signals...
Arduino Forum > Using Arduino > Project Guidance > robot movement problem need some help
arduino
Comments
Post a Comment