Robot using IMU and IR sensor data to drive autonomously and create a map
Dependencies: mbed mbed-rtos LSM9DS1_Library_cal Motor
Diff: main.cpp
- Revision:
- 5:665b9dc3d22f
- Parent:
- 4:18e9f16cc53c
--- a/main.cpp Sun Apr 10 22:03:16 2016 +0000 +++ b/main.cpp Tue Apr 26 18:25:30 2016 +0000 @@ -93,3 +93,25 @@ } } + + +//driving robot +/* + +#include "mbed.h" + +//dual H bridge Polulu +PwmOut PWMA(p21); //connect p21 to PWMA +PwmOut PWMB(p22); //connect p22 to PWMB +DigitalOut Ain1(p23); //connect p23 to Ain1 +DigitalOut Ain2(p24); //connect p24 to Ain2 + +int main() { + Ain1=Ain2=1; //enabling PWM + while(1) { + PWMA.write(0.5f); //writing 50% duty cycle + PWMB.write(0.5f); //to pwm A and B + } +} + +*/ \ No newline at end of file