Skip to content

Instantly share code, notes, and snippets.

@atypical
Created July 4, 2012 02:25
Show Gist options
  • Save atypical/3044846 to your computer and use it in GitHub Desktop.
Save atypical/3044846 to your computer and use it in GitHub Desktop.
FUCK WIND
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