Difference: OledDisplay (20 vs. 21)

Revision 212021-05-31 - PeterSchmid

Line: 1 to 1
 
META TOPICPARENT name="WebHome"
%DASHBOARD{ section="banner"
Line: 44 to 44
 I2Cget ( c-addr u -- ) c-addr buffer address for the message to receive I2Cputget ( a1 u1 a2 u2 -- ) a1 buffer address for the message to send, a2 buffer address for the message to receive
Added:
>
>
>oled ( -- addr1 addr2 ) redirect to oled
>term ( addr1 addr2 -- ) terminate redirection
 

Changed:
<
<
>
>
 

Usage

It is easy to redirect the terminal output to the OLED display, to use the string formatting words.

Line: 62 to 64
 ;
Added:
>
>
or even simpler
: oled-hallo (  -- )
  >oled         \ redirect terminal to oled-emit
  ." Hallo Velo! " cr
  ." ciao"
  >term         \ terminate redirection
;

or on a command line

>oled .( Hallo Velo!) >term

show date and time on OLED (see CmsisRtos#How_to_use_Tasks for a background task).

 
: clock (  -- )
  oledclr

Line: 70 to 88
  begin wait-alarm \ wait a second 0 0 oledpos!
Changed:
<
<
hook-emit @ \ save emit hook ['] oled-emit hook-emit ! \ redirect terminal to oled-emit .time hook-emit ! \ restore old hook
>
>
>oled .time >term
  key? until key drop ;
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback