Problems whit len
#15561
Replies: 1 comment 2 replies
-
Please format with 3 backticks.
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Here the code go easy on me I've not used micrpyhton but little over week.
``
import machine
from ssd1306 import SSD1306_I2C
import framebuf
i2c = machine.I2C(scl=machine.Pin(5), sda=machine.Pin(4))
oled = SSD1306_I2C(128, 64, i2c)# ... (I2C initialization and OLED object creation as before)
def draw_char(char, x, y, size):
oled.fill(0)
draw_char('A', 20, 10, 3) # Draw 'A' with size 3
oled.show()``
And i get these errors
MPY: soft reboot
Warning: I2C(-1, ...) is deprecated, use SoftI2C(...) instead
Traceback (most recent call last):
File "", line 26, in
File "", line 21, in draw_char
TypeError: object of type 'int' has no len()
Beta Was this translation helpful? Give feedback.
All reactions