Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <SoftwareSerial.h>
- #include <RadioBlock.h>
- //Pins connected to RadioBlock pins3/4, VCC/GND connected externally
- RadioBlockSerialInterface radio = RadioBlockSerialInterface(-1,-1,3,2);
- uint8_t data[] = {2};
- void setup()
- {
- radio.begin();
- Serial.begin(9600);
- Serial.println("Starting...");
- pinMode(13, INPUT_PULLUP);
- pinMode(12, INPUT_PULLUP);
- //Set up this device
- //radio.setAddress(0x0001);
- //radio.setChannel(25);
- }
- void loop() // run over and over
- {
- //Turn on our LED
- if (digitalRead(13) == LOW) {
- radio.sendData(0xBAAD, 1);
- radio.setLED(true);
- }
- if (digitalRead(12) == LOW) {
- radio.sendData(0xBAAD, 2);
- radio.setLED(true);
- }
- //wait
- delay(1000);
- radio.setLED(false);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement