Relay output 8-point module, A contact output, the contacts are shorted when turned on, and open when turned off.
CFDO-8R shares an address with CFDO-16N module. In other words, addresses already in use by CFDO-16N cannot be used.
1. <html>
#include "CFMEGA.h"
</html> library registration
2. CFNET object creation: CFNET object name ⇒ CFNET cfnet;
3. Call the function(s): Object name.digitalWrite(); ⇒ cfnet.digitalWrite(0, 0xff);
Turns all 8 output ports of the specified address module into On and Off states with 8bit data values. (8bit write)
address: The address of the module as configured by its DIP switch (0~7)data: On/Off value between 0x00 and 0xFF (8bit)Turns one port of the specified address module’s pin on or off. (1 bit write)
address: The address of the module as configured by its DIP switch (0~7)pin: Pin index (0 ~ 7)on_off: 0 or 1 (0=off, 1=on)#include "CFMEGA.h" CFNET cfnet; void setup() { cfnet.digitalWrite(0, 0XFF); delay(1000); cfnet.digitalWrite(0, 0X00); delay(1000); } void loop() { for(int i=0; i<16; i++){ cfnet.digitalWrite(0, i, 1 );delay(100); } cfnet.digitalWrite(0, 0X00); delay(1000); }