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.

41 lines
735 B
Plaintext

open Arduinolib
node lcd_blink_msg (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 lcd_counter (period:int; line: int) returns ()
var count : int;
let
count = 0 fby (count + 1);
() = lcd_int(count/period, line);
tel
node button (bpin, ledpin : int) returns ()
var value : int;
i : int;
let
i = 0 fby (i+1);
value = dread(bpin);
() = dwrite((ledpin, value));
tel
node main() returns ()
let
() = button (8, 13);
tel