![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Use a touchscreen display to select which sensor measurement to display
Dependencies: mbed DisplayModule24_demo_day10
main.cpp@2:1ab4c19b99d4, 2017-01-17 (annotated)
- Committer:
- ldelaney17
- Date:
- Tue Jan 17 18:56:56 2017 +0000
- Revision:
- 2:1ab4c19b99d4
- Parent:
- 1:f2a5ea8ff543
- Child:
- 3:4cd5469a146f
Add functions to get the average of n readings from the accelerometer. Set n to default to 5. ; ; Added comments to acc.h
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ldelaney17 | 0:b1840c1fbeb8 | 1 | #include "mbed.h" |
ldelaney17 | 1:f2a5ea8ff543 | 2 | #include "acc.h" |
ldelaney17 | 0:b1840c1fbeb8 | 3 | DigitalOut myled(LED1); |
ldelaney17 | 1:f2a5ea8ff543 | 4 | I2C connection(p9, p10); |
ldelaney17 | 1:f2a5ea8ff543 | 5 | Serial pc(USBTX, USBRX); |
ldelaney17 | 2:1ab4c19b99d4 | 6 | |
ldelaney17 | 0:b1840c1fbeb8 | 7 | int main() { |
ldelaney17 | 0:b1840c1fbeb8 | 8 | while(1) { |
ldelaney17 | 2:1ab4c19b99d4 | 9 | get_avg_mag(); |
ldelaney17 | 1:f2a5ea8ff543 | 10 | wait(0.5); |
ldelaney17 | 0:b1840c1fbeb8 | 11 | } |
ldelaney17 | 0:b1840c1fbeb8 | 12 | } |
ldelaney17 | 2:1ab4c19b99d4 | 13 | |
ldelaney17 | 2:1ab4c19b99d4 | 14 |