Arduino and I2c LCD

Discussion in 'Software and Programming' started by chucketn, Feb 13, 2015.

Help Support HMEM by donating:

  1. Feb 15, 2015 #21

    canadianhorsepower

    canadianhorsepower

    canadianhorsepower

    Well-Known Member HMEM Supporter

    Joined:
    Oct 22, 2011
    Messages:
    1,671
    Likes Received:
    320
    Ok now if you are using the example code all it does is turn your screen on and off no text.
    you are using 2 boards on is the master and the other one a slave
     
  2. Feb 15, 2015 #22

    sssfox

    sssfox

    sssfox

    Well-Known Member

    Joined:
    Mar 4, 2012
    Messages:
    183
    Likes Received:
    26
    I don't have a display with two sets of output pins, but if that is what the other set of pins is, you shouldn't have a problem as long as you only have one set connected at a time.

    You are able to compile the program without errors, correct?

    I hooked mine up this morning and had nothing but trouble until I went back and installed the LiquidCrystal_I2C library through SKETCH>IMPORT LIBRARY>ADD LIBRARY command.

    Once I did that, I ran the Hello World sketch that was in DOCUMENTS>ARDUINO>LIBRARIES>LIQUIDCRYSTAL_I2C2004V1>EXAMPLES>HELLOWORLD.
    It compiled and ran first time with no errors.

    BTW, mine was at the default address of 0x27 and I didn't need to change the baud rate. I don't remember where I got mine, but I know it wasn't SainSmart.

    Steve Fox
     
  3. Feb 15, 2015 #23

    canadianhorsepower

    canadianhorsepower

    canadianhorsepower

    Well-Known Member HMEM Supporter

    Joined:
    Oct 22, 2011
    Messages:
    1,671
    Likes Received:
    320
    this is interesting
    [ame]https://www.youtube.com/watch?v=5Z3neBqR9HA[/ame]

    enjoy
     
  4. Feb 15, 2015 #24

    chucketn

    chucketn

    chucketn

    Senior Citizen

    Joined:
    Dec 17, 2009
    Messages:
    1,300
    Likes Received:
    154
    Occupation:
    Fully retired
    Location:
    Near Jonesborough, TN
    After I got the I2C scanner working, I found the address of my modules was 0x27. As long as I make sure that is in the sketch, it works. I have had some confusion over libraries. I think I've got that fixed now. The tutorial by Dr Schlaf works now that I have his I2C library correctly loaded.

    Chuck
     
  5. Feb 15, 2015 #25

    chucketn

    chucketn

    chucketn

    Senior Citizen

    Joined:
    Dec 17, 2009
    Messages:
    1,300
    Likes Received:
    154
    Occupation:
    Fully retired
    Location:
    Near Jonesborough, TN
    I had watched that earlier, but couldn't find the code and library to go with it. I even e-mailed the guy asking where it was.

    Chuck
     
  6. Feb 15, 2015 #26

    chucketn

    chucketn

    chucketn

    Senior Citizen

    Joined:
    Dec 17, 2009
    Messages:
    1,300
    Likes Received:
    154
    Occupation:
    Fully retired
    Location:
    Near Jonesborough, TN
    More success today. With the help of Luc, Steve, TB, and others, and several videos and tutorials, I have the I2C module driving my LCD, and a 4x4 keypad connected correctly. Now to merge this code with Chuck F's version and see if I can make more progress. I still have Chuck F's version as written, loaded on one setup, and my developing version on another.
    I will gladly share what I have working, if anyone wants it. I will end this thread an start another on my mod of Chuck F's code.

    Chuck
     
    TorontoBuilder likes this.
  7. Feb 16, 2015 #27

    rodw

    rodw

    rodw

    Well-Known Member

    Joined:
    Dec 3, 2012
    Messages:
    1,132
    Likes Received:
    334
    Chuck, great you got it up and running, please don't think I'm pushing my own barrow but look at this thread
    http://www.homemodelenginemachinist.com/showthread.php?p=261884#post261884
    Post #20 has all the libraries and working code. The main improvement over Chuck Fellowes sketch is that we are using an Interrupt driven stepper driver which is much more efficient. I have a list of enhancements to add to this code. If you adopt the component values of the Freetronics keyboard and you can get outout to your screen from my code, you will be in business.
     
    TorontoBuilder likes this.
  8. Feb 16, 2015 #28

    cwebs

    cwebs

    cwebs

    Well-Known Member

    Joined:
    Sep 12, 2012
    Messages:
    54
    Likes Received:
    13
    I had the same I2C backpacks and the same results. It was the Libary. Carl
     
    TorontoBuilder likes this.
  9. Feb 16, 2015 #29

    chucketn

    chucketn

    chucketn

    Senior Citizen

    Joined:
    Dec 17, 2009
    Messages:
    1,300
    Likes Received:
    154
    Occupation:
    Fully retired
    Location:
    Near Jonesborough, TN
    You got it Carl. I watched a video Luc posted. Spent a while trying to find the code and Library they used, and with their Library it worked.

    Chuck
     
  10. Feb 16, 2015 #30

    TorontoBuilder

    TorontoBuilder

    TorontoBuilder

    John

    Joined:
    Jan 4, 2013
    Messages:
    357
    Likes Received:
    82
    Are you going to post that library to the downloads section, or post a link to it Chuck?
     
  11. Feb 16, 2015 #31

    chucketn

    chucketn

    chucketn

    Senior Citizen

    Joined:
    Dec 17, 2009
    Messages:
    1,300
    Likes Received:
    154
    Occupation:
    Fully retired
    Location:
    Near Jonesborough, TN
    Here's a link to the "Let's Make It" episode 5, that discussed the I2C serial Module. Scroll down the page for their code and a link to download the library.
    I also used a serial bus scanner to find the address of the serial modules before the above cod worked. I had to modify the scanner sketch to output in hex addresses to understand what my modules address was.
    I attached my modified version of the scanner.

    Chuck

    Couldn't attach the sketch. .ino file extentions as attachments are not allowed. I'll play with some other formats and see if I can attach it.
     
    Last edited: Feb 16, 2015
    canadianhorsepower likes this.
  12. Feb 16, 2015 #32

    chucketn

    chucketn

    chucketn

    Senior Citizen

    Joined:
    Dec 17, 2009
    Messages:
    1,300
    Likes Received:
    154
    Occupation:
    Fully retired
    Location:
    Near Jonesborough, TN
  13. Mar 30, 2015 #33

    TerryKing

    TerryKing

    TerryKing

    ..In The Woods In Vermont

    Joined:
    Mar 30, 2015
    Messages:
    1
    Likes Received:
    0
    You have to get your I2C device recognized before anything else will work.

    Some LCD info here:
    http://arduino-info.wikispaces.com/LCD-Blue-I2C
     
  14. Mar 31, 2015 #34

    chucketn

    chucketn

    chucketn

    Senior Citizen

    Joined:
    Dec 17, 2009
    Messages:
    1,300
    Likes Received:
    154
    Occupation:
    Fully retired
    Location:
    Near Jonesborough, TN
    Terry, I have since gotten the scanner and the I2C module to work. The sketches had the wrong address in them. The scanner that I got to work identified the hex address of the I2C module. After I modified the sketch to that address, it worked as advertised.

    Chuck
     

Share This Page