![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Roboter
main.cpp@0:306a2438de17, 2017-03-21 (annotated)
- Committer:
- itslinear
- Date:
- Tue Mar 21 12:42:01 2017 +0000
- Revision:
- 0:306a2438de17
- Child:
- 1:4e84271a70c6
hoiii
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
itslinear | 0:306a2438de17 | 1 | #include <mbed.h> |
itslinear | 0:306a2438de17 | 2 | #include "Roboter.h" |
itslinear | 0:306a2438de17 | 3 | |
itslinear | 0:306a2438de17 | 4 | DigitalOut led(LED1); |
itslinear | 0:306a2438de17 | 5 | |
itslinear | 0:306a2438de17 | 6 | //Periphery for distance sensors |
itslinear | 0:306a2438de17 | 7 | AnalogIn distance(PB_1); |
itslinear | 0:306a2438de17 | 8 | DigitalOut enable(PC_1); |
itslinear | 0:306a2438de17 | 9 | DigitalOut bit0(PH_1); |
itslinear | 0:306a2438de17 | 10 | DigitalOut bit1(PC_2); |
itslinear | 0:306a2438de17 | 11 | DigitalOut bit2(PC_3); |
itslinear | 0:306a2438de17 | 12 | IRSensor sensors[6]; |
itslinear | 0:306a2438de17 | 13 | |
itslinear | 0:306a2438de17 | 14 | //motor stuff |
itslinear | 0:306a2438de17 | 15 | DigitalOut enableMotorDriver(PB_2); |
itslinear | 0:306a2438de17 | 16 | PwmOut pwmL(PA_8); |
itslinear | 0:306a2438de17 | 17 | PwmOut pwmR(PA_9); |
itslinear | 0:306a2438de17 | 18 | |
itslinear | 0:306a2438de17 | 19 | //indicator leds arround robot |
itslinear | 0:306a2438de17 | 20 | DigitalOut leds[] = { PC_8, PC_6, PB_12, PA_7, PC_0, PC_9 }; |
itslinear | 0:306a2438de17 | 21 | |
itslinear | 0:306a2438de17 | 22 | |
itslinear | 0:306a2438de17 | 23 | int main(){ |
itslinear | 0:306a2438de17 | 24 | |
itslinear | 0:306a2438de17 | 25 | |
itslinear | 0:306a2438de17 | 26 | |
itslinear | 0:306a2438de17 | 27 | |
itslinear | 0:306a2438de17 | 28 | |
itslinear | 0:306a2438de17 | 29 | return 0; |
itslinear | 0:306a2438de17 | 30 | } |