======CFDO-16N======
DC SINK output 16-point module, when turned on, the output is shorted to ground, and when turned off, it opens.
[[https://comfiletech.com/modular-faduino/cfdo-16n-digital-output-module/|View at our online store]].
=====Electrical specifications=====
* Output Ports: 16
* Output operating voltage: 5~27VDC
* Maximum output current: 120mA / 1 point
* Isolation: No isolation
* Maximum on/off cycle: approximately 1kHz (1000 times per second)
=====Wiring method=====
{{:modularfaduino:cfdo16n.png?nolink |}}
===== Setting the module's address =====
* Up to 8 CFDO-16Ns can be used in one system with different address settings of 0x00~0x07.
* CFDO-16N shares an address with CFDO-8R module. In other words, addresses already in use by CFDO-8R cannot be used.
{{ :modularfaduino:dip_sw_0x00.png?nolink |}}
=====How to use the API=====
1. #include "CFMEGA.h" library registration
2. CFNET object creation: ''CFNET **object name**'' =>'' CFNET ** cfnet;**''
3. Call the function(s): ''**Object name**.digitalWrite();'' => ''**cfnet**.digitalWrite(0, 0xffff);''
\\
====-void digitalWrite(u8 address, u16 data) ====
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)
====-void digitalWrite(u8 address, u8 pin, u8 on_off) ====
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);
}
[[modularfaduino:index|Modular FADUINO]]