diff options
author | neoraider <devnull@localhost> | 2007-04-13 19:58:03 +0200 |
---|---|---|
committer | neoraider <devnull@localhost> | 2007-04-13 19:58:03 +0200 |
commit | 7da669b97ec71f138c74d562b8a3b219d3f98a50 (patch) | |
tree | 089226274f422ae1b486cf44d36751de47bca01c /main.cpp | |
parent | e26a1dc73313098cef235918d237f9b1a6e4cb5f (diff) | |
download | rc2007-rescue-7da669b97ec71f138c74d562b8a3b219d3f98a50.tar rc2007-rescue-7da669b97ec71f138c74d562b8a3b219d3f98a50.zip |
Makefile angelegt; Grundfunktionen erweitert
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -1,5 +1,30 @@ +#include "hardware.h" +#include "Motor.h" +#include "Navigation.h" + + +Motor *motorLeft = new Motor(&PORTD, &OCR1BL, 0x01, 0x02); +Motor *motorBack = new Motor(&PORTD, &OCR1AL, 0x04, 0x08); +Motor *motorRight = new Motor(&PORTB, &OCR0, 0x01, 0x02); + +Navigation *navigation = new Navigation(motorLeft, 60.0, motorBack, 180.0, motorRight, 300.0); + + +static void delay() { + for(unsigned long i = 0; i < 25000; i++); +} + + int main() { + initHardware(); + + navigation->setSpeed(1.0); + for(int i = 0; ; i = (i+1)%360) { + navigation->setDirection(i); + + delay(); + } return 0; } |