-
|
Hi, I would like to add a LCD display to the arduino controlled by telemetrix. Just like this but via telemetrix: I have seen that I2C is supported. But I'm not sure what to do to drive a LCD via I2C If some suggestions / guidance is available I would also like to integrate myself the lib Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 9 comments 29 replies
-
|
@esanya Looking at the article you provided, the Adafruit LCD display used does not seem to be manufactured anymore. Also, I looked at John Rickman's library, and it seems it is no longer supported. He states it is now being hosted on GitLab, but the link he provides does not work. However, If you have tried running John Ricman's examples using your LCD display and it works, porting to Telemetrix should be obtainable. From the i2c perspective, the Rickman library only places three calls to i2c functions. The first, is during initialization where Wire.begin is called. The telemetrix equivalent occurs when set_pin_mode_i2c is called. The two other calls are contained in the library's expanderWrite method. The telemtrix i2c_write() method incorporates both beginTransmiision and endTransmiision. You would need to provide the data to be written across the i2c interface, and telemetrix will take care of the rest. All the other C++ code in Rickman's library would need to be ported to Python. That would be the bulk of the work. I hope I have answered your question. If you have any additional comments or questions, please post them here, and I will do my best to provide an answer. |
Beta Was this translation helpful? Give feedback.
-
|
Hi Alan, Thanks for you answer! I have seen also that the lib what I have posted is no more maintained. Because of this I would take this one (this is maintained): https://github.com/blackhack/LCD_I2C One question: you wrote: "All the other C++ code in Rickman's library would need to be ported to Python. That would be the bulk of the work." could you give me a hint where this should be done? Can it go to telemetrix somewhere? Like the support for "DHT Temperature/Humidity Sensor" or "Stepper Motor Control (AccelStepper)"? Then I will fork your 2 repos: And try to do what you proposed... :) Regards, |
Beta Was this translation helpful? Give feedback.
-
|
Hi Alan, I have my first version of telemetrix + I2C_LCD port to python. https://github.com/esanya/telemetrix/tree/add-an-example-to-support-i2c-LCD It is actually the pythonization of the https://github.com/blackhack/LCD_I2C https://github.com/blackhack/LCD_I2C/blob/master/src/LCD_I2C.{h, cpp} It runs without error. But does not change / show anything on the LCD display... I'm not sure what could be wrong... I have tried it to debug, but only on python level (-mpdb), and I'm not sure what is happening within the arduino... Could you give me an idea? Thanks, |
Beta Was this translation helpful? Give feedback.
-
|
Hi Sandor, |
Beta Was this translation helpful? Give feedback.
-
|
I took a quick look at the code, and I did not see anything obvious. Unfortunately, I do not have hardware here and, therefore, cannot test. The code has some semicolons (;) probably from cut and paste. You should remove them, but I don't think that is causing issues. There is a way to print out values in the Telemetrix4Arduino sketch on the Python console. The function is called send_debug_info. The first parameter is a byte, usually used as an identifier and the second byte is an integer to report a value. You can also uncomment out this line to see the data being sent across the link. However, before trying to debug on the Arduino side, perhaps we can do things on the Python side first. When you first power up the display, are there any characters on the screen? One thing you can try is to toggle the backlight on and off to see if commands are being processed. Perhaps something like this: If that works, I would continue by adding functionality slowly, such as clearing the screen if the screen is not clear on power up. If the backlight toggle does not work, you may need to observe the data being sent when LCD_I2C(board) is called and when lcd.begin() is called. Please let me know if any of this helps. |
Beta Was this translation helpful? Give feedback.
-
|
@esanya I found this board on Amazon. Is it the equivalent of the board you are using? |
Beta Was this translation helpful? Give feedback.
-
|
Don't feel stupid - mistakes are how we learn. I can't tell how often I have "learned" things ;-). Since you can run the blink script, then it can't be a power supply issue. It sounds like the character data is either being built incorrectly from the Python side or corrupted on the Arduino side. My guess is that it is on the Python side. |
Beta Was this translation helpful? Give feedback.
-
|
I received two LCDs from Amazon. I ordered this unit. I tried running the blackhack Hello_World.ino script and saw the backlight flash, but no characters print. Is there anything I need to change in the blackhack software? When you run this script, do you see the characters printed to the LCD? |
Beta Was this translation helpful? Give feedback.
-
|
@esanya You will find both a modified library and an example on that page. The problem was that some of the time delays on the Python side in your library were too short. I modified many of the delays but did not test all library methods. Please let me know if things know work for you. |
Beta Was this translation helpful? Give feedback.
@esanya
Hi Sandor,
Although I have not used Telemetrix to drive an i2c LCD, there is no reason why it should not work.
Looking at the article you provided, the Adafruit LCD display used does not seem to be manufactured anymore.
Also, I looked at John Rickman's library, and it seems it is no longer supported. He states it is now being hosted on GitLab, but the link he provides does not work.
However, If you have tried running John Ricman's examples using your LCD display and it works, porting to Telemetrix should be obtainable.
From the i2c perspective, the Rickman library only places three calls to i2c functions. The first, is during initialization where Wire.begin is called. The telemetr…