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

Side by Side Diff: pkg/raspberry_pi/lib/sense_hat.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 | « pkg/raspberry_pi/lib/raspberry_pi.dart ('k') | pkg/socket/lib/socket.dart » ('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 /// API for accessing the devices on the Raspberry Pi Sense HAT add-on board. 5 /// API for accessing the devices on the Raspberry Pi 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 /// Currently this has only been tested with a Raspberry Pi 2 and the Sense HAT. 8 /// Currently this has only been tested with a Raspberry Pi 2 and the Sense HAT.
9 /// 9 ///
10 /// The following sample code show how to access the devices on the Raspberry Pi 10 /// The following sample code show how to access the devices on the Raspberry Pi
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 /// var temp = hat.readTemperature(); 42 /// var temp = hat.readTemperature();
43 /// var humidity = hat.readHumidity(); 43 /// var humidity = hat.readHumidity();
44 /// var pressure = hat.readPressure(); 44 /// var pressure = hat.readPressure();
45 /// var accel = hat.readAccel(); 45 /// var accel = hat.readAccel();
46 /// print('${accel.pitch} ${accel.roll} $temp $humidity $pressure'); 46 /// print('${accel.pitch} ${accel.roll} $temp $humidity $pressure');
47 /// } 47 /// }
48 /// } 48 /// }
49 /// ``` 49 /// ```
50 library raspberry_pi.sense_hat; 50 library raspberry_pi.sense_hat;
51 51
52 import 'dart:fletch.ffi'; 52 import 'dart:dartino.ffi';
53 53
54 import 'package:i2c/i2c.dart'; 54 import 'package:i2c/i2c.dart';
55 import 'package:i2c/devices/hts221.dart'; 55 import 'package:i2c/devices/hts221.dart';
56 import 'package:i2c/devices/lps25h.dart'; 56 import 'package:i2c/devices/lps25h.dart';
57 import 'package:i2c/devices/lsm9ds1.dart'; 57 import 'package:i2c/devices/lsm9ds1.dart';
58 58
59 // Foreign functions used. 59 // Foreign functions used.
60 final ForeignFunction _open = ForeignLibrary.main.lookup('open'); 60 final ForeignFunction _open = ForeignLibrary.main.lookup('open');
61 final ForeignFunction _mmap = ForeignLibrary.main.lookup('mmap'); 61 final ForeignFunction _mmap = ForeignLibrary.main.lookup('mmap');
62 62
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 220
221 /// Read the current gyroscope measurement. 221 /// Read the current gyroscope measurement.
222 GyroMeasurement readGyro() => _lsm9ds1.readGyro(); 222 GyroMeasurement readGyro() => _lsm9ds1.readGyro();
223 223
224 /// Read the current accelerometer measurement. 224 /// Read the current accelerometer measurement.
225 AccelMeasurement readAccel() => _lsm9ds1.readAccel(); 225 AccelMeasurement readAccel() => _lsm9ds1.readAccel();
226 226
227 /// Read the current magnetometer measurement. 227 /// Read the current magnetometer measurement.
228 MagnetMeasurement readMagnet() => _lsm9ds1.readMagnet(); 228 MagnetMeasurement readMagnet() => _lsm9ds1.readMagnet();
229 } 229 }
OLDNEW
« no previous file with comments | « pkg/raspberry_pi/lib/raspberry_pi.dart ('k') | pkg/socket/lib/socket.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698