Peihsun Yeh
/
ECE4180FinalV4
CarlsenBot working
Diff: notes.h
- Revision:
- 0:cdd566529530
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/notes.h Wed May 01 16:00:53 2013 +0000 @@ -0,0 +1,86 @@ + /* + while(motor_x1.ticks < pos){ + spd = (((float)pos-(float)motor_x1.ticks))/pos; + spd*=0.6; + if(spd < 0.2) spd = 0.2 + ; + motor_x1.speed(spd); + motor_x2.speed(spd); + pc.printf("Ticks: %d, speed: %f\n", motor_x1.ticks, spd); + wait(0.001); + motor_x1.speed(0); + } + */ + /* + wait(0.5); + while(motor_x1.ticks != pos){ + if(motor_x1.ticks > pos) spd = -0.2; + else spd = 0.2; + motor_x1.speed(spd); + motor_x2.speed(spd); + pc.printf("Ticks: %d, speed: %f\n", motor_x1.ticks, spd); + wait(0.01); + motor_x1.speed(0); + motor_x2.speed(0); + } + */ + +//something here + + /* + //set coordinates given for testing (numOfSquares for testing only) + numOfSquaresX = 1; + numOfSquaresY = 1; + + //when actually recieveing data, change numOfSquares to srcX + sourceX = numOfSquaresX * 210 - clawLocationX; + sourceY = numOfSquaresY * 181 - clawLocationY; + + moveX(sourceX); + moveY(sourceY); + wait(1); + claw = OPEN; + wait(1); + moveZ(0.49); + claw = CLOSE; + wait(1); + moveZ(0.36); + + //need to set clawLocation here + + //set coordinates given for testing (numOfSquares for testing only) + numOfSquaresX = 2; + numOfSquaresY = 1; + + //when actually recieveing data, change numOfSquares to destX + destinationX = numOfSquaresX * 210 - clawLocationX; + destinationY = numOfSquaresY * 181 - clawLocationY; + + moveX(destinationX); + moveY(destinationY); + wait(1); + moveZ(0.49); + wait(1); + claw = OPEN; + wait(1); + moveZ(0.36); + */ + //need to set clawLocation here again + + /* + // test program (opens claw, picks up piece below, and moves to new destination) + claw = OPEN; + wait(1); + moveZ(0.49); + claw = CLOSE; + wait(1); + moveZ(0.36); + moveX(210); //210 per one square of X + moveY(181); //181 per one square of Y + wait(1); + moveZ(0.49); + wait(1); + claw = OPEN; + wait(1); + moveZ(0.36); + */ \ No newline at end of file