1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-30 16:24:09 +03:00

Adding some test cases for the pre-processor. (Total hack, requires copying and pasting code from the actual app source into another file and running a shell script, but it's better than nothing.)

This commit is contained in:
David A. Mellis
2008-03-15 17:44:42 +00:00
parent ff9bb8dd14
commit df4eb665b0
52 changed files with 379 additions and 0 deletions

View File

@ -0,0 +1,21 @@
int encoder = 4;
unsigned long speed = 0;
void setup()
{
pinMode(encoder, INPUT);
}
void loop()
{
speed = getspeed();
delay(1000);
}
unsigned long getspeed()
{
unsigned long duration = 0;
duration = pulseIn(encoder, HIGH);
return(duration);
}