Line 31... |
Line 31... |
31 |
Serial.begin(9600); |
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_prepAll(); |
37 |
Serial.println("done" ); |
37 |
Serial.println("done" ); |
38 |
|
38 |
|
39 |
pinMode(4, OUTPUT); //testing leds |
39 |
pinMode(4, OUTPUT); //testing leds |
40 |
pinMode(5, OUTPUT); |
40 |
pinMode(5, OUTPUT); |
41 |
ledBlink(4); |
41 |
ledBlink(4); |
Line 47... |
Line 47... |
47 |
delay(100); |
47 |
delay(100); |
48 |
digitalWrite(num, LOW); |
48 |
digitalWrite(num, LOW); |
49 |
delay(100); |
49 |
delay(100); |
50 |
} |
50 |
} |
51 |
|
51 |
|
- |
|
52 |
unsigned int ble='a'; |
52 |
|
53 |
|
53 |
void loop() |
54 |
void loop() |
54 |
{ |
55 |
{ |
55 |
|
56 |
|
56 |
// ledBlink(4); |
57 |
// ledBlink(4); |
57 |
|
58 |
|
58 |
delay(10); |
59 |
delay(1000); |
59 |
|
60 |
|
60 |
// unsigned char buf[] = { "01234567890123456789012345678901\n" }; // Motor, Rudder |
61 |
// unsigned char buf[] = { "01234567890123456789012345678901\n" }; // Motor, Rudder |
61 |
unsigned char buf[] = { "012345678901234567890123456789012345678901234567890123456789" }; |
62 |
unsigned char buf[] = { "0123456789012345678$0123456789" }; |
62 |
|
63 |
|
- |
|
64 |
unsigned char sum=0; |
- |
|
65 |
//buf[19]=ble; |
- |
|
66 |
for(unsigned int a=0;a<20;a++) |
- |
|
67 |
{ |
- |
|
68 |
sum+=buf[a]; |
- |
|
69 |
}; |
- |
|
70 |
if(ble>'z') {ble='a';} else {ble++;} |
63 |
buf[30]=0; |
71 |
buf[20]=sum; |
64 |
buf[31]=0xAA; |
72 |
buf[21]=0xAA; |
- |
|
73 |
buf[22]=0xAA; |
65 |
rf02_changeText( buf, 32); |
74 |
rf02_changeText( buf, 23); |
66 |
|
75 |
|
67 |
// rf02_changeText( buf, sizeof buf); |
76 |
// rf02_changeText( buf, sizeof buf); |
68 |
// Serial.println("M0R0\n"); |
77 |
// Serial.println("M0R0\n"); |
69 |
rf02_sendData(); |
78 |
rf02_sendData(); |
70 |
} |
79 |
} |