Showing posts with label arduino uno. Show all posts
Showing posts with label arduino uno. Show all posts

May 06, 2017

Creating a Menu system on a LCD display

   Hey everyone, how are you doing todaaay ?. This blog post (and video) is all about how to create menu systems (screens) on a LCD (16x2) display, making use of Arduino UNO. 
   Menus are specially useful on small LCD screens when you have a lot of information to show and too little space available. I show in the video below how to implement a six (6) screen menu system that you can navigate by simply pressing a button. 


   The actual schematic diagram (drawn in Fritzing) is shown below, and contain one push-button, one i2c LCD display and one Arduino UNO. As simple as it gets!!.

Click the image to enlarge

   Coding for this project has its own details, but is nothing beyond beginner: every button press increments the variable "WhichScreen" by one (up to six), then a switch..case function is used to determine which screen (tied to a specific function) will be shown at the moment.
   The button pressing is debounced by the use of the 'debounce.ino' sketch, which comes with the current Arduino IDE. Every one of the six functions contains all code necessary to write messages (or other things) to every column and line of the chosen LCD display. 
   Code for this project (same seen in the video) is available on my GitHub and also shown below:


All materials used in this tutorial are available on ICStation (click here) and below:


October 21, 2014

A substitute for the DELAY function - Arduino

Hello guys, how are you doing today? 

   Ever since I came across the Arduino platform, I felt really pissed off with (the existence) of the delay() function, because it was created with the (evil) solo purpose of wasting time between executions of the loop() function. 
   I have rapidly created a counter to substitute this function in every sketch of my own, with the downside of having to adjust the counted number for every single program (because different program sizes take different times to be executed). This scenario have just changed, because I am presenting you my very own professional way to not waste precious time of your Arduino. It is a sketch that allows you to run a piece of code every 'x' microseconds while leaving the rest of the time free for execution of more code!. 
   The code takes advantage of the micros() function, present in the stock Arduino language and IDE, which returns the time (in microseconds) that Arduino has been running since the last reset. Essentially what I do is to execute my main function (which I can freely choose) only every given time; this "given" time can be adjusted by updating its value (in microseconds) in an IF loop.

   The sketch is available on my GitHub and doesn't require any special library or installation, only the stock micros() function. Essentially your custom code, such as blinking leds, goes in between the quotes I have wrote (as seen below): 



   The main advantage in this code is that you can execute a code every 'x' microseconds (utilizing the sketch exactly as it is) or multiple codes every 'y' microseconds (by adding new IF conditions based on the same couter). You can not forget to fill your setup() function as needed; your timing will always be respected, since you don't write a code big enough (that takes more time than your delay) to be executed. 
   
   I would greatly appreciate to hear from you guys, any suggestion, criticism, upsides, downsizes, anything that can make the code work better. You can reach me on twitter @embedded_clovis or email: clovisf AT gmail DOT com .  


September 05, 2014

Beta-testing Arduino-ZERO

Hi guys, this is just an update post to tell you two things: 

1- I will be back to this blog once I go forward on my "chip tag for running clubs" project and once the things stabilize in the college (beginning of a new term is always crazy!).

2- I was selected as one of the Arduino-ZERO (link here) beta-testers! It has been so nice and so crazy test everything on that board, you have no idea. I have signed a waiver saying that I cannot share any information related to the platform, so I will only be telling you things related to this project when the beta-testing is over (and the product releases).

Stay tuned for news, and happy coding and hacking!! :-)