Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed HC_SR04_Ultrasonic_Library Nucleo_Sensor_Shield VL6180x_lib
Fork of Coupe Robotique FIP by
main.cpp
- Committer:
- julientiron
- Date:
- 2015-07-07
- Revision:
- 15:4d1ac5094455
- Parent:
- 14:4f85e35de719
File content as of revision 15:4d1ac5094455:
#include "mbed.h" #include "ultrasonic.h" #include "VL6180x.h" #include "easyspin.h" #define VL6180X_ADDRESS 0x29 Easyspin myEasyspin; DigitalInOut sdaDummy(D14); DigitalInOut sclDummy(D15); VL6180xIdentification identification; // mbed uses 8bit addresses shift address by 1 bit left VL6180x sensor(D14, D15, VL6180X_ADDRESS<<1); int main() { sdaDummy.mode(PullUp); sclDummy.mode(PullUp); myEasyspin.Begin(2); while(1) { if(sensor.getDistance()<255) { myEasyspin.Run(0, FORWARD); myEasyspin.Run(1, FORWARD); } else { myEasyspin.Run(0, FORWARD); myEasyspin.Run(1, BACKWARD); } wait_ms(200); } }