-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.py
62 lines (42 loc) · 980 Bytes
/
example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
from machine import Pin, I2C
# requires ssd1306 class, configure import depending on local structure
from modules import ssd1306, syna
from time import sleep
i2c = I2C(scl=Pin(5), sda=Pin(4))
oled_width = 128
oled_height = 64
oled = ssd1306.SSD1306_I2C(oled_width, oled_height, i2c)
items = ['Test 1', ['Test 2', '@sub1'], 'Test 3', 'Test 4', 'Test 5', 'Test 6', 'Test 7', 'Test 8', 'Test 9', 'Test 10', 'Test 11']
menu = syna.Syna(oled)
menu.addMenu('main', items, 'Main menu')
menu.addMenu('sub1', [['%10s' % 'Start', 'print("test")'], 'Test 100'], 'Submenu 1', 'main')
#submenu = syna.Syna(oled, ['Test oof', ['back', 'menu.show()']], 'Sub1')
menu.show('main')
sleep(1)
menu.down()
sleep(1)
menu.click()
sleep(1)
menu.down()
sleep(1)
menu.down()
sleep(1)
menu.down()
sleep(1)
menu.down()
sleep(1)
menu.down()
sleep(1)
menu.click()
sleep(1)
menu.down()
sleep(1)
menu.down()
sleep(1)
menu.up()
sleep(1)
menu.up()
sleep(1)
menu.click()
#sleep(1)
#menu.click()