en-us_commands:reference:ianalogread2
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en-us_commands:reference:ianalogread2 [2026/09/07 23:35] – 바깥 편집 127.0.0.1 | en-us_commands:reference:ianalogread2 [2026/09/14 20:30] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 14: | Line 14: | ||
| ===== Example ===== | ===== Example ===== | ||
| + | |||
| + | This example scales the MPINO-8A4R(T)-S 4–20mA input '' | ||
| <code cpp> | <code cpp> | ||
| void setup() { | void setup() { | ||
| - | analogReference(EXTERNAL); | ||
| Serial.begin(115200); | Serial.begin(115200); | ||
| } | } | ||
| void loop() { | void loop() { | ||
| - | int32_t percent = IanalogRead2(A2, | + | |
| if (percent == ANALOG_READ2_ERROR) { | if (percent == ANALOG_READ2_ERROR) { | ||
| - | Serial.println(" | + | Serial.println(F(" |
| } else { | } else { | ||
| + | Serial.print(F(" | ||
| Serial.println(percent); | Serial.println(percent); | ||
| } | } | ||
| - | |||
| delay(500); | delay(500); | ||
| } | } | ||
| Line 36: | Line 36: | ||
| ===== Precautions ===== | ===== Precautions ===== | ||
| - | * Set the module DIP switches and wiring | + | * In this example, '' |
| * An input of approximately 3.6~4.0mA returns the normal value '' | * An input of approximately 3.6~4.0mA returns the normal value '' | ||
| * Error values help detect open circuits. The user must implement final alarms and safety actions in the program. | * Error values help detect open circuits. The user must implement final alarms and safety actions in the program. | ||
| Line 48: | Line 48: | ||
| * The analog output circuit requires an external 12~24V supply. USB power alone may not provide normal output. | * The analog output circuit requires an external 12~24V supply. USB power alone may not provide normal output. | ||
| * Verify actual current input/ | * Verify actual current input/ | ||
| + | |||
| + | ===== Built-in Commands in the Same Category ===== | ||
| + | |||
| + | * [[: | ||
| [[: | [[: | ||
en-us_commands/reference/ianalogread2.1788791733.txt.gz · Last modified: by 127.0.0.1
