Created
August 22, 2022 06:14
-
-
Save labsguru/9800af87b190e10e371e4a57c9c79cfd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Connect the voltage signal wire to Arduino analog interface: | |
| Yellow Cable<---->A0 | |
| */ | |
| void setup() | |
| { | |
| Serial.begin(9600); | |
| } | |
| void loop() | |
| { | |
| int sensorValue = analogRead(A0); | |
| float outvoltage = sensorValue * (5.0 / 1023.0); | |
| Serial.print("outvoltage = "); | |
| Serial.print(outvoltage); | |
| Serial.println("V"); | |
| int Level = 6*outvoltage;//The level of wind speed is proportional to the output voltage. | |
| Serial.print("wind speed is "); | |
| Serial.print(Level); | |
| Serial.println(" level now"); | |
| Serial.println(); | |
| delay(500); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment