void CommClass::init() { #ifdef USE_433MHZ #ifdef WIRELESS_TRANSFER vw_set_ptt_inverted(true); vw_set_tx_pin(WIRELESS_433MHZ_TRANSFER_PIN); vw_setup(WIRELESS_SPEED);// speed of data transfer bits per second #endif #ifdef WIRELESS_RECEIVE vw_set_ptt_inverted(true); vw_set_rx_pin(WIRELESS_433MHZ_RECEIVE_PIN); vw_setup(WIRELESS_SPEED); // Bits per sec vw_rx_start(); // Start the receiver PLL running latestDataType = TYPE_NONE; #endif #endif //USE_433MHZ #ifdef USE_NRF24L rf24_module.begin(); rf24_module.setAutoAck(1); // Ensure autoACK is enabled rf24_module.enableAckPayload(); // Allow optional ack payloads rf24_module.setRetries(0, 10); // Smallest time between retries, max no. of retries rf24_module.setPayloadSize(MAX_PAYLOAD); // Here we are sending 1-byte payloads to test the call-response speed rf24_module.setDataRate(RF24_1MBPS); #ifdef WIRELESS_TRANSFER rf24_module.openWritingPipe((uint8_t*)WIRELESS_QUAD_ADDR); rf24_module.openReadingPipe(1, (uint8_t*)WIRELESS_QUAD_CTRL); #endif #ifdef WIRELESS_RECEIVE rf24_module.openWritingPipe((uint8_t*)WIRELESS_QUAD_CTRL); rf24_module.openReadingPipe(1, (uint8_t*)WIRELESS_QUAD_ADDR); #endif rf24_module.startListening(); // Start listening rf24_module.powerUp(); rf24_module.printDetails(); // Dump the configuration of the rf unit for debugging #endif //USE_NRF24L #ifdef USE_APC_220 //apc220.begin(WIRELESS_SPEED); #endif //USE_APC_220 }
void setup() { Serial.begin(9600); // Debugging only Serial.println("setup"); // Initialise the IO and ISR vw_set_ptt_inverted(true); // Required for DR3100 vw_setup(2000); // Bits per sec vw_rx_start(); // Start the receiver PLL running }
void setup() { // Inicializamos el monitor serie Serial.begin(9600); // Marcamos el pin del LED como salida para tenerlo de referencia pinMode(13, OUTPUT); // Inicializamos el receptor de señal vw_set_ptt_inverted(true); vw_setup(2000); vw_rx_start(); }
void setup() { delay(1000); Serial.begin( 9600 ); // Debugging only vw_set_rx_pin( RECEIVE_PIN ); vw_set_ptt_inverted( true ); // Required for DR3100 vw_setup( 2000 ); // Bits per sec vw_rx_start(); // Start the receiver PLL running lcd.begin( 16, 2 ); delay( 2000 ); }