en-us_commands:reference:ianalogwrite2
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| en-us_commands:reference:ianalogwrite2 [2026/09/07 21:52] – 만듦 - 바깥 편집 127.0.0.1 | en-us_commands:reference:ianalogwrite2 [2026/09/08 00:53] (current) – 바깥 편집 127.0.0.1 | ||
|---|---|---|---|
| Line 16: | Line 16: | ||
| <code cpp> | <code cpp> | ||
| - | IanalogWrite2(0, | + | void setup() { |
| - | IanalogWrite2f(1, | + | Serial.begin(115200); |
| + | } | ||
| + | |||
| + | void loop() { | ||
| + | uint16_t raw2 = analogRead2(0); | ||
| + | int32_t filtered2 = analogRead2Avg(0, | ||
| + | float filtered2f = analogRead2Avgf(0, | ||
| + | float currentmA = IanalogRead2f(0, | ||
| + | |||
| + | if (raw2 == ANALOG_READ2_ERROR || filtered2 == ANALOG_READ2_AVG_ERROR || | ||
| + | filtered2f == (float)ANALOG_READ2_AVG_ERROR || | ||
| + | currentmA == (float)ANALOG_READ2_ERROR) { | ||
| + | Serial.println(" | ||
| + | delay(500); | ||
| + | return; | ||
| + | } | ||
| + | |||
| + | int32_t percent = Iscale((int32_t)raw2, | ||
| + | |||
| + | | ||
| + | IanalogWrite2f(1, | ||
| + | |||
| + | Serial.print(" | ||
| + | Serial.println(raw2); | ||
| + | Serial.print(" | ||
| + | Serial.println(filtered2); | ||
| + | Serial.print(" | ||
| + | Serial.println(filtered2f, | ||
| + | Serial.print(" | ||
| + | Serial.println(percent); | ||
| + | Serial.print(" | ||
| + | Serial.println(currentmA, | ||
| + | |||
| + | delay(500); | ||
| + | } | ||
| </ | </ | ||
| Line 28: | Line 62: | ||
| * '' | * '' | ||
| * Do not use high-speed pulse GPIO numbers '' | * Do not use high-speed pulse GPIO numbers '' | ||
| + | |||
| + | ===== Built-in Commands in the Same Category ===== | ||
| + | |||
| + | * [[: | ||
| + | * [[: | ||
| [[: | [[: | ||
en-us_commands/reference/ianalogwrite2.1788785566.txt.gz · Last modified: by 127.0.0.1
