Hello again, all you amazing programmers who always make my brain stop hurting! I have read too many different articles and seen too many different "examples" of how to integrate an Arduino Uno with various sensors, but none of them seem to have a simple explanation or example of how to code the Arduino part to simply display the temperature reading of a sensor to the thermometer gauge on the LCD. Designing the interface on the LCD using the VisiGenie is simple enough, but I don't know how to get "insideTempSensor" to display on "Thermometer0" OR "int setTemp" to be adjustable by "Trackbar0."
Would someone be kind enough to give me a stupid simple example code of how to show a temperature reading from a DHT22 (or any other temperature sensor for that matter.. I don't think the sensor makes a difference, does it?) sensor on a thermometer gauge via the arduino code itself? I am still a newbie to Arduino and the 4D displays so any and all help here would be greatly appreciated!
I would also like to add the "Set Temp" option to my project, as I've seen there is an option for it on the pre-made thermometer gauge, to control the on/off control of a relay. ANY AND ALL HELP IS WANTED AND GREATLY APPRECIATED!!!
I would think this shouldn't be that hard to understand, but I just need a good walkthrough on the Arduino side of the programming in order to figure out how I send data from one thing to another.
In the sample code it shows how to communicate with a slider. I need to know how to print a temperature from an input on the arduino to on a thermometer (ie. Thermometer0) or on a digit display (ie. leddigits0). lol I'm begging for an example code of this... :~
if(Event.reportObject.cmd == GENIE_REPORT_EVENT)
{
if (Event.reportObject.object == GENIE_OBJ_SLIDER) // If the Reported Message was from a Slider
{
if (Event.reportObject.index == 0) // If Slider0
{
slider_val = (Event.reportObject.data_msb << 8) + Event.reportObject.data_lsb; // Slider0 data into the slider_val setpoint
genieWriteObject(GENIE_OBJ_LED_DIGITS, 0x00, slider_val); // Write Slider0 value to to LED Digits 0
}
}
}
I'm not so much in need of understanding how to get information talking between the board and the screen for a slider as I am in need of a temperature sensor displaying info on the screen. I can use example code for the slider to make my set points and what not, but I really just need to see sensor outputs. I am just using this thermostat-like project as a test program to get familiar with the screen integration for various future projects.
Have you had a look at the 4D Systems forum, and the area for Arduino?
There are quite a few examples in there where people have asked questions and examples have been provided promptly.
Also have you looked at the App Notes they provide? There are ones specific to the Arduino talking to ViSi-Genie.
Just for clarification, I have had success in using multiple different kinds of sensors and displaying them on a sainsmart 16x2 lcd shield. READING the sensor on the arduino is easy enough. I need to know what the command process is to send the sensor data TO the ViSiGenie lcd gauges.
This is how I send sensor data to the sainsmart LCD. Set the cursor and the "lcd.print" command allows me to print whatever I want. How do I send data to the 4D Systems LCD like this?
I have been searching on the 4D systems forums and through the example files but it seems like everything is only halfway explained or not at all. I'm still very new to the programming world and the way I learn is by seeing the code in working form and then see it work accordingly on the hardware. I'm just looking for an Arduino example code :~
The sainsmart LCD and a 4D Systems display are quite a different animal.
If all you want to do is for the Arduino to tell the display to display text, then the solution is very simple. It however depends what you want to do. Do you want to only program the Arduino and the display is just a slave which you dont load an application on itself, or do you want to be able to program both and do more complex graphics to display your data.
If you simply want to display "TEMP 100" etc, then you may be best to use Serial, not ViSi-Genie.
However it is also easily done with ViSi-Genie, but you just need to program the base program into the display, set up the objects you want to animate with data etc, and then send the data in the appropriate format using the library they provide.
Do you want the data to just be text on the screen, or do you want it like 7 segment displays, or do you want it like a gauge, or a graph or what... lots of options, all very easy.
What examples are you referring to which are only half explained? Maybe I can help.
Have you looked at the App Notes they provide?
You are using the uLCD-32PTU right, in the -AR pack (Arduino pack)?
Do you have the Arduino Adaptor with lots of headers/jumpers on it (Version 2) or do you have the more simple Version 1 Arduino Adaptor shield?
Thank you SO much @WanaGo! That was EXACTLY what I was looking for. You have brought sanity back into my life XD This is an excellent example and I know I can't be the only one who has been looking for one like this!
I can't wait to plug in all my code parts to the arduino code and test it out! Thank you to all contributors! All comments were helpful