OLED 096

![]() | ![]() | ![]() | ![]() |
0.96" - 128x64 OLED BW display
- Overview
- Drivers
- Samples
- Projects
0.96" - 128x64 OLED BW display
Key features • 0.96" display | Resources |
Function | Description |
---|---|
Init() | Initialize the display. Automatically called on power up. |
GetW() | Get display width: 128. |
GetH() | Get display height: 64. |
IsColor() | Returns 0. |
DVer() | This driver version. |
The Code!
Modules ship with this script preloaded. Use Console to reload or modify the drivers. Additionally, some languages, such as Python, include DUELink.Engine.Record()
for recording scripts directly from the host.
##### Driver Code Starts Here ###
fn Init()
dwrite(1, 1) # reset pin
# config I2C bus with 400Kz
i2ccfg(400)
Wait(20)
gfxcfg(1,{0x3C}, 128, 64, 1)# type 1, 128x64 pixels, buffered x1
Cmd(0xAE):Cmd(0x00):Cmd(0x10)
Cmd(0x40):Cmd(0x81):Cmd(0xCF)
Cmd(0xA1):Cmd(0xA6):Cmd(0xA8)
Cmd(0x3F):Cmd(0xD3):Cmd(0x00)
Cmd(0xD5):Cmd(0x80):Cmd(0xD9)
Cmd(0xF1):Cmd(0xDA):Cmd(0x12)
Cmd(0xDB):Cmd(0x40):Cmd(0x8D)
Cmd(0x14):Cmd(0xAF):Cmd(0xC8)
Cmd(0x20):Cmd(0x00):Cmd(0x21)
Cmd(0):Cmd(128-1)
Cmd(0x22):Cmd(0):Cmd(7)
fend
fn Cmd(c)
i2cwr(0x3c, [0, c], 0)
fend
fn IsColor()
return 0
fend
fn GetH()
return 64
fend
fn GetW()
return 128
fend
fn DVer()
return 0.1
fend
Init()
##### User Code Starts Here #####
- Script
- Python
- JavaScript
Use Console to modify the default driver by adding this sample.
# Append this code at the bottom of the script, right after the driver.
# You MUST keep the driver code!!
_x = 0
_d = -9
while 1
clear(1)
texts(Str(_x), 0, 50, 5, 2, 2)
Circle(0, _x, 50, 5)
_x=_x+_d
if(_x < 0 || _x > 128)
_d = _d * -1
end
show()
wend
from DUELink.DUELinkController import DUELinkController
import time
availablePort = DUELinkController.GetConnectionPort()
duelink = DUELinkController(availablePort)
//code
Coming soon!
Ordering Info
Description | Part Number | Price |
---|---|---|
OLED 0.96" B&W Display | GDL-DOLED096-A | $00.00 |