Library for using the xbee-compatible Bluetooth Bee Module on an m3pi.
Dependencies: SensoryTest
Fork of btbee by
Diff: main.cpp
- Revision:
- 15:cc5b8a858c6e
- Parent:
- 14:7ddbd9f475ad
- Child:
- 16:2b437630e29e
--- a/main.cpp Wed May 21 12:06:54 2014 +0000 +++ b/main.cpp Wed May 21 12:20:43 2014 +0000 @@ -6,13 +6,13 @@ int main() { - float speed = 0.25; + float speed = 0.5; float correction; - float k = -0.3; + float k = -0.7; thinggy.locate(0,1); - thinggy.printf("Line Flw"); + thinggy.printf("HellzYa"); wait(1.0); @@ -26,7 +26,10 @@ //speed limiting for right motor if(speed + correction > 1){ - thinggy.right_motor(1); + thinggy.right_motor(0.6); + } + else if(speed + correction <= 0){ + thinggy.right_motor(0.1); } else{ thinggy.right_motor(speed+correction); @@ -34,7 +37,10 @@ //speed limiting for left motor if(speed - correction > 1){ - thinggy.left_motor(1); + thinggy.left_motor(0.6); + } + else if(speed - correction <= 0){ + thinggy.left_motor(0.1); } else{ thinggy.left_motor(speed-correction);