I spent some hours today to make the Ports library from Jeelabs compatible with Norduino.
The main issue is to remove the RF12 library dependency and introduce the Norduino RF class.
For instance say you are using the blink demo you would see:
#include <Ports.h>
#include <RF12.h>
BlinkPlug buttons (3);
void setup () {
Serial.begin(57600);
Serial.println("\n[blink_demo]");
for (byte i = 0; i < 3; ++i) {
buttons.ledOn(1);
delay(500);
buttons.ledOn(2);
delay(500);
buttons.ledOff(1+2);
delay(500);
}
}
the problem is that we don’t have the RF12 module any more so what I did was to exclude the following classes:
- class RemotePort
- class RemoteNode
- class RemoteHandler
So in Ports.h I have defined a flag in this way:
#ifndef Ports_h #define Ports_h #include#include #include #define NorduinoRF 1 .....
which basically eliminates the dependency from the PortsRF12.cpp and the RF12.cpp classes.
This is a temporary fix which allow you to use the plugs but I’m working on a final fix to replace the RemotPort etc.
The patched libraries are available in the github repository and i’m going to post another tutorial with a simple demo.
Cheeeeeeeeeeers.
