Unverified Commit 8a4a8a3f authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

README links; firmware; nodemcu-uploader

parent 3ac749b8
Loading
Loading
Loading
Loading

.gitmodules

0 → 100644
+3 −0
Original line number Diff line number Diff line
[submodule "ext/nodemcu-uploader"]
	path = ext/nodemcu-uploader
	url = https://github.com/kmpm/nodemcu-uploader.git
+41 −4
Original line number Diff line number Diff line
# ESP8266 Lua/NodeMCU framebuffer + module for SSD1306 OLEDs

This repository contains a Lua module (`ssd1306.lua`), framebuffer
(`framebuffer.lua`) and fonts (`pixeloperator.lua`, `terminus16.lua`)
for using **SSD1306**-based OLEDs with ESP8266/NodeMCU firmware.
[esp8266-nodemcu-ssd1306](https://finalrewind.org/projects/esp8266-nodemcu-ssd1306/)
provides an ESP8266 NodeMCU Lua module (`ssd1306.lua`), framebuffer
(`framebuffer.lua`) and fonts (`pixeloperator.lua`, `terminus16.lua`) for
128×64 and 128×32 **SSD1306** OLEDs connected via I²2C.

## Dependencies

@@ -27,8 +28,44 @@ fb = require("framebuffer")
collectgarbage()

ssd1306.init(128, 64) -- assuming that a 128x64 OLED is connected
ssd1306.contrast(255) -- maximum contrast
ssd1306.contrast(128) -- medium contrast
fb.init(128, 64) -- initialize framebuffer for 128x64 pixels
fb.print(fn, "Hello from NodeMCU!\nHello yes, this is Lua\n")
ssd1306.show(fb.buf)
```

128×32 OLEDs are also supported by adjusting the arguments to `ssd1306.init`
and `fb.init` accordingly.

## Flashing

This repository contains a NodeMCU build that provides the required modules.
You can flash it using e.g. esptool:

```bash
esptool write_flash 0x00000 firmware/nodemcu-release-11-modules-2024-01-18-18-47-17-integer.bin
```

After flashing, the firmware will need a few seconds to initialize the
filesystem. You then flash the Python code, e.g. using nodemcu-uploader:

```bash
ext/nodemcu-uploader/nodemcu-uploader.py upload *.lua
```

Afterwards, you can check whether everything works using the serial connection,
e.g.

```bash
pyserial-miniterm --dtr 0 --rts 0 /dev/ttyUSB0 115200
```

You may need to adjust the `/dev/tty` device name.

## References

Mirrors of the esp8266-nodemcu-ssd1306 repository are maintained at the following locations:

* [Chaosdorf](https://chaosdorf.de/git/derf/esp8266-nodemcu-ssd1306)
* [Finalrewind](https://git.finalrewind.org/derf/esp8266-nodemcu-ssd1306)
* [GitHub](https://github.com/derf/esp8266-nodemcu-ssd1306)
Original line number Diff line number Diff line
Subproject commit 6178f40fff2deadd56b5bc474f9b4475ef444b37
+456 KiB

File added.

No diff preview for this file type.