User Tools

Site Tools

한국어

cfnet:cfdi16b

Differences

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

Link to this comparison view

Next revision
Previous revision
cfnet:cfdi16b [2026/02/21 23:49] – created - external edit 127.0.0.1cfnet:cfdi16b [2026/02/22 00:06] (current) admin
Line 19: Line 19:
 =====Wiring method===== =====Wiring method=====
  
-{{:modularfaduino:cfdi-16.png?nolink |}}+{{.:cfdi-16.png?nolink |}}
 ===== Setting the module's address ===== ===== Setting the module's address =====
  * Up to 8 CFDI-16Bs can be used in one system with different address settings of 0~7.  * Up to 8 CFDI-16Bs can be used in one system with different address settings of 0~7.
  
-{{ :modularfaduino:dip_sw_0x00.png?nolink |}} +{{ .:dip_sw_0x00.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**.digitalRead();'' => ''**cfnet**.digitalRead(0);'' 
-\\ 
-====-u16 digitalRead(u8 address);==== 
-The input status of the entire specified address module is read as a 16-bit value. 
- 
-  * address: module dip switch value (0~7) 
-====-bool digitalRead(u8 address, u16 pin); ==== 
-Returns the state of a single pin as a boolean value. (1 bit read) 
- 
-  * ''address'': The address of the module as configured by its DIP switch (0~7) 
-  * ''pin'': Pin index (0 ~ 15) 
- 
- 
- 
-<code c> 
-#include "CFMEGA.h" 
- 
-CFNET cfnet; 
- 
-void setup() { 
- Serial.begin(9600); 
-} 
- 
-void loop() { 
- 
- u16 blockK0 = cfnet.digitalRead(0); 
- bool portIn0 = cfnet.digitalRead(0, 0); 
- 
- Serial.print("Block0 : "); Serial.print(blockK0, HEX); 
- Serial.print(" PortIn0 : "); Serial.print(portIn0,HEX); 
- Serial.print("\n"); delay(200); 
-} 
- 
-</code> 
- 
- 
-[[modularfaduino:index|Modular FADUINO]] 
cfnet/cfdi16b.1771717769.txt.gz · Last modified: by 127.0.0.1