======CFADC-A4L======
A 4-channel AD input module that can measure voltage and current. You can select current (0~20mA) or voltage (0~10V) input by setting the dip switch.
[[https://comfiletech.com/modular-faduino/cfadc-a4l-analog-input-module/|View at our online store]].
=====Electrical specifications=====
* AD input points: 4 channels
* Voltage input range: 0 to 10VDC
* Current input range: 0~20mA
* Error rate: ±0.1%
* Resolution: Approximately 14.7Bit (0 to 26,666 values returned)
* Input response speed: approximately 5mS
* Isolation: No isolation
=====Wiring method=====
{{:modularfaduino:cfadc-a4ld.png?nolink |}}
===== Measurement dip switch settings =====
* Set the voltage or current you want to measure with the DIP switch.
* Only one of the V and A switches on each channel must be turned ON.
* V=On / A=Off => Voltage measurement
* V=Off / A=On => Current measurement
{{ :modularfaduino:a_v_dip2.png?nolink |}}
===== Setting the module's address =====
* Up to 4 CFADC-A4Ls can be used in one system with different address settings.
* The address setting method is different from other I/O modules. Caution is required.
* This method turns on only one of the four dip switches.
{{ :modularfaduino:add_4key2.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**.analogRead();'' => ''**cfnet**.analogRead(0,0);''
====-u16 analogRead(u8 address, u8 channel) ====
Reads the analog value of the corresponding channel of the specified address module. (about 0~26,666)
* ''address'': The address of the module as configured by its DIP switch (0~3)
* ''channel'': Channel number (0~3)
#include "CFMEGA.h"
CFNET cfnet;
void setup() { Serial.begin(9600); }
void loop() {
u16 CH0 = cfnet.analogRead(0, 0);
u16 CH1 = cfnet.analogRead(0,1);
Serial.print("CH0:"); Serial.print(CH0); Serial.print("\n");
Serial.print("CH1:"); Serial.print(CH1); Serial.print("\n");
delay(200);
Serial.print("\n");
}
[[modularfaduino:index|Modular FADUINO]]