OLD | NEW |
1 // Copyright (c) 2015, the Fletch 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 // Sample that runs on a Raspberry Pi 2 with the Sense HAT add-on board. | 5 // Sample that runs on a Raspberry Pi 2 with the Sense HAT add-on board. |
6 // See: https://www.raspberrypi.org/products/sense-hat/. | 6 // See: https://www.raspberrypi.org/products/sense-hat/. |
7 // | 7 // |
8 // The sample will indicate the current pitch and roll from the | 8 // The sample will indicate the current pitch and roll from the |
9 // accelerometer on the LED array as line segments. | 9 // accelerometer on the LED array as line segments. |
10 library sample.accelerometer; | 10 library sample.accelerometer; |
11 | 11 |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 for (int s = 0; s < 4; s++) { | 182 for (int s = 0; s < 4; s++) { |
183 for (Direction d in allDirections) { | 183 for (Direction d in allDirections) { |
184 drawSegment(hat.ledArray, d, s); | 184 drawSegment(hat.ledArray, d, s); |
185 } | 185 } |
186 os.sleep(200); | 186 os.sleep(200); |
187 for (Direction d in allDirections) { | 187 for (Direction d in allDirections) { |
188 drawSegment(hat.ledArray, d, s, color: Color.black); | 188 drawSegment(hat.ledArray, d, s, color: Color.black); |
189 } | 189 } |
190 } | 190 } |
191 } | 191 } |
OLD | NEW |