For this project, we made a circuit and code to make text display onto a LCD display, that was also affected by a tilt switch, to then randomize a library of text, and have it appear after the tilt switch is moved or shaken. This would then create a sort of "Magic 8 Ball" experience of asking it something and then giving a generic "fortune teller answer". This project had a few different factors to it, the most complex being the LCD itself, having many pins each with many functions. It has the RS pin which will control where the text will appear on screen. The R/W pin which is the read/write pin, which we have grounded because we want it set to write instead of read. The E pin tells the display it will be recieving a command from the code. and the Data pins, which we connect to the Arduino digital pins (later assigned in the code), send characters to the screen. In the code, we start by setting the LCD library, along with assigning the digital pins. We set the switch pin as an input in the first line of code in the setup, Afterwards is the Welcome line, which asks the person to ask the "8 ball" something. Using an if statement, we are then able to set the randomizer effect with the switch state and random functions. After making a switch statement, we assign what different responses the display will have, and come up once it is shaken.
DISCLAIMER: After many tries and attempts, for some reason, text will NOT display on the LCD. The display obviously is reading something, as whenever the tilt switch is shaken, the display blinks, as well as the potentiometer dimming and brightening the display as I turn it, which in general shows the code as well as wiring should be fine. I will continue to test, but I am not sure if there is an issue with my board or display
Comments