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
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]))
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.
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.
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)
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.
@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
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
@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.
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?
@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 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.
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
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
Hi George, thanks for yet another nice and clear tutorial. Excellent job.
Glad you enjoyed it
Wow amazing explanation🤩
great video (:
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?
very well information and nice tutorial.
I am glad that you found this as helpful. Thanks
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
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]))
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.
Also, you don't need to modify the library.
@@TechToTinker Tried... but doesn't work
Hi, thanks for the video and explanation. Can you point to me where you buy the LCD and its PCF8574 backpack? Thanks.
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.
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)
@@edwintjoa6099 of course Micropython code are usually portable to other MCU with minor to no modification.
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.
@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
Thank you sir, all is well!!
@@lennydoesrants458 I'm glad to help. Cheers.
Nice tutorial, thanks! Is VCC +5 volts or +3 volts from your GorillaCell shield? Cheers!
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
@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.
@@TechToTinker thanks to respond..
@@sgour100 you're very much welcome. Thanks
Great instructions thank you
Thank you @Calvin Smith.
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
you should put the 2 driver library on ESP32 MicroPython root directory.
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?
Sir I got
OSError: [Errno 19] ENODEV
please solve my error
Check your connection.
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?
@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.
@@TechToTinker what if I wanted to count down -5,-4,-3,-2,-1 then count up?
@@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.
nice tutorial, one question: will this library work for a 20x4 LCD connected via I2C?
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
Класное видио спасибо брат!
@Анатолий Нестеров, glad that you liked it. Thanks brother.
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
Try to change the line:
DEFAULT_I2C_ADDR = 0x20
to
DEFAULT_I2C_ADDR = 0x27
Please let me know.