IDUINO for maker’s life User Manual For RF905 Transceiver Module(ME109) www.openplatform.
IDUINO for maker’s life Description This wireless module board adapts high-performance Nordic VLSI NRF905 radio chip, the maximum transmission data rates up to 50Kbps with GFSK, sensitivity to-100dBm, high reliability, it is widely used in various occasions, short-range wireless communications (such as wireless meter reading, industrial remote control, lowpower handheld equipment, etc.) Features: Operating voltage: 1.9 ~ 3.6V, ( 3.
IDUINO for maker’s life Pinout VCC CE TXE PWR Arduino Uno pin connected 3.3V 7 9 8 CD 2 AM - DR 3 SO SI SCK CSN GND 12 11 13 10 GND nRF905 Pin Pin Description Power(3.
IDUINO for maker’s life **********Code Begin********* /* * Wireless serial link * * 7 -> CE * 8 -> PWR * 9 -> TXE * 2 -> CD * 3 -> DR * 10 -> CSN * 12 -> SO * 11 -> SI * 13 -> SCK */ www.openplatform.
IDUINO for maker’s life #include #include #define PACKET_TYPE_DATA #define PACKET_TYPE_ACK 0 1 #define MAX_PACKET_SIZE (NRF905_MAX_PAYLOAD - 2) typedef struct { byte dstAddress[NRF905_ADDR_SIZE]; byte type; byte len; byte data[MAX_PACKET_SIZE]; } packet_s; void setup() { // Start up nRF905_init(); // Put into receive mode nRF905_receive(); Serial.begin(9600); Serial.println(F("Ready")); } void loop() { packet_s packet; // Send serial data byte dataSize; while((dataSize = Serial.
IDUINO for maker’s life for(byte i=0;i 50) // 50ms timeout { timeout = true; break; } } if(timeout) // Timed out { Serial.println(F("TO")); break; } else if(packet.
IDUINO for maker’s life // Got a packet and is it a data packet? { // Print data Serial.write(packet.data, packet.len); // Reply with ACK packet.type = PACKET_TYPE_ACK; packet.len = 0; sendPacket(&packet); // Put into receive mode nRF905_receive(); } else if(Serial.
IDUINO for maker’s life // Get a packet static bool getPacket(void* _packet) { // Void pointer to packet_s pointer hack // Arduino puts all the function defs at the top of the file before packet_s being declared :/ packet_s* packet = (packet_s*)_packet; byte buffer[NRF905_MAX_PAYLOAD]; // See if any data available if(!nRF905_getData(buffer, sizeof(buffer))) return false; // Convert byte array to packet packet->type = buffer[0]; packet->len = buffer[1]; // Sanity check if(packet->len > MAX_PACKET_SIZE) packe