Thursday, March 22, 2018

Fortune Teller LCD with Shift Register

Ideation

The original idea that I had was to utilize the flex sensor. As the flex sensor is bent one direction, more negative fortunes will appear, and if the flex sensor is bent the other direction, positive fortunes will appear.

The reason I chose this idea is because I thought it would be interesting if the user has the power to influence the quality of their fortune, which is something typically not an ability someone would have in fortune telling.

Positive fortunes:

You will reconnect with an old friend.
You discover something new today.
You will get a good grade on an assignment.


Negative fortunes:

You will forget an important task today.
Your next train will be delayed.
You will get a bad grade on an assignment.

Execution

The first step was to wire the LCD board to the Arduino using the shift register.



I followed the above Fritzing diagram to achieve the wiring. Unfortunately, after doing this I discovered that there was a problem connecting to the board. After some trial and error, I discovered that it was because there was some sort of shorting in my setup. Because of this problem, I could not properly set up the board with the shift register.





















Here is an image of the wiring for the LCD without the flex sensor.




LCD wiring including the flex sensor.

I was not able to properly actualize the idea that I had. I did however take the time to lay out the foundations for the code that would power the fortune teller.

I installed the Adafruit_LiquidCrystal library in Arduino. Using the flex sensor code that I had developed for a previous assignment as a reference, it was relatively easy to incorporate the detection of different states into the program.

https://github.com/Fuzzlr/WebDev_S18/blob/master/LCD/LCD.ino

The code above utilizes arrays to store each output and uses the sensor reading of the flex sensor to determine whether the output is a positive or negative message.

UPDATE:

I was able to properly wire the LCD and produce the desired results with updated code.





Link to updated code:



No comments:

Post a Comment