1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
#include "global.h"
#include "hal/keylcd.h"
#include "navigation.h"
#include "sensor/sensor.h"
Board board;
KeyLCD keylcd;
Navigation navigation;
Sensor sensor;
int main() {
//board.ledOn();
sleep(1);
uart1_puts("Hallo hier ist das RNMega128Funk-Board");
while(true)
{
uart1_puts("3");
sleep(1);
}
int speed = 100;
/*for(int i=0;i<360;i+=5) {
navigation.Aktualisieren(0,i,0);
msleep(1000);
}*/
/*sleep(2);
board.motor(0,0);
board.motor(1,0);
board.motor(2,0);
board.motor(3,0);
while(true) { sleep(1); }*/
/*board.motor(0,speed);
board.motor(2,speed);
sleep(2);
board.motor(0,speed);
board.motor(2,0);
board.motor(1,speed);
sleep(2);
for(int i=-255;i<=255;i+=10) {
board.motor(0,i);
board.motor(1,i);
board.motor(2,i);
board.motor(3,i);
msleep(500);
}
board.motor(0, speed);
board.motor(1, speed);
board.motor(2, speed);
board.motor(3, speed);
while(true) { sleep(1); }*/
/*
//PORTB |= (1 << PB5) | (1 << PB6); // Setze PWM-Ports auf high
//PORTE |= (1 << PE3); // | (1 << PE4);
//PORTA |= (1 << PA5); // | (1 << PA5);
//sleep(10);
*/
/*sleep(10);
board.motor(0, 0);
board.motor(1, 0);
board.motor(2, 0);
board.motor(3, 0);*/
//while(true) { sleep(1); }
//board.beep(450);
//board.ledOn();
/*keylcd.print("test");
sleep(1);
//board.ledOff();
//sleep(1);
for(int i=0;i<keylcd.error();i++) {
board.ledOn();
sleep(1);
board.ledOff();
sleep(1);
}
board.ledOn();
uart1_puts("18");
uart1_puts("Hallo Du! Hier ist dein AtMega128\n");
sleep(1);
board.ledOff();
sleep(10);
//board.ledOff();*/
while(true) {
navigation.Aktualisieren(0,0,speed);
sleep(2);
navigation.Aktualisieren(135,0,speed);
sleep(2);
navigation.Aktualisieren(180,0,speed);
sleep(2);
navigation.Aktualisieren(225,0,speed);
sleep(2);
board.motor(0,0);
board.motor(1,0);
board.motor(2,0);
board.motor(3,0);
sleep(2);
}
while(true)
{
//board.ledOn();
//sleep(1);
//board.ledOff();
sleep(1);
}
//for(int i=0;i<=7;i++) board.GetADC(i);
return 0;
}
|