I'm using the Arduino Manager package (app and generate sketch) to use the push button widget to turn a relay on and off. This is a momentary button. The package generated the sketch below but I can not get it to activate the relay. I'm using an RFduino Bluetooth board and a breakout relay. I have confirmed that communication between the RFduino and the iphone works. Any suggestions why the relay is not getting energized?
Thank you
#include <RFduinoBLE.h>
#include "IOSControllerForRFduino.h"
#define PB_PIN 4
IOSControllerForRFduino iosController(&doWork,&doSync,&processIncomingMessages,&processOutgoingMessages,NULL,NULL);
void setup()
{
Serial.begin(9600);
RFduinoBLE.deviceName = "A Manager";
RFduinoBLE.advertisementData = "data";
RFduinoBLE.advertisementInterval = MILLISECONDS(250);
RFduinoBLE.txPowerLevel = -20; // (-20dbM to +4 dBm) +4, 0, -4, -8, -12, -16 and -20
pinMode(PB_PIN,OUTPUT);
digitalWrite(PB_PIN,LOW);
}
void loop() {
iosController.loop();
}
void doWork() {
}
void doSync (char *variable) {
}
void processIncomingMessages(char *variable, char *value) {
if(strcmp(variable,"PB")==0) {
pushButtonPBCallback(atoi(value));
}
}
void processOutgoingMessages() {
}
void pushButtonPBCallback(boolean pushed) {
iosController.temporaryDigitalWrite(PB_PIN,LOW,0);
}