Skip to content

Commit

Permalink
Update arduinogalileo.c
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandruradovici committed Dec 16, 2014
1 parent 2940397 commit d002d47
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/wiring/arduinogalileo.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ unsigned long pulseIn(uint8_t pin, uint8_t state)
//wait for previous pulse to end or timeout
while(digitalRead(pin) == state)
{
printf ("%d ", digitalRead (pin));
time_b = micros();
timeBFlag = 1;
if(time_b >= time_a)
Expand All @@ -301,6 +302,7 @@ unsigned long pulseIn(uint8_t pin, uint8_t state)
//wait for pin to go to target value or timeout
while((digitalRead (pin) != state) && !timeoutFlag)
{
printf ("%d ", digitalRead (pin));
time_b = micros();
timeBFlag = 1;
if(time_b >= time_a)
Expand All @@ -325,6 +327,7 @@ unsigned long pulseIn(uint8_t pin, uint8_t state)
//determine pulse length
if((digitalRead(pin) == state) && !timeoutFlag)
{
printf ("%d ", digitalRead (pin));
if(!timeBFlag)
{
time_b = micros();
Expand Down

0 comments on commit d002d47

Please sign in to comment.