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

Side by Side Diff: samples/raspberry-pi2/basic/knight-rider.dart

Issue 1659163007: Rename fletch -> dartino (Closed) Base URL: https://github.com/dartino/sdk.git@master
Patch Set: address comments 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 unified diff | Download patch
« no previous file with comments | « samples/raspberry-pi2/basic/door-bell.dart ('k') | samples/samples.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE.md file. 3 // BSD-style license that can be found in the LICENSE.md file.
4 // 4 //
5 // Remember those red running lights KITT had in Knight Rider? 5 // Remember those red running lights KITT had in Knight Rider?
6 // https://www.youtube.com/watch?v=Mo8Qls0HnWo 6 // https://www.youtube.com/watch?v=Mo8Qls0HnWo
7 // 7 //
8 // This sample recreates those with a chain of LEDs running right and left: 8 // This sample recreates those with a chain of LEDs running right and left:
9 // https://storage.googleapis.com/fletch-archive/images/knight-rider.mp4 9 // https://storage.googleapis.com/dartino-archive/images/knight-rider.mp4
10 // 10 //
11 // For breadboard layout and connections to the Pi, see: 11 // For breadboard layout and connections to the Pi, see:
12 // https://storage.googleapis.com/fletch-archive/images/k-r-schematic.png 12 // https://storage.googleapis.com/dartino-archive/images/k-r-schematic.png
13 13
14 import 'package:gpio/gpio.dart'; 14 import 'package:gpio/gpio.dart';
15 import 'package:raspberry_pi/raspberry_pi.dart'; 15 import 'package:raspberry_pi/raspberry_pi.dart';
16 import 'package:os/os.dart'; 16 import 'package:os/os.dart';
17 17
18 main() { 18 main() {
19 // Initialize Raspberry Pi. 19 // Initialize Raspberry Pi.
20 RaspberryPi pi = new RaspberryPi(); 20 RaspberryPi pi = new RaspberryPi();
21 21
22 // Array constant containing the GPIO pins of the connected LEDs. 22 // Array constant containing the GPIO pins of the connected LEDs.
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 } 67 }
68 68
69 // Sets LED [ledToEnable] to true, and all others to false. 69 // Sets LED [ledToEnable] to true, and all others to false.
70 void _setLeds(int ledToEnable) { 70 void _setLeds(int ledToEnable) {
71 for (int i = 0; i < leds.length; i++) { 71 for (int i = 0; i < leds.length; i++) {
72 bool state = (i == ledToEnable); 72 bool state = (i == ledToEnable);
73 _gpio.setPin(leds[i], state); 73 _gpio.setPin(leds[i], state);
74 } 74 }
75 } 75 }
76 } 76 }
OLDNEW
« no previous file with comments | « samples/raspberry-pi2/basic/door-bell.dart ('k') | samples/samples.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698