2139 |
kakl |
1 |
/* |
|
|
2 |
RF02 TX duckweed collector |
|
|
3 |
|
|
|
4 |
in arduino version 022 |
|
|
5 |
|
|
|
6 |
tested with MLAB modules with ATmega 328 at 16MHz |
|
|
7 |
see RF02 library for a Band and Frequency |
|
|
8 |
*/ |
|
|
9 |
|
|
|
10 |
//connections RF01: (RX) |
|
|
11 |
// RF01 SDI, arduino 13, ATmega PB5, cannot be changed |
|
|
12 |
// RF01 SCK, arduino 12, ATmega PB4, cannot be changed |
|
|
13 |
// RF01 nSEL, arduino 11, ATmega PB3, cannot be changed |
|
|
14 |
// RF01 SDO, arduino 10, ATmega PB2, cannot be changed |
|
|
15 |
// RF01 niRQ, arduino 02, ATmega PD2, cannot be changed |
|
|
16 |
// RF01 nFFS: 1-10k Pullup too Vcc |
|
|
17 |
|
|
|
18 |
|
|
|
19 |
// receiving words with RF01 |
|
|
20 |
|
|
|
21 |
#include <RF01.h> |
|
|
22 |
|
|
|
23 |
void setup() |
|
|
24 |
{ |
|
|
25 |
Serial.begin(9600); |
|
|
26 |
Serial.println("\nRFM01 init"); |
|
|
27 |
delay(250); |
|
|
28 |
|
|
|
29 |
rf01_prepAll(); |
|
|
30 |
|
|
|
31 |
Serial.println("done"); |
|
|
32 |
} |
|
|
33 |
|
|
|
34 |
void loop() |
|
|
35 |
{ |
|
|
36 |
int n; |
|
|
37 |
char* buf = (char*) _rx_buffer; |
|
|
38 |
|
|
|
39 |
rf01_rxdata(_rx_buffer, 10); |
|
|
40 |
buf[11]=0; |
|
|
41 |
|
|
|
42 |
Serial.println(buf); |
|
|
43 |
for(n=0;n<32;n++) {Serial.print(buf[n], HEX); Serial.print(' ');} |
|
|
44 |
Serial.println(); |
|
|
45 |
} |