OLD | NEW |
1 // Copyright (c) 2016, the Fletch project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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/fletch-archive/images/knight-rider.mp4 |
10 // | 10 // |
11 // TODO: Add a schematics. | 11 // TODO: Add a schematics. |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 } | 76 } |
77 } | 77 } |
78 | 78 |
79 // Sets LED [ledToEnable] to true, and all others to false. | 79 // Sets LED [ledToEnable] to true, and all others to false. |
80 void _setLeds(int ledToEnable) { | 80 void _setLeds(int ledToEnable) { |
81 for (int i = 0; i < gpioPins.length; i++) { | 81 for (int i = 0; i < gpioPins.length; i++) { |
82 gpioPins[i].state = (i == ledToEnable); | 82 gpioPins[i].state = (i == ledToEnable); |
83 } | 83 } |
84 } | 84 } |
85 } | 85 } |
OLD | NEW |