

** * getTime * Get the time from rtc module and convert it to uint16_t * rtc Array for buffering the obtained time * * None */ void getTime( uint16_t *rtc) Get 16A Relay Module (Arduino Compatible) from DFRobot Store or DFRobot Distributor./** * begin * Init function * true indicate init succeed false indicate init failed */ bool begin( void) Sending a digital low or "0" will disable the relay. Sending a digital high or a "1" will trigger the relay.

The relay should have the positive wire of the device being used connected to "IN" and to "Out 1" as shown in figure 2, and any digital signal pin on the arduino end (For example pin 13). We recommend using a swappable cable to do this with, as using a relay requires you to perform some minor surgery on the appliance's cable.Ĭut and strip a portion of the positive wire so that you end up with two ends of the wire as shown in Figure 2. We will use "out1" for our example, using "out2" will simply reverse the logic, as explained above. PinMode(Relay, OUTPUT) //Set Pin3 as outputĭigitalWrite(Relay, HIGH) //Turn off relayĭigitalWrite(Relay, LOW) //Turn on relay PinMode(13, OUTPUT) //Set Pin13 as output
#DFROBOT GRAVITY CIRCUIT CODE#
# This sample code is combined with the figure above to test the relay module whether works normally. (DO NOT CONNECT IT TO THE WALL WHILE MESSING WITH THE CABLE!) Test Connection Diagram Make sure the appliance to be tinkered with is unplugged from mains. WARNING: Please be very carful not to play with live circuits! 120V or 220V should not be taken lightly. NO(OUT2): Normally open, which means that when the relay is on (a digital high "1" is received from Arduino) the device is ON.

