Search found 17 matches

by mflmartin
Sat Jul 30, 2016 11:53 pm
Forum: ESP8266 boards
Topic: ssd1306 using I2C on the esp8266
Replies: 54
Views: 33744

Re: ssd1306 using I2C on the esp8266

No, the error you are getting is because the image you are reading has a color that is not included in the colors dictionary, so it doesn't know what to do with it. Oupppps, my bad! You are right. The black was set to 191919. So, I understand it about black and white, but what do this other 2 color...
by mflmartin
Sat Jul 30, 2016 2:14 pm
Forum: ESP8266 boards
Topic: ssd1306 using I2C on the esp8266
Replies: 54
Views: 33744

Re: ssd1306 using I2C on the esp8266

I didn't save the snippets that I normally use, but here's one that I recently used to generate data for a 2-bit font: import pygame colors = { (0, 0, 0, 255): 0, (102, 102, 102, 255): 1, (204, 204, 204, 255): 2, (255, 255, 255, 255): 3, } image = pygame.image.load("font.png") images = [] for tile_...
by mflmartin
Sat Jul 30, 2016 1:49 pm
Forum: ESP8266 boards
Topic: ssd1306 using I2C on the esp8266
Replies: 54
Views: 33744

Re: ssd1306 using I2C on the esp8266

@mflmartin I'll try to explain. I hand crafted the [7,192,24,48...] array by drawing a smily on a 16x16 grid, split into groups of 8 pixels, then converted binary to decimal. 16 pixels wide fits into 2 bytes... Yeah, it seems labourious... hmmmmm. Thanks for the in depth explanation. It helps! I wo...
by mflmartin
Sat Jul 30, 2016 1:43 pm
Forum: ESP8266 boards
Topic: ssd1306 using I2C on the esp8266
Replies: 54
Views: 33744

Re: ssd1306 using I2C on the esp8266

I didn't save the snippets that I normally use, but here's one that I recently used to generate data for a 2-bit font: [/code] I see, so you were able to substitute the default text font? If so, how do you link the new font as the default? I wanted to do that, and use pixel fonts ( the ones that we...
by mflmartin
Fri Jul 29, 2016 10:16 pm
Forum: ESP8266 boards
Topic: ssd1306 using I2C on the esp8266
Replies: 54
Views: 33744

Re: ssd1306 using I2C on the esp8266

Personally I just write a short program in PyGame that reads that image and then iterates over all the pixels and generates whatever I need. Thanks, I am looking into pygame, but I am a bit lost. I don't understand, yet, all the structures. Could you please share that bit of code that takes 1 image...
by mflmartin
Wed Jul 27, 2016 9:08 pm
Forum: ESP8266 boards
Topic: ssd1306 using I2C on the esp8266
Replies: 54
Views: 33744

Re: ssd1306 using I2C on the esp8266

[quote="mcauser"]It works!! I added an extra method for outputting a bitmap. Feels like it should not belong in class SSD1306, instead a higher graphics library, which can output shapes, lines, solid blocks etc. As mentioned on your PR: https://github.com/micropython/micropython/pull/2187 [code] def...
by mflmartin
Sat Jul 23, 2016 7:44 pm
Forum: ESP8266 boards
Topic: why os.listdir return ENODEV
Replies: 28
Views: 22634

Re: why os.listdir return ENODEV

I had the exact same problem. Flashing v1.8.2-40-g0d22177 version solved the issue. I even created a bug in the repo, but I closed it after flashing this version solved my problem. Did you flash: v1.8.2-40-g0d22177 and got the same problem? Did you do a python esptool.py -p COM6 erase_flash , before...