User Tools

Site Tools

한국어

cfnet:cfadca4l

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
cfnet:cfadca4l [2026/02/21 23:49] – created - external edit 127.0.0.1cfnet:cfadca4l [2026/02/22 00:07] (current) – [Setting the module's address] admin
Line 14: Line 14:
 =====Wiring method===== =====Wiring method=====
  
-{{:modularfaduino:cfadc-a4ld.png?nolink |}}+{{.:cfadc-a4ld.png?nolink |}}
  
 ===== Measurement dip switch settings ===== ===== Measurement dip switch settings =====
Line 22: Line 22:
   * V=Off / A=On => Current measurement   * V=Off / A=On => Current measurement
  
-{{ :modularfaduino:a_v_dip2.png?nolink |}}+{{ .:a_v_dip2.png?nolink |}}
 ===== Setting the module's address ===== ===== Setting the module's address =====
   * Up to 4 CFADC-A4Ls can be used in one system with different address settings.   * Up to 4 CFADC-A4Ls can be used in one system with different address settings.
Line 28: Line 28:
   * This method turns on only one of the four dip switches.   * This method turns on only one of the four dip switches.
  
-{{ :modularfaduino:add_4key2.png?nolink |}} +{{ .:add_4key2.png?nolink |}}
-=====How to use the API=====+
  
-1. <html><code>#include "CFMEGA.h"</code></html> library registration+[[index|CFNET]]
  
-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) 
- 
-<code c> 
-#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"); 
-} 
-</code> 
- 
-[[modularfaduino:index|Modular FADUINO]] 
cfnet/cfadca4l.1771717768.txt.gz · Last modified: by 127.0.0.1