summaryrefslogtreecommitdiffstats
path: root/source/AVR_Studio/Soccer/Soccer.c
blob: c1a812909192cd8408b81f93f1cc317938963223 (plain)
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
#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(2);
	int speed = 255;
	/*for(int i=-255;i<=255;i+=30) {
		board.motor(0,i);
		board.motor(1,i);
		board.motor(2,i);
		board.motor(3,i);
		sleep(1);
	}*/
	board.motor(0, speed);
	board.motor(1, speed);
	board.motor(2, speed);
	board.motor(3, speed);
	PORTB |= (1 << PB5) | (1 << PB7); // Setze PWM-Ports auf high
	PORTE |= (1 << PE3) | (1 << PE4); 
	//sleep(10);
	while(true) { sleep(1); }
	/*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(90,0,speed);
	sleep(2);
	navigation.Aktualisieren(180,0,speed);
	sleep(2);
	navigation.Aktualisieren(270,0,speed);
	sleep(2);

	}
	


	while(true)
	{
		//board.ledOn();
		//sleep(1);
		//board.ledOff();
		sleep(1);
	}
	//for(int i=0;i<=7;i++) board.GetADC(i);	

	return 0;
}