forked from lwpmoon/DemoSatSpring2017_Netduino_OnboardSD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BNOCalibUpdate.cs
38 lines (33 loc) · 1.26 KB
/
BNOCalibUpdate.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using System.Threading;
using DemoSatSpring2017Netduino_OnboardSD.Drivers;
using DemoSatSpring2017Netduino_OnboardSD.Flight_Computer;
using DemoSatSpring2017Netduino_OnboardSD.Work_Items;
//using MicroLiquidCrystal;
using Microsoft.SPOT;
namespace DemoSatSpring2017Netduino_OnboardSD {
public class BNOCalibUpdate {
private readonly SerialBno _bno;
private readonly int _delay;
private readonly WorkItem _workItem;
private readonly byte[] _dataArray = new []{(byte)0};
//private readonly Lcd _lcd;
public BNOCalibUpdate(SerialBno bno, int delay) {
//_lcd = lcd;
_bno = bno;
_delay = delay;
_workItem = new WorkItem(UpdateCalib, ref _dataArray, loggable:false, persistent:true, pauseable:true);
}
private void UpdateCalib() {
var time = Clock.Instance.ElapsedMilliseconds/1000;
var test = _bno.GetCalibration();
//_lcd.Clear();
//_lcd.Write("S:" + test[0] + " G:" + test[1] + " A:" + test[2] + " M:" + test[3]);
//_lcd.SetCursorPosition(0,1);
//_lcd.Write("T+ " + time + " s");
Thread.Sleep(_delay);
}
public void Start() {
_workItem.Start();
}
}
}