DC SINK output 16-point module, when turned on, the output is shorted to ground, and when turned off, it opens.
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, 0xffff);
Turns the output 16 ports of the specified address module into On and Off states with 16bit data values. (16bit write)
address: The address of the module as configured by its DIP switch (0~7)data: On/Off value between 0x0000 and 0xFFFF (16bit)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 ~ 15)on_off: 0 or 1 (0=off, 1=on)#include "CFMEGA.h" CFNET cfnet; void setup() { cfnet.digitalWrite(0, 0XFFFF); delay(1000); cfnet.digitalWrite(0, 0X0000); delay(1000); } void loop() { for(int i=0; i<16; i++){ cfnet.digitalWrite(0, i, 1 );delay(100); } cfnet.digitalWrite(0, 0X0000); delay(1000); }