- Computers & Software»
- Computer How-Tos & Tutorials
PulseIn and Time with Arduino
When we use this programming command, we can measure the time interval of an event in microseconds. In the example I use in my video, each time we press a high or a logical state on pin 7, then the time count starts and ends until the state is low or zero. This tool I have seen that is used in ultrasound sensors to do the distance conversions in relation to time, however I have noticed that it has errors when used to measure long time intervals, for example ten seconds or more .
Then we can see a photograph of this circuit with a button connected to pin7, also the video is shown below.
The code download link is shown below.
Now I show you how to measure time with the library time. With this library the conversions are automatic and you can configure: hour, minutes, seconds, day, month and year without any problem. I have used it in complex systems and I have not had any problem of error in the measurements of the time.
Below, I show you a picture of this project. In the video shown above we can observe two examples, in the first we see how it works correctly when we print the date and time in the serial port, in the second example we can see how a time alarm is programmed.
Links with similar content:
- Led Matrix With Arduino UNO
Show the use of a LED Matrix with Arduino
- Switch With dsPIC30F4013
Show my experiences with the dsPIC30F4013 and an example.
- My Automation Home with Arduino
Show my experiences developing an Automation Home with Arduino and App Inventor 2.
- My Weather Station With Arduino
Show my experiences developing weather stations
- My Favorite Projects with Arduino UNO and Mega2560
Projects realized with the Arduino UNO and Mega 2560 boards
- My Projects with Mega2560
Projects realized with the Mega 2560 board
- My Microrobot Genius
Show my experiences developing a Microrobot.
- My Favorite Projects With PICC
Show my experiences with the PIC16F887 using the PICC compiler.
© 2017 Guillermo Perez Guillen