You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
506 B
Plaintext
27 lines
506 B
Plaintext
open Arduinolib
|
|
|
|
node update_lcd<<period, ledMax : int; msg : string; line: int >>() returns ()
|
|
var i : int;
|
|
ledTime : int;
|
|
upt : bool;
|
|
downt : bool;
|
|
|
|
let
|
|
i = 0 fby (i+1);
|
|
ledTime = i % period;
|
|
upt = ledTime < ledMax;
|
|
downt = not upt;
|
|
|
|
() = lcd_string((msg, line) when upt);
|
|
() = lcd_string((".", line) when downt);
|
|
tel
|
|
|
|
node main() returns ()
|
|
let
|
|
() = dinit();
|
|
() = lcd_init();
|
|
() = update_lcd<<6, 4, "Hello", 0>>();
|
|
() = update_lcd<<10, 5, "Hi", 1>>();
|
|
tel
|
|
|