Hello,
I am trying to display sensor values to OLED ssd1306 using Micropython. “Hello World” example from MicroPython works. However, when i run “oled.text” in a while loop, i get the some values as solid blocks , not numbers. Below is my code :
while i < 50 : water_sensor_value = 3.3*(water_sensor.read())/4095 pwr9v_value = 3.3*((pwr9v.read())/4095) print ("i = ", i , "water sens =", water_sensor_value, "pwr9v = ", pwr9v_value) water_sensor_str = 'wt_sn = ' + str(water_sensor_value) + "X" pwr_sensor_str = "9V div =" + str(pwr9v_value) count_str = "i = " + str(i) + 'X' oled.text(water_sensor_str, 0, 0) oled.text(pwr_sensor_str, 0, 10) oled.text(count_str, 0, 20) oled.show() i = i + 1 #with delay of 2 power reading is more stable sleep (2)
here is how it looks:
https://imgur.com/a/TlPLSRK#gjwGeHK
Any suggestions are appreciated.
Thanks
i found a good link;
diyprojects.io/oled-display-ssd1306-micropython-example-digital-barometer-bme280-i2c
i had to have oled object inside he loop.
thanks
I’m glad you found the solution and thanks for marking it as “Resolved” If you have more questions, feel free to post them here: https://rntlab.com/ask-question/
Regards,
Rui