Code for the car to drive in a figure eight motion
Dependencies: mbed-rtos mbed MODSERIAL mbed-dsp telemetry
main.cpp@2:3eb545c3e6a1, 2015-03-19 (annotated)
- Committer:
- ericoneill
- Date:
- Thu Mar 19 04:17:22 2015 +0000
- Revision:
- 2:3eb545c3e6a1
- Parent:
- 0:2002d645d2a6
- Child:
- 4:03594bf9a0de
pinouts added
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ericoneill | 0:2002d645d2a6 | 1 | #include "mbed.h" |
ericoneill | 2:3eb545c3e6a1 | 2 | #include "telemetry.h" |
ericoneill | 2:3eb545c3e6a1 | 3 | #include "rtos.h" |
ericoneill | 0:2002d645d2a6 | 4 | |
ericoneill | 2:3eb545c3e6a1 | 5 | // Camera Pins |
ericoneill | 2:3eb545c3e6a1 | 6 | DigitalOut clk(PTA13); |
ericoneill | 2:3eb545c3e6a1 | 7 | DigitalOut si(PTD4); |
ericoneill | 2:3eb545c3e6a1 | 8 | AnalogIn camData(PTC2); |
ericoneill | 2:3eb545c3e6a1 | 9 | //Servo, Motor, Serial Pins |
ericoneill | 2:3eb545c3e6a1 | 10 | PwmOut servo(PTA5); |
ericoneill | 2:3eb545c3e6a1 | 11 | PwmOut motor(PTA4); |
ericoneill | 2:3eb545c3e6a1 | 12 | Serial pc(USBTX, USBRX); |
ericoneill | 2:3eb545c3e6a1 | 13 | // Interrupt for encoder |
ericoneill | 2:3eb545c3e6a1 | 14 | InterruptIn interrupt(PTA13); |
ericoneill | 0:2002d645d2a6 | 15 | |
ericoneill | 0:2002d645d2a6 | 16 | int main() { |
ericoneill | 0:2002d645d2a6 | 17 | while(1) { |
ericoneill | 2:3eb545c3e6a1 | 18 | |
ericoneill | 0:2002d645d2a6 | 19 | } |
ericoneill | 0:2002d645d2a6 | 20 | } |