Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By Mikejstb
#18995 Just a quick note - I tried to get this to work with a 1.3" oled, which I believe is a SH1106 chip display.
Just plugging it in instead of the .96" display there's a little garbage on the far right of the display.
I found on an Adruino forum that this turns out to be because the SH1106 needs the column to be offset by 2 - here in the OLED_MOD code :
Code: Select all//==========================================================//
// Set the cursor position in a 16 COL * 8 ROW map.
static void setXY(unsigned char row,unsigned char col)
  sendcommand(0xb0+row);                //set page address
  sendcommand(0x02+(8*col&0x0f));       //set low col address // mdj added offset 0x02
  sendcommand(0x10+((8*col>>4)&0x0f));  //set high col address

but it appears that the SH1106 doesn't handle auto-scrolling when sending byte data like the SSD11306 does, so the graphics display is just not right.
I tried to handle the XY positioning manually during the draw functions but so far haven't been able to get it right.
User avatar
By vu2iia
#19001 Hi Mike,

Do you mind sharing what tweaks you did to code. Perhaps it might help me.

Thanks in advance.


Mikejstb wrote:Thanks for the nice example!

I tweaked the code a bit to just cycle, displaying first the pretty wifi graphic, then list all the APs that are seen, then the waves graphic, over and over.
I took out the code that logged into an AP and displayed the ip address and such.
Didn't really need that to happen.
And I put in a counter to display the first 8 APs found, then if there are more to clear the display and then display the next 8, etc.

I didn't have room on the oled to display the signal strength - that would have nice to show but it just won't fit without taking two lines per AP.

I'm going to mount it all with a battery and possibly a charger into a little box I got from Electrodragon http://www.electrodragon.com/product/plastic-case-top-bot/.

I'm just waiting for some little toggle switches to get here.

Thanks again - very good job!
User avatar
By danbicks
#19024 Mikejstb,

Really nice work, I have been meaning to get hold of some of these 1.3" OLED but thought I would wait until a nice colour version becomes available at a good price.

Does not surprise me that the auto-scrolling is not supported. It would be worth wrapping up a routine for this if nice cheap colour variants hit the market :)

Nice work mate.