Title | Stopwatch using Arduino |
---|---|
Author | Dennis Cruz |
Course | Elements Of Engineering Design |
Institution | Borough of Manhattan Community College |
Pages | 5 |
File Size | 244.8 KB |
File Type | |
Total Downloads | 6 |
Total Views | 131 |
Stopwatch creating using Arduino...
Experimental report: Creation of a Stopwatch using Arduino Name: Dennis Cruz Due Date: 05/01/2019 ESC 111-113 Spring, 2019 Professor: Mahmoud Ardebili
Introduction: Arduino is an open-source electronics platform based on easy-to-use hardware and software. Arduino boards are able to read inputs - light on a sensor, a finger on a button and turn it into an output activating a motor, turning on an LED, publishing something online. You can tell your board what to do by sending a set of instructions to the microcontroller on the board. To do so you use the Arduino programming language (based on Wiring), and the Arduino Software (IDE), based on Processing.
Objective: Using Arduino, learn how to create a stopwatch that starts at a certain number (inserted through the serial monitor) and keeps on going while the pushbutton is pressed and stops when it is released.
Materials: Wires:
double
Discussion of Results:
The 2 7-segment display had the following disposition of pins, connected and used to write the code:
Numbers 1 2 3 4 5 6 7 8 9
Wire connections needed for LED display: On B, C A, B, D, E, G A, B, C, D, G B, C, F, G A, C, D, F, G A, C, D, E, F, G A, B, C All A, B, C, D, F, G
Off A, D, E, F, DP C, F, DP E, F DP A, D, E, DP B. E. DP B, DP D, E, F, G DP DP E, DP
Taking in consideration that one of the “Common cathodes” should always be connected to a positive wire or positive breadboard connections. Loops such as “while” and “nested for” were used in the code to determine the amount of numbers the stopwatch will go until it is stop when the pushbutton is released. “If” statements were also required.
To input the number on the ‘serial monitor’ the following piece of code was used: if (Serial.available() > 0) { // is a character available? rx_byte = Serial.read(); // get the character // check if a number was received if ((rx_byte >= '0') && (rx_byte...