From 8d4be06944866d6d8a2dddff16025f590b03765d Mon Sep 17 00:00:00 2001 From: Elena ``of Valhalla'' Grandi Date: Mon, 20 Feb 2017 20:14:38 +0100 Subject: Some slides --- code/002-button.js | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 code/002-button.js (limited to 'code/002-button.js') diff --git a/code/002-button.js b/code/002-button.js new file mode 100644 index 0000000..e98ace2 --- /dev/null +++ b/code/002-button.js @@ -0,0 +1,7 @@ +var on = false; +var change = function() { + on = !on; + LED1.write(on); + }; + +setWatch(change, BTN1, {repeat:true, edge:"rising"}); \ No newline at end of file -- cgit v1.2.3