Create a 433-rf-device. Can be used as transmitter or receiver. Arduino will use pin 12 to send data to the transmitter and pin 11 to get data from the receiver.
433-rf-device
@/433-rf-device
Create a 433-rf-device. Can be used as transmitter or receiver. Arduino will use pin 12 to send data to the transmitter and pin 11 to get data from the receiver.
DEV@/433-rf-device
A 433-rf-device.
To use the node in your project you should have the wayland/433mhz-rf-module library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.
C++ implementation
// Tell XOD where it could download the library:
#pragma XOD require "https://github.com/adafruit/RadioHead"
//Include C++ libraries
{{#global}}
#include <RH_ASK.h>
#include <SPI.h>
{{/global}}
//Reserve memory to store an instance of the class RH_ASK
struct State {
uint8_t mem[sizeof(RH_ASK)];
};
// Define our custom type as a pointer on the class instance.
using Type = RH_ASK*;
{{ GENERATED_CODE }}
void evaluate(Context ctx) {
if (!isSettingUp()) return;
auto state = getState(ctx);
// Create a new object in the memory area reserved previously.
Type driver = new (state->mem) RH_ASK();
if (!driver->init()) {
raiseError(ctx);
return;
}
emitValue<output_DEV>(ctx, driver);
}