Created
July 4, 2012 02:25
-
-
Save atypical/3044846 to your computer and use it in GitHub Desktop.
FUCK WIND
This file contains 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
long pulsewidth1; | |
float wspeed1; | |
void setup() | |
{ | |
Serial.begin(9600); | |
pinMode(13,INPUT); //Anemometer 1 | |
} | |
void loop() | |
{ | |
pulsewidth1=pulseIn(13, LOW); //Anemometer 1 | |
//Formula for period (in microsec) to mph | |
wspeed1=1000000.0/pulsewidth1*2.5; | |
Serial.print(wspeed1); | |
Serial.print(" "); | |
delay (5); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment