Presentation is loading. Please wait.

Presentation is loading. Please wait.

CTY SAR FCPS Vedant mathur, Juliana schalkwyk

Similar presentations


Presentation on theme: "CTY SAR FCPS Vedant mathur, Juliana schalkwyk"— Presentation transcript:

1 CTY SAR FCPS Vedant mathur, Juliana schalkwyk
Arduino Project CTY SAR FCPS Vedant mathur, Juliana schalkwyk

2 Goal To get our LCD to display and update the time properly.
To allow the knock circuit to detect knocks and accordingly perform demonstrations with the LEDs. Allow the LEDs to perform a given sequence of lighting.

3 Programming Time on LCD

4 Utility Project Part 1 Include all necessary libraries
#include <LiquidCrystal.h> #include <Time.h> Initializing global variables The LCD itself needs to initialized as a LiquidCrystal object “LiquidCrystal lcd(12, 11, 5, 3, 2)” LED pin constants Knock sensor pin reference Knock sensor storage integer Threshold Increment Index Setup() lcd.begin(cols, rows) – initializes interface to LCD screen, then specifies the dimensions of the display lcd.print(“Hello, World”) – prints text to the LCD

5 Utility Project Part 2 Setup() Loop() Begin LCD Set time Set pinModes
print time information run knock circuit function

6 CODE

7 Code Explanation The code began with the necessary include statements to the external libraries. We incorporated the LiquidCrystal library and the Time.h library to our project. Following that came the declaration of our global variables. We implemented specific pin references for our 3 LEDs and set the analog pin for the Knock sensor. The "incrementIndex" variable was an integer that would keep track of the knock sensor's inputs. After that, we began the development of the setup() function. That function included the initialization of the LCD and the pinMode declarations. We then created two functions, printTime() and knockCircuit(), to complete the program. The printTime() function formatted the given time from the Time library and printed it out in a viewable manner. The knockCircuit function performed the scanning tasks of the knock sensor and accordingly ran the LEDs through their multiple sequences. These functions were then called in the loop() function.

8 Building the circuit

9 Diagram of LED Circuit

10 Building the circuit For the circuit's development, we initially created two separate circuits and joined them together, connecting the pins to the Arduino.

11 Putting it All Together
UPLOAD! Remember to check for the flashing RX and TX lights, and a “Successful upload” message in your console Understanding the process LCD RS pin to digital pin 12 LCD Enable pin to digital pin 11 LCD D4 pin to digital pin 5 LCD D5 pin to digital pin 4 LCD D6 pin to digital pin 3 LCD D7 pin to digital pin 2 LCD R/W pin to ground Knock sensor to A0 and GND

12 Thank You!


Download ppt "CTY SAR FCPS Vedant mathur, Juliana schalkwyk"

Similar presentations


Ads by Google