MikuQ Relay Module with Two Opticalcoupler Relay Info: 2A 30VDC or 1A 125VAC (Maximum support 250VAC)
Sample code:
#include < wiringPi.h> int main(void) { wiringPiSetup() ; pinMode (0, OUTPUT) ; pinMode (2, OUTPUT) ; for(;; ) { digitalWrite(2, LOW) ; delay (5) ; digitalWrite(2, HIGH) ; delay (1000) ; digitalWrite(0, LOW) ; delay (5) ; digitalWrite(0, HIGH) ; delay (4000) ; } }
ON 1S and OFF 4S In each period, only 10ms current consumption
very cool ,thank you.
BPI-M3
20W 220V energy-saving lamps
MikuQ Relay Module
Secure connection:
Run:
Gif:
1 Like
MikuQ Relay Module as the first module support by MikuDuino,it run well on BPI-M2+
/*
* relay.cpp:
*
* Welcome to MikuQ.com! MikuDuino for BananaPi
*
* by MikuQ([email protected]) 2016-6-4
*
* https://github.com/bpiq/MikuPi
*
*/
#include "MikuDuino.h"
#include "MikuRelay.h"
Miku_Relay relay;
void setup()
{
sayHello();
}
void loop()
{
relay.setOn();
delay(2000);
relay.setOff();
delay(8000);
}