Line 26... |
Line 26... |
26 |
|
26 |
|
27 |
int wissel = 0;//wissel means change in dutch |
27 |
int wissel = 0;//wissel means change in dutch |
28 |
|
28 |
|
29 |
void setup() { |
29 |
void setup() { |
30 |
|
30 |
|
31 |
Serial.begin(57600); |
31 |
Serial.begin(9600); |
32 |
Serial.print("hello" ); |
32 |
Serial.print("hello" ); |
33 |
Serial.println("init" ); |
33 |
Serial.println("init" ); |
34 |
|
34 |
|
35 |
|
35 |
|
36 |
rf02_prepAll434(); |
36 |
rf02_prepAll434(); |
Line 48... |
Line 48... |
48 |
digitalWrite(num, LOW); |
48 |
digitalWrite(num, LOW); |
49 |
delay(100); |
49 |
delay(100); |
50 |
} |
50 |
} |
51 |
|
51 |
|
52 |
|
52 |
|
53 |
void loop() { |
53 |
void loop() |
- |
|
54 |
{ |
54 |
|
55 |
|
55 |
ledBlink(4); |
56 |
// ledBlink(4); |
56 |
|
57 |
|
57 |
delay(1550); |
58 |
delay(10); |
58 |
Serial.print(wissel ); |
- |
|
59 |
Serial.println(" send: "); |
- |
|
60 |
|
- |
|
61 |
|
59 |
|
62 |
switch ( wissel) |
60 |
// unsigned char buf[] = { "01234567890123456789012345678901\n" }; // Motor, Rudder |
- |
|
61 |
unsigned char buf[] = { "012345678901234567890123456789012345678901234567890123456789" }; |
63 |
{ |
62 |
|
64 |
case 0: |
63 |
buf[30]=0; |
65 |
{ |
- |
|
66 |
unsigned char buf[] = { "hello World! \n" }; |
64 |
buf[31]=0xAA; |
67 |
rf02_changeText( buf, sizeof buf); |
65 |
rf02_changeText( buf, 32); |
68 |
Serial.println("hello World! \n"); |
- |
|
69 |
rf02_sendData(); |
- |
|
70 |
wissel = 1; |
- |
|
71 |
break; |
- |
|
72 |
} |
- |
|
73 |
case 1: |
- |
|
74 |
{ |
66 |
|
75 |
unsigned char buf[] = { "Goodbye Life! \n" }; |
- |
|
76 |
Serial.println("Goodbye Life! \n"); |
- |
|
77 |
rf02_changeText( buf, sizeof buf); |
67 |
// rf02_changeText( buf, sizeof buf); |
78 |
rf02_sendData(); |
- |
|
79 |
wissel = 2; |
- |
|
80 |
break; |
- |
|
81 |
} |
- |
|
82 |
case 2: |
- |
|
83 |
{ |
- |
|
84 |
unsigned char buf[] = { "Bless all! \n" }; |
- |
|
85 |
Serial.println("Bless all! \n"); |
68 |
// Serial.println("M0R0\n"); |
86 |
rf02_changeText( buf, sizeof buf); |
- |
|
87 |
rf02_sendData(); |
69 |
rf02_sendData(); |
88 |
wissel = 0; |
- |
|
89 |
break; |
- |
|
90 |
} |
- |
|
91 |
} |
- |
|
92 |
} |
70 |
} |
93 |
|
71 |
|
94 |
|
72 |
|