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

Unified Diff: samples/raspberry_pi/basic/buzzer.dart

Issue 1389573002: Refactor Raspberry Pi GPIO and add GPIO mock (Closed) Base URL: git@github.com:dart-lang/fletch.git@master
Patch Set: Fixed come commetns Created 5 years, 2 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: samples/raspberry_pi/basic/buzzer.dart
diff --git a/samples/raspberry_pi/basic/buzzer.dart b/samples/raspberry_pi/basic/buzzer.dart
index 7db8aa3f5565b313d8a35eaa8df74a84eb79f06f..24dc3481d4598c9a2bfed3335ad7121df0bebb74 100644
--- a/samples/raspberry_pi/basic/buzzer.dart
+++ b/samples/raspberry_pi/basic/buzzer.dart
@@ -8,14 +8,16 @@
// https://storage.googleapis.com/fletch-archive/images/buzzer-schematic.png
import 'package:gpio/gpio.dart';
+import 'package:raspberry_pi/raspberry_pi.dart';
main() {
// GPIO pin constants.
const int button = 16;
const int speaker = 21;
- // Initialize GPIO and configure the pins.
- PiMemoryMappedGPIO gpio = new PiMemoryMappedGPIO();
+ // Initialize Raspberry Pi and configure the pins.
+ RaspberryPi pi = new RaspberryPi();
+ PiMemoryMappedGPIO gpio = pi.memoryMappedGPIO;
gpio.setMode(button, Mode.input);
gpio.setMode(speaker, Mode.output);

Powered by Google App Engine
This is Rietveld 408576698