A program for the BBC MicroBit that displays temperature and compass headings.
Revision 5:2314ad5e8997, committed 2016-07-25
- Comitter:
- daw9000
- Date:
- Mon Jul 25 15:21:22 2016 +0000
- Parent:
- 4:9146469c80cd
- Child:
- 6:68e29cbd2696
- Commit message:
- self calibrate thermometer first..
Changed in this revision
source/main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/source/main.cpp Mon Jul 25 15:11:06 2016 +0000 +++ b/source/main.cpp Mon Jul 25 15:21:22 2016 +0000 @@ -219,7 +219,9 @@ uBit.io.P0.isTouched(); uBit.io.P1.isTouched(); uBit.io.P2.isTouched(); - + // initialise the thermometer + int iTemp = uBit.thermometer.getTemperature(); + uBit.thermometer.setCalibration(iTemp); while (true) { if ( (not(uBit.io.P0.isTouched())) and (not(uBit.io.P1.isTouched())) and (not (uBit.io.P2.isTouched())) )