Skip to main content

Timeline for Port register not working

Current License: CC BY-SA 3.0

8 events
when toggle format what by license comment
Dec 5, 2014 at 12:34 comment added Samul So you are saying that this image is wrong? forum.arduino.cc/…
Dec 5, 2014 at 8:02 comment added Ignacio Vazquez-Abrams The duration the Echo signal is held high is proportional to the distance detected.
Dec 5, 2014 at 3:13 comment added Samul still having problem. Look: when my sensor is doing nothing it registers LOW. When an ultrasonic pulse arrives it registers HIGH right? So why do I need 2 whiles? Couldnt I just start a timer when the trigger sends a pulse and stop the timer when sensor reads HIGH? I tried "while sensor is not high keep looping" but it does not work. What am I doing wrong? The HIGH/LOW logic of mine is wrong?
Dec 4, 2014 at 17:00 history edited Ignacio Vazquez-Abrams CC BY-SA 3.0
edited body
Dec 4, 2014 at 16:55 comment added Gerben Use PINB5 instead.
Dec 4, 2014 at 12:13 review Suggested edits
Dec 4, 2014 at 12:36
Dec 4, 2014 at 12:11 comment added Samul Thank you so much for helping but there is a problem: in your code you putted PIND, but it should be PINB right? Another thing: when I try to copile your code I get error saying that PB5 was not declared. I changed it to only 5 ok? But it still does not work. Could you please check what am I doing wrong? I edited your question to add my code cause I couldnt add it here in the coments ok? Sorry for that.
Dec 4, 2014 at 3:44 history answered Ignacio Vazquez-Abrams CC BY-SA 3.0