38 lines
1.1 KiB
Forth
38 lines
1.1 KiB
Forth
\ Copyright 2023 Bradley D. Nelson
|
|
\
|
|
\ Licensed under the Apache License, Version 2.0 (the "License");
|
|
\ you may not use this file except in compliance with the License.
|
|
\ You may obtain a copy of the License at
|
|
\
|
|
\ http://www.apache.org/licenses/LICENSE-2.0
|
|
\
|
|
\ Unless required by applicable law or agreed to in writing, software
|
|
\ distributed under the License is distributed on an "AS IS" BASIS,
|
|
\ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
\ See the License for the specific language governing permissions and
|
|
\ limitations under the License.
|
|
|
|
vocabulary oled oled definitions
|
|
transfer oled-builtins
|
|
DEFINED? OledNew [IF]
|
|
128 constant WIDTH
|
|
64 constant HEIGHT
|
|
-1 constant OledReset
|
|
0 constant BLACK
|
|
1 constant WHITE
|
|
1 constant SSD1306_EXTERNALVCC
|
|
2 constant SSD1306_SWITCHCAPVCC
|
|
: OledInit
|
|
OledAddr @ 0= if
|
|
WIDTH HEIGHT OledReset OledNew
|
|
SSD1306_SWITCHCAPVCC $3C OledBegin drop
|
|
then
|
|
OledCLS
|
|
2 OledTextsize ( Draw 2x Scale Text )
|
|
WHITE OledTextc ( Draw white text )
|
|
0 0 OledSetCursor ( Start at top-left corner )
|
|
z" *Esp32forth*" OledPrintln OledDisplay
|
|
;
|
|
[THEN]
|
|
forth definitions
|