008 - MicroPython TechNotes: 16x2 LCD

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 พ.ย. 2024

ความคิดเห็น • 43

  • @ct1egh
    @ct1egh 2 ปีที่แล้ว

    Hi George, thanks for yet another nice and clear tutorial. Excellent job.

  • @sg8nj
    @sg8nj 2 ปีที่แล้ว

    Wow amazing explanation🤩

  • @evantropfun2.035
    @evantropfun2.035 6 หลายเดือนก่อน

    great video (:

  • @tharushadilshan119
    @tharushadilshan119 7 หลายเดือนก่อน

    I'm using a 20x4 lcd and when I try putstr it show questions marks, o's, x and y's and things like that. Any fix?

  • @electronicsshop1135
    @electronicsshop1135 2 ปีที่แล้ว

    very well information and nice tutorial.

    • @TechToTinker
      @TechToTinker  2 ปีที่แล้ว

      I am glad that you found this as helpful. Thanks

  • @astma9814
    @astma9814 2 ปีที่แล้ว

    Sir I have question
    I want to code different sensors to do different function
    My problem is from where I can get library of these sensors
    I tried to research for library but not found

  • @trerentr
    @trerentr 3 ปีที่แล้ว +3

    It seems I2C is deprecated and, SoftI2C is availble. I dont know due to this but even if i shift I2C to SoftI2C, in i2c_lcd.py. line 19 generates an error.
    Which is :
    "
    Traceback (most recent call last):
    File "", line 8, in
    File "i2c_lcd.py", line 19, in __init__
    OSError: [Errno 110] ETIMEDOUT
    "
    which is when mc intialize to send a signal.
    self.i2c.writeto(self.i2c_addr, bytearray([0]))

    • @TechToTinker
      @TechToTinker  3 ปีที่แล้ว

      Hi Eren, you can use MicroPython firmware v1.13. Or if you are currently using v1.14, instead of
      from machine import I2C
      replaced it with:
      from machine import SoftI2C
      and in the main code:
      the instance of "I2C" should be replaced with "SoftI2C" and that's it and it should work.
      Hope this helps you. Cheers.

    • @TechToTinker
      @TechToTinker  3 ปีที่แล้ว

      Also, you don't need to modify the library.

    • @CrlsFdze
      @CrlsFdze 3 ปีที่แล้ว

      @@TechToTinker Tried... but doesn't work

  • @edwintjoa6099
    @edwintjoa6099 3 ปีที่แล้ว +1

    Hi, thanks for the video and explanation. Can you point to me where you buy the LCD and its PCF8574 backpack? Thanks.

    • @TechToTinker
      @TechToTinker  3 ปีที่แล้ว +1

      It's a set of modules that was sent to me from South Korea named Gorillacell ESP32 development kits. Check gorillacell.kr/ the website is in Korean but you may use google translate so you may understand. Their email can also be found on the said webpage. Cheers.

    • @edwintjoa6099
      @edwintjoa6099 2 ปีที่แล้ว +1

      I have adapted your codes for my STM32F446RE board and works like a charm.
      from time import sleep_ms, ticks_ms
      from machine import SoftI2C, Pin
      from i2c_lcd import I2cLcd
      DEFAULT_I2C_ADDR = 0x27
      i2c = SoftI2C(scl=Pin("B8"), sda=Pin("B9"), freq=400000)
      lcd = I2cLcd(i2c, DEFAULT_I2C_ADDR, 2, 16)

    • @TechToTinker
      @TechToTinker  2 ปีที่แล้ว

      @@edwintjoa6099 of course Micropython code are usually portable to other MCU with minor to no modification.

  • @lennydoesrants458
    @lennydoesrants458 3 ปีที่แล้ว +2

    The current downloadable version of i2c_lcd from github (unlike the version in your video) relies on an import smbus statement which cannot be found?
    from lcd_api import LcdApi
    import smbus
    import time
    ....
    If you could list the code for your version that does not use smbus that would be useful.

    • @TechToTinker
      @TechToTinker  3 ปีที่แล้ว +2

      @Lenny Does Rants, kindly use the library and example source code available at: techtotinker.blogspot.com/2021/01/008-micropython-technotes-16x2-lcd.html?m=1

    • @lennydoesrants458
      @lennydoesrants458 3 ปีที่แล้ว +1

      Thank you sir, all is well!!

    • @TechToTinker
      @TechToTinker  3 ปีที่แล้ว

      @@lennydoesrants458 I'm glad to help. Cheers.

  • @capiberra4118
    @capiberra4118 ปีที่แล้ว

    Nice tutorial, thanks! Is VCC +5 volts or +3 volts from your GorillaCell shield? Cheers!

  • @sgour100
    @sgour100 3 ปีที่แล้ว +2

    Hi I am from India.Nice Dear You are doing a great job..pl keep it up.Pl post a video on how to use internal EEPROM in Esp32 and Esp8266 by using MicroPython

    • @TechToTinker
      @TechToTinker  3 ปีที่แล้ว

      @Sanjay Gour, I am glad that you liked my video.
      With regards to your suggestion, I think there is no EEPROM implementation in MicroPython (I could be wrong here) but there is internal file system you can work on with and it is more powerful than EEPROM. You can reference it from here: docs.micropython.org/en/latest/reference/filesystem.html
      Cheers.

    • @sgour100
      @sgour100 3 ปีที่แล้ว

      @@TechToTinker thanks to respond..

    • @TechToTinker
      @TechToTinker  3 ปีที่แล้ว

      @@sgour100 you're very much welcome. Thanks

  • @calvinsmith8839
    @calvinsmith8839 3 ปีที่แล้ว

    Great instructions thank you

    • @TechToTinker
      @TechToTinker  3 ปีที่แล้ว +1

      Thank you @Calvin Smith.

  • @sergiowmuller
    @sergiowmuller 3 ปีที่แล้ว +1

    I did exactly the same as you but it's not printing on LCD whith tuis error:
    File "", line 1, in
    NameError: name 'lcd' isn't defined
    Im using an ESP32

    • @TechToTinker
      @TechToTinker  3 ปีที่แล้ว

      you should put the 2 driver library on ESP32 MicroPython root directory.

  • @chipmunk1066
    @chipmunk1066 2 ปีที่แล้ว

    great video, very informative, thanks alot for the video ! i must also ask do you see micro python devices becoming more popular then C based microcontrollers?

  • @67omkarwaghmare28
    @67omkarwaghmare28 3 ปีที่แล้ว +1

    Sir I got
    OSError: [Errno 19] ENODEV
    please solve my error

  • @SoggyCashew
    @SoggyCashew 3 ปีที่แล้ว

    Thank you.... If I had a button, how can I count its presses but only start counting after the button has been pressed 5 times?

    • @TechToTinker
      @TechToTinker  3 ปีที่แล้ว +1

      @SoggyCashew, I would do it like something like the following:
      from machine import Pin
      from time import sleep
      b = Pin(12, Pin.IN)
      press = 0
      while True:
      if b.value():
      press = press + 1
      if press > 5:
      print('Press count: {}'.format(press-5))
      else:
      print('Press no count: {}'.format(press))
      sleep(0.3)
      It should print something like:
      Press no count: 1
      Press no count: 2
      Press no count: 3
      Press no count: 4
      Press no count: 5
      Press count: 1
      Press count: 2
      Press count: 3
      and so on.
      Hope this helps.

    • @SoggyCashew
      @SoggyCashew 3 ปีที่แล้ว

      @@TechToTinker what if I wanted to count down -5,-4,-3,-2,-1 then count up?

    • @TechToTinker
      @TechToTinker  3 ปีที่แล้ว +1

      @@SoggyCashew you may achieve that by having 2 variables, 1 for counting down and another for counting up.
      Try to solve it first on your own. If you are stuck, show your code first, then we can help you better.
      Cheers.

  • @waleedraza7195
    @waleedraza7195 3 ปีที่แล้ว

    nice tutorial, one question: will this library work for a 20x4 LCD connected via I2C?

    • @TechToTinker
      @TechToTinker  3 ปีที่แล้ว +2

      Yes, it will work with 20x4 I2C lcd by changing:
      lcd = I2cLcd(i2c, DEFAULT_I2C_ADDR, 2, 16)
      to:
      lcd = I2cLcd(i2c, DEFAULT_I2C_ADDR, 4, 20)
      If not, be sure to change the DEFAULT_I2C_ADDR specific lcd such as 0x27.
      Hope this helps. Cheers

  • @Tolya421.
    @Tolya421. 3 ปีที่แล้ว

    Класное видио спасибо брат!

    • @TechToTinker
      @TechToTinker  3 ปีที่แล้ว

      @Анатолий Нестеров, glad that you liked it. Thanks brother.

  • @jhumarianneyongco2471
    @jhumarianneyongco2471 3 ปีที่แล้ว +1

    Just wanted to ask why everytime I try to run example 1, I get this error?
    Traceback (most recent call last):
    File "", line 8, in
    File "i2c_lcd.py", line 19, in __init__
    OSError: [Errno 19] ENODEV

    • @TechToTinker
      @TechToTinker  3 ปีที่แล้ว +3

      Try to change the line:
      DEFAULT_I2C_ADDR = 0x20
      to
      DEFAULT_I2C_ADDR = 0x27
      Please let me know.