SSD1306 doesn't work on ESP32? #6883
Replies: 1 comment
-
Posted at 2017-03-05 by Wilberforce I believe the pins 2-6 are used for the flash chip, so best not to use pins 4 & 5. Change those to say pins 16,17, rewire and see how you get on.\
@jumjum - Should we add a warning if these pins are used? Posted at 2017-03-05 by Aifer In SSD1306.js, connectSPI() has some codes not work well on ESP32, such as digitalPulse(rst,0,10), cs.reset() and cs.set() . Just rewrite some lines: cs.reset() --> digitalWrite(cs,0) The OLED module works well. But, the initial action of SPI and Graphics module must be in the onInit() function. why?
Posted at 2017-03-05 by Aifer mySSD1306.js
Posted at 2017-03-05 by @MaBecker
because connectSPI send some init commands to make the OLED work correct.
Posted at 2017-03-06 by Wilberforce @user73896 Please can you confirm the following a. I'm surprised this did not work: Please can you re-test? b. I'm not sure if this has been implemented - @jumjum - can you recall? Posted at 2017-03-06 by Wilberforce comfirmed that Posted at 2017-03-06 by Aifer in mySSD1360.js, in exports.connectSPI function ,
the OLED dosn't work. then , try
the OLDE works well. so, I think digitalPulse(rst,0,10) doesn't works correctly. Posted at 2017-03-06 by Aifer I' sorry, pin.set() and reset() can work well, D21.set and reset works on my widora v5.0 ESP32 board. Posted at 2017-03-06 by JumJum digitalPulse(rst,0,10) sends one pulse to gnd for 10 msecs Posted at 2017-03-06 by Wilberforce @jumjum I think it is meant to set to low for 10 ms then finish in the high state. That's how I read that reference documentation. Posted at 2017-03-06 by JumJum If there is a pulse only, replacing this by 10 times on/off is a bit strange. Posted at 2017-03-06 by Aifer eg. digitalPulse(A0,1,5); pulses A0 high for 5ms. digitalPulse(A0,1,[5,2,4]); pulses A0 high for 5ms, low for 2ms, and high for 4ms. It seems that digitalPulse(rst,0,10) sets rst pin( rst = 1) , and then resets it for 10ms(rst = 0), at last sets it again(rst = 1). Yet, it doesn't work. Posted at 2017-03-06 by @MaBecker Hi @aifer, check the state of your rest pin, should be "input_pullup" to make digitalPulse(rst,0,10) work Posted at 2017-03-07 by Aifer Hi, @MaBecker
Not work.
Work well.
Work well.
Work well.
Not work.
Work well.
Work well. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-03-04 by Aifer
function go(){
//g.on();
// write some text
g.drawString("Hello World!",2,2);
// write to the screen
g.flip();
}
// SPI
SPI2.setup({sck:18, mosi:23});
var g = require("SSD1306").connectSPI(SPI2, 4 /DC/, 12 /RST/, go, { cs:5 });
no errors, but the OLED doesn't work.
Beta Was this translation helpful? Give feedback.
All reactions