44 lines
951 B
C++
Executable File
44 lines
951 B
C++
Executable File
//Connect transmitter facing inwards to pins A3, A4 and A5
|
|
//Connect microSD breakout boards as follows:
|
|
//
|
|
// 5v Pin to 5v Pin
|
|
// GND to GND
|
|
// CLK to Pin 13 (do not worry about LED)
|
|
// DO to 12
|
|
// DI to 11
|
|
// CS to 10
|
|
// CD to nothing. CD is for and LED light when a microSd is connect and is not necessary for transfers
|
|
|
|
#include <VirtualWire.h>
|
|
|
|
const int transmit_pin = 9;
|
|
const int receive_pin = 2;
|
|
const int transmit_en_pin = 3;
|
|
const int chipSelect = 10;
|
|
char data;
|
|
|
|
void setup()
|
|
{
|
|
// Initialise the IO and ISR
|
|
vw_set_tx_pin(transmit_pin);
|
|
vw_set_rx_pin(receive_pin);
|
|
vw_set_ptt_pin(transmit_en_pin);
|
|
vw_set_ptt_inverted(true); // Required for DR3100
|
|
|
|
vw_setup(3000); // Bits per sec
|
|
|
|
Serial.begin(9600);
|
|
while (!Serial) {} // wait for Arduino
|
|
|
|
|
|
|
|
}
|
|
|
|
void loop()
|
|
{
|
|
char buffMsg[] = "########This is a buffer message \n";
|
|
vw_send((uint8_t *)buffMsg, 1);
|
|
vw_wait_tx();
|
|
delay(5000);
|
|
}
|