1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Lcd 16x2 and Usb.Init ()

Discussion in 'AVR' started by mauros, Jun 18, 2017.

  1. mauros

    mauros Member

    Joined:
    Apr 25, 2017
    Messages:
    53
    Likes:
    0
    I do not know if you are still there. The LCD + i2C display with a simple sketch works and the display shows the characters correctly, but using lcd + i2C in my sketch, i have the same problem as the LCD 1602 without i2C module, and the lcd does not shows anything and i understand that the cause is because the serial does not turn on, in fact the if (Serial.available ()) returns value False, while disconnecting the i2C module the serial works regularly.
     
  2. mauros

    mauros Member

    Joined:
    Apr 25, 2017
    Messages:
    53
    Likes:
    0
    Ian, you left me :'( :'( :'(
     
  3. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,258
    Likes:
    912
    Location:
    Rochdale UK
    No! I went on holiday... We're allowed to do that you know!!

    As you may already know... I don't really follow Arduino.. I do pic's.. The Arduino system has very few pins so interfacing two or more shields will always be a headache.. I thought that the I2C pins on an Arduino were on AD4 and 5 so they shouldn't affect serial atall..
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. mauros

    mauros Member

    Joined:
    Apr 25, 2017
    Messages:
    53
    Likes:
    0

    oh sorry, I hope you're relaxed ;-) I also think that analog pins 4 and 5 should not affect the serial, unfortunately the problem does not resolve
     
  6. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,258
    Likes:
    912
    Location:
    Rochdale UK
    As we have a different set up, you need to post the code... Are you now connecting the LCD direct to the Arduino? if so you need a different library..
     
  7. mauros

    mauros Member

    Joined:
    Apr 25, 2017
    Messages:
    53
    Likes:
    0
    Yes, I'm connecting the lcd to arduino but the code is too long to enter here, there are about 500 lines.
     
  8. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,258
    Likes:
    912
    Location:
    Rochdale UK
    What pins?
     
  9. mauros

    mauros Member

    Joined:
    Apr 25, 2017
    Messages:
    53
    Likes:
    0
    5V - GND - A4 - A5
     
  10. mauros

    mauros Member

    Joined:
    Apr 25, 2017
    Messages:
    53
    Likes:
    0
  11. mauros

    mauros Member

    Joined:
    Apr 25, 2017
    Messages:
    53
    Likes:
    0
  12. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,833
    Likes:
    138
    Location:
    morristown,tn
    Arduino I2c and USB don't play well
     
  13. mauros

    mauros Member

    Joined:
    Apr 25, 2017
    Messages:
    53
    Likes:
    0
    maybe even without i2C because i have the same problem with only lcd 16x2 without i2C
     
  14. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,258
    Likes:
    912
    Location:
    Rochdale UK
    looking at the PDF for the keyes shield.... The MAX_LCD library uses the digital pins on the shield to drive an LCD as the shield itself uses eight Arduino pins.. The MAX_LCD library is built into the host shield library..

    This is how I would run the display!!

    If you open this link
    http://tinkbox.ph/sites/tinkbox.ph/files/downloads/Keyes - USB Host Shield.pdf
    there is a library link within..
     
  15. mauros

    mauros Member

    Joined:
    Apr 25, 2017
    Messages:
    53
    Likes:
    0
    I can try it out because a USB_Host_Shield library is already included and it also contains the max_LCD files, although they know that they have different sizes.

    Thanks !
     
  16. mauros

    mauros Member

    Joined:
    Apr 25, 2017
    Messages:
    53
    Likes:
    0
    Alas it does not work
     
  17. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,258
    Likes:
    912
    Location:
    Rochdale UK
    After many posts I don't seem to know where we are... What isn't working? LCD? or LCD combined with serial?
     
  18. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,258
    Likes:
    912
    Location:
    Rochdale UK
    I think you need to solder a header onto the shield as it uses the digital port off the max chip..
     
  19. mauros

    mauros Member

    Joined:
    Apr 25, 2017
    Messages:
    53
    Likes:
    0
    LCD itself works but not in combination Arduino
     
  20. mauros

    mauros Member

    Joined:
    Apr 25, 2017
    Messages:
    53
    Likes:
    0
    in what sense, can you explain in detail?
     

Share This Page