Power Brick Firmware
The Photon firmware for the Power Brick is straight forward (it is a subset of the firmware for the light switch). It includes a Spark function called "switchRelay"; a Particle variable called "relayState", a routine called switchRelay() to set output pins to control the relay and the LEDs; and the main loop() just constantly cycling to see if anything has changed. The code is downloadable - see bottom of the page for powerbrick.ino. (Open it with the Arduino IDE, and then cut and paste it into the Particle Web IDE, and flash it to your Photon - you will need to change all "Spark" text to "Particle").
The Photon firmware for the Power Brick is straight forward (it is a subset of the firmware for the light switch). It includes a Spark function called "switchRelay"; a Particle variable called "relayState", a routine called switchRelay() to set output pins to control the relay and the LEDs; and the main loop() just constantly cycling to see if anything has changed. The code is downloadable - see bottom of the page for powerbrick.ino. (Open it with the Arduino IDE, and then cut and paste it into the Particle Web IDE, and flash it to your Photon - you will need to change all "Spark" text to "Particle").
powerbrick.ino | |
File Size: | 2 kb |
File Type: | ino |