Tuesday Update:
Get the screen working so no need for Serial Monitor!
A LOT to post this week.
Sensor Arrived!
After reading the Data Sheet, I understand that the sensor is basically formed by four IR sensor, calculating the time difference from each sensor. The layout is shown below.
Therefore, I decided to "hack" Adafruit's original library (for the first time in my life!!) to get more detailed gesture than "up", "down", "left", and "right". In the header file, I added 4 more state, now the sensor could give me 8 direction feedbacks!
Some screenshot of altered code to determine which gesture is received.
That works out pretty well! One of the flaws would be I rarely get "up" "down", "left" and "right" anymore, because movements are never one direction right? I might change the threshold in the future so I'll see more balanced output. Right now I'm happy with the result. Here's a video of me demonstrating the code:
Now comes the painful part.
SO, Arduino MQTT Client works on "Mosquitto" AND "Shiftr", that's nice. Occasionally, I have error codes but I think it's me missing credentials or port number.
BUT, Mqtt.JS doesn't like "Mosquitto", It would only show "Disconnected to broker" no matter which port I select. After spending 2 hours trying to find out why, I gave up. I will just use "Shiftr".
My questions:
Arduino seems to go to sleep after no trigger. It will disconnect from MQTT server, and start to connect once a new message is trying to publish. Why? How can I custom the time before it goes to sleep. In the meantime, can I store unpublished data in Arduino and send them to webpage at once to HTML once connected?
Why does "Mosquitto" doesn't work?
I've read through other's page, it seems like I need a "server" to log my readings since I'm trying to keep track of all the data recorded? How exactly do I do that?
To dos:
Keep building HTML and script.
Fix the algorithm on gesture sensor
Explore how to display data on screen
Comments