- changed status to open
How to use the SPI interface in ESP32 to drive a 0.96 OLED 1306 screen?
We are a team working on educational robots, currently planning to use Microblocks to control the ESP32. However, we have encountered a problem. When using the official OLED library, we found that it can only control the screen using microbit with SPI protocol. We want to use ESP32 to drive the 0.96 OLED screen with SPI protocol. How can we do this?
Comments (23)
-
repo owner -
In order to use the SPI connection with the ESP32, you need to have an SPI version of the OLED screen.
If you do, then follow directions below.I don't have a 0.96in SPI display, but I have an 2.4in OLED SPI screen with pins connected as listed below.
DISPLAY ESP32
CS NOT USED
DC Any dig pin
RES Any dig pin
SDA 23
SCL 18
VCC 3.3V
GND GNDI found this SPI version of the OLED 0.96in:
DISPLAY ESP32
CS NOT USED
DC Any dig pin
RES Any dig pin
SDA (DI) 23 , VSPI-MOSI
SCL (D0) 18 , VSPI-CLK
VCC 3.3V
GND GNDYou need to verify the designations for DI / DO in the display documentation as to which is SCL and MOSI (SDA).
The 2 digital pins are used for the RESET and DC functions on the SPI config block of the OLED Library:
d/c and reset numbers shown are for what I used. Your's may be different. Just replace as needed.
Images of the display with connection and text (Sorry about the plastic on the display).
Once you make the connections, click to initialize, and then click on WRITE block for text display.
Hope it helps.
Turgut
-
reporter Thank you very much for your help, we have successfully lit it up, and in the near future, there will be a desktop-level robot dog controlled by microblocks
-
I am glad you managed to make the SPI display work. If that is the dog from Elekfreaks, I just bought the same. I was going to write the library for it. But you may beat me to it.
-
repo owner - changed status to resolved
I'm marking this resolved, but you can continue to make comments here. I'd love to hear about any progress with the robotic dog!
-
reporter Elecfreak is a global partner of the XGO team. We have completed the motion control library for the XGO-nano version, but it is currently in Chinese, here is our wiki https://www.yuque.com/luwudynamics/en
-
reporter
-
reporter We also will use Microblocks to programe XGO-Rider , a desktop wheel legged robot .Both the XGO-Rider and the XGO2 series robot dogs use the Raspberry Pi CM4 as the main controller for educational robots. Additionally, all the source code and structural drawings are open source. We have not yet tried virtual machines for the Raspberry Pi, but we plan to use Microblocks for programming and controlling the Raspberry Pi in the future.
-
repo owner Glad you got the XGO-nano library working in MicroBlocks! Let us know if you need help getting the MicroBlocks virtual machine running on the Raspberry Pi. We do not use that VM regularly, and the pin I/O features have not been heavily tested so it may need a few tweaks.
-
reporter here is the XGO lib for Microblocks https://drive.google.com/drive/folders/1Kq52mrtTGU5auHRH_74NiMrqb0NWG6tp?usp=sharing
-
repo owner Thanks! I'm on vacation until early January but will look at this when I get back.
-
reporter https://twitter.com/luwu_dynamics/status/1743863279603306631?s=19 Finally, we successfully used microblocks to drive XGO for visual positioning and grasping.
-
repo owner Wow, wow, wow! That is really impressive! What the AI camera? HuskyLens?
-
reporter Yes , it is HuskyLens
-
repo owner Good to know. I shared your Tweet on the MicroBlocks Discord server.
-
repo owner We just got our own XGO for micro:bit:
https://www.elecfreaks.com/elecfreaks-xgo-robot-dog-kit-v2-for-micro-bit.html
I am trying to use your library but am not able to communicate with it. What micro:bit pins does it use for serial?
Have you updated your library? If so, could you post the latest version here?
Thanks!
-
reporter we use esp32 , it seems the pin is not same as microbit
-
reporter -
reporter if use microbit , TR should be TX-pin14 and RX-pin13
-
XGO Lite 2:TX-pin14 and RX-pin13
-
repo owner Thank you! That's exactly what I needed!
-
repo owner We got our XGO working with the micro:bit. Thank you for the library and the pin numbers.
-
reporter here is the english beta lib https://drive.google.com/drive/folders/1KZPZIXc7TNojQ3qNLVMDmtvmEgo2QOJs?usp=sharing
- Log in to comment