Commit ddecbfa
authored
refactor(mcp23009e): Migrate menu_navigation example to steami_screen. (#395)
Migrate `lib/mcp23009e/examples/menu_navigation.py` from direct SSD1327 calls to the `steami_screen` widget API. Closes #374
- Replaced manual `display.text()` and hand-coded positioning with `screen.menu()`, `screen.title()`, `screen.value()` and `screen.subtitle()`
- Replaced `ssd1327` direct instantiation with `SSD1327Display` + `Screen` wrapper
- Added `@micropython.native` decorator on `is_any_pressed()` for better performance in the button polling loop
- Extracted `is_any_pressed()` as a reusable helper function
- Removed manual layout constants (`X0`, `TITLE_Y`, `ITEM_Y`, etc.) — layout is now handled by `steami_screen`1 parent c8375a6 commit ddecbfa
1 file changed
Lines changed: 28 additions & 48 deletions
File tree
- lib/mcp23009e/examples
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | 7 | | |
10 | 8 | | |
11 | 9 | | |
12 | 10 | | |
| 11 | + | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
| |||
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
47 | | - | |
48 | 48 | | |
49 | | - | |
50 | | - | |
51 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | 54 | | |
62 | 55 | | |
63 | | - | |
64 | 56 | | |
65 | 57 | | |
66 | 58 | | |
67 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
68 | 68 | | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
| 69 | + | |
78 | 70 | | |
79 | 71 | | |
80 | 72 | | |
81 | 73 | | |
82 | | - | |
83 | 74 | | |
84 | 75 | | |
85 | 76 | | |
| |||
92 | 83 | | |
93 | 84 | | |
94 | 85 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
107 | 92 | | |
108 | 93 | | |
109 | 94 | | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
120 | 101 | | |
121 | 102 | | |
122 | 103 | | |
123 | | - | |
124 | 104 | | |
125 | 105 | | |
126 | 106 | | |
| |||
0 commit comments