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: MODSERIAL mbed-rtos mbed
Fork of Master by
Diff: main.cpp
- Revision:
- 0:4f07ba929908
- Child:
- 1:e1cfb5850088
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Sep 11 10:15:34 2014 +0000 @@ -0,0 +1,57 @@ +//Master mbed Program + +#include "mbed.h" +#include "fm.h" +#include "bluetooth.h" + +#define red_v 0.01 +#define center_pos 0.80 +#define late_time 0.3 +#define zeroPWM 0.17 + +//port +Serial pc(USBTX, USBRX); // tx, rx + +//sensor +AnalogIn Red1(p17); +AnalogIn FSR1(p18); +AnalogIn Red2(p19); +AnalogIn FSR2(p20); + +//debug +DigitalOut led1(LED1); +DigitalOut led2(LED2); +DigitalOut led4(LED4); + +//motor +DigitalOut Sig11(p24); +DigitalOut Sig12(p26); +PwmOut Pwm1(p25); +DigitalOut Sig21(p21); +DigitalOut Sig22(p23); +PwmOut Pwm2(p22); + +DigitalOut myled1(LED1); +DigitalOut myled2(LED2); + +//byte converter +Cvt cvt; + +void btRead(void); + +int main() +{ + i2cSetup( 780 ); + btSetupMaster(); + while(1){ + /*i2c.start(); + i2c.write(0x11); + i2c.write(0x42); + i2c.write(0x07); + i2c.write(0x0F); + i2c.stop(); + wait(0.05);*/ + } + } + +