Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Unified Diff: dart/examples/led/led.dart

Issue 1684433003: Add a small LED interface and demo app. (Closed) Base URL: git@github.com:domokit/sod.git@master
Patch Set: added comment Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: dart/examples/led/led.dart
diff --git a/dart/examples/led/led.dart b/dart/examples/led/led.dart
new file mode 100644
index 0000000000000000000000000000000000000000..c122e676da5d3840920fe1cac49fc940783fe3ba
--- /dev/null
+++ b/dart/examples/led/led.dart
@@ -0,0 +1,16 @@
+// Copyright (c) 2016, the Dartino project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE.md file.
+
+import "dart:dartino";
+import "dart:async";
+import "package:lk/leds.dart";
+
+void main() {
+ // Start up some timers. Note that timers in dartino are based on fibers,
+ // so even though the main fiber ends, the timers will keep running.
+ new Timer.periodic(const Duration(milliseconds: 50), (_) => LED0.toggle());
+ new Timer.periodic(const Duration(milliseconds: 100), (_) => LED1.toggle());
+ new Timer.periodic(const Duration(milliseconds: 75), (_) => LED2.toggle());
+ new Timer.periodic(const Duration(milliseconds: 333), (_) => LED3.toggle());
+}
« no previous file with comments | « app/dartino/rules.mk ('k') | dart/pkg/lk/lib/leds.dart » ('j') | dart/pkg/lk/lib/leds.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698