Updated sketches for TEI workshop

This commit is contained in:
Bill Verplank
2013-02-09 21:38:08 +01:00
parent 9260d066ba
commit bae5b3d412
12 changed files with 396 additions and 18 deletions
@@ -18,8 +18,8 @@ void setup(){
}
void loop(){
//x = analogRead(A0) - 512;
x = analogRead(A3) - 512;
x = analogRead(A0) - 512;
//x = analogRead(A3) - 512;
if (forward){
if (x <= - w/2) f = 0;
if (x > -w/2 && x< w/2) f = - slope*(x + w/2);
@@ -40,8 +40,8 @@ void loop(){
}
}
fout = int(f);
//MotorA.torque(fout);
MotorB.torque(fout);
MotorA.torque(fout);
//MotorB.torque(fout);
if(count++>=0){
count=-1000; // wait 1000 loops before print
Serial.print(x,DEC);