%DASHBOARD{ section="dashboard_start" }% %DASHBOARD{ section="banner" image="%PUBURLPATH%/MecrispCube/OledDisplay/oled-mecrisp-cube-header.jpg" title="Quad Alphanumeric Feather Display" titlestyle="color:#F00000;" }% %DASHBOARD{ section="box_start" title="Intro" width="485" height="250"}% https://www.adafruit.com/product/3130 Quad 14 segment (plus decimal point) LED display. %DASHBOARD{ section="box_end" }% %DASHBOARD{ section="box_start" title="Contents" width="460" height="250"}% %TOC% %DASHBOARD{ section="box_end" }% %DASHBOARD{ section="box_start" width="992" height="600" }% ---+ Quad Alphanumeric Display and !I2C Words =quad-emit= works like the standard word =emit=. It blocks the calling thread, as long as the character is not written to the Quad Alphanumeric Display <pre> quad-emit ( Char -- ) Emits a character (writes a character to the Quad Alphanumeric display) quad-emit? ( -- Flag ) Quad Alphanumeric display ready to get a character (I2C not busy) hook-emit ( -- a-addr ) Hooks for redirecting terminal IO on the fly hook-emit? ( -- a-addr ) quadpos! ( x -- ) Set Quad Alphanumeric display cursor position, x (column) horizontal position, max. 3 quadpos@ ( -- x ) Get the current Quad Alphanumeric display cursor position quadcmd ( c-addr -- ) Send command to the Quad Alphanumeric display controller SSD1306. First byte contains the length of the command. quadclr ( -- ) Clears the Quad Alphanumeric display display, sets the cursor to 0 I2Cdev ( u -- ) Sets the 7-bit I2C address I2Cput ( c-addr u -- ) c-addr buffer address for the message with lengh u to send 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 >quad ( -- addr1 addr2 ) redirect to Quad Alphanumeric display *) >term ( addr1 addr2 -- ) terminate redirection *) *) part of redirection.fs </pre> %DASHBOARD{ section="box_end" }% %DASHBOARD{ section="box_start" width="992" height="600" }% ---+ Usage It is easy to redirect the terminal output to the Quad Alphanumeric display, to use the string formatting words. <pre> : quad-hallo ( -- )%COMMENT% hook-emit @ \ save emit hook ['] quad-emit hook-emit ! \ redirect terminal to quad-emit ." Hallo Velo! " cr ." ciao" hook-emit ! \ restore old hook ; </pre> or even simpler <pre> : quad-hallo ( -- ) >quad \ redirect terminal to quad-emit ." Hallo Velo! " cr ." ciao" >term \ terminate redirection ; </pre> or on a command line <pre> >quad .( ELKE) >term </pre> show time on Quad Alphanumeric display (see CmsisRtos#How_to_use_Tasks for a background task). <pre> : clock ( -- ) quadclr -1 -1 -1 alarm! \ set an alarm every second begin wait-alarm \ wait a second 0 0 quadpos! >quad .time >term key? until key drop ; </pre> %DASHBOARD{ section="box_end" }% %DASHBOARD{ section="box_start" width="992" height="500" }% ---+ Links ---++ HT16K33 Driver Data sheet https://cdn-shop.adafruit.com/datasheets/ht16K33v110.pdf ---+++ Driver SW https://github.com/adafruit/Adafruit_LED_Backpack/blob/master/Adafruit_LEDBackpack.cpp ---++ Egg Timer https://www.amazon.de/Kurzzeitmesser-30-sek%C3%BCndiger-Timer-Memory-Funktion-Befestigen-Metallfl%C3%A4chen/dp/B07GJV6B3B D6 PWM | Start/Stop | Pi | | M | STO | | S | ENTER | | | CLOCK | | | CALC | | f | f | | On | On C | | Start/Stop | R/S | | M- | [x] | | S- | DUP | | | FLOAT | | | TERM | | f | f | | Off | Off | Buzzer https://mspindy.com/product/ast1240mlq/ ---++ How to prepare your timer 1: Pull the transparent band out of the battery compartment to activate the battery. 2: Press the MIN and SEC buttons at the same time, the display will now display "00.00". How to use your timer to count down 1. Set the desired time by pressing the MIN and SEC buttons. 2. Another way to set the time is to hold down the MIN button. The number resumes automatically when the button is pressed for 3 seconds. 3: Press the START / STOP button to start the countdown. 4: When the time is up, the timer will beep How to use your time to count 1: Press the MIN and SEC buttons at the same time, the display will show "00.00". 2:Press the START/STOP button to start counting. To stop the alarm Press the START/STOP button. 32S switches off automatically, any button starts the memory again. To clear the display Press the MIN and SEC button simultaneously, the display will show "00.00". Pause the timer 1: Press the START/STOP button once while the countdown is down/up. 2: Press the START/STOP button again to continue counting down/up. Replacing the battery. Replace the old battery with a 7# battery. The batteries must be inserted with the correct polarity. If the scale is not used for a long time, remove the batteries. %DASHBOARD{ section="box_end" }% %DASHBOARD{ section="dashboard_end" }% -- %USERSIG{PeterSchmid - 2024-12-13}% <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-sa/4.0/88x31.png" /></a><br />This work by <a xmlns:cc="http://creativecommons.org/ns#" href="http://spyr.ch" property="cc:attributionName" rel="cc:attributionURL">Peter Schmid</a> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a>. ---++ Comments
This topic: MecrispCube
>
WebHome
>
QuadAlpha
Topic revision: r4 - 2024-12-19 - PeterSchmid
Copyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback