Red Light Work
Fork of realtimeMMLib by
MBedStation.cpp@0:9f82ee1feae7, 2017-10-02 (annotated)
- Committer:
- GTNicholson
- Date:
- Mon Oct 02 11:18:47 2017 +0000
- Revision:
- 0:9f82ee1feae7
- Child:
- 1:b80e5f26b233
Initial Publish Version
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
GTNicholson | 0:9f82ee1feae7 | 1 | |
GTNicholson | 0:9f82ee1feae7 | 2 | #include "MBedStation.h" |
GTNicholson | 0:9f82ee1feae7 | 3 | #include "sensor_base.h" |
GTNicholson | 0:9f82ee1feae7 | 4 | #include "qeihw.h" |
GTNicholson | 0:9f82ee1feae7 | 5 | #include <cstdint> |
GTNicholson | 0:9f82ee1feae7 | 6 | |
GTNicholson | 0:9f82ee1feae7 | 7 | |
GTNicholson | 0:9f82ee1feae7 | 8 | MBedStation::MBedStation() |
GTNicholson | 0:9f82ee1feae7 | 9 | { |
GTNicholson | 0:9f82ee1feae7 | 10 | |
GTNicholson | 0:9f82ee1feae7 | 11 | } |
GTNicholson | 0:9f82ee1feae7 | 12 | |
GTNicholson | 0:9f82ee1feae7 | 13 | //sensor_base MBed::sensors[1] |
GTNicholson | 0:9f82ee1feae7 | 14 | |
GTNicholson | 0:9f82ee1feae7 | 15 | void MBedStation::setup() |
GTNicholson | 0:9f82ee1feae7 | 16 | { |
GTNicholson | 0:9f82ee1feae7 | 17 | |
GTNicholson | 0:9f82ee1feae7 | 18 | sensor_onoff sensor0(p5); |
GTNicholson | 0:9f82ee1feae7 | 19 | sensor0.sensor_id = 1; |
GTNicholson | 0:9f82ee1feae7 | 20 | sensor0.enabled = true; |
GTNicholson | 0:9f82ee1feae7 | 21 | MBedStation::sensors[0] = sensor0; |
GTNicholson | 0:9f82ee1feae7 | 22 | sensor_0 = sensor0; |
GTNicholson | 0:9f82ee1feae7 | 23 | |
GTNicholson | 0:9f82ee1feae7 | 24 | sensor_vin sensor1(p15); |
GTNicholson | 0:9f82ee1feae7 | 25 | sensor1.sensor_id = 2; |
GTNicholson | 0:9f82ee1feae7 | 26 | sensor1.enabled = true; |
GTNicholson | 0:9f82ee1feae7 | 27 | MBedStation::sensors[1] = sensor1; |
GTNicholson | 0:9f82ee1feae7 | 28 | sensor_1 = sensor1; |
GTNicholson | 0:9f82ee1feae7 | 29 | |
GTNicholson | 0:9f82ee1feae7 | 30 | sensor_vin sensor2(p16); |
GTNicholson | 0:9f82ee1feae7 | 31 | sensor2.sensor_id = 3; |
GTNicholson | 0:9f82ee1feae7 | 32 | sensor2.enabled = true; |
GTNicholson | 0:9f82ee1feae7 | 33 | MBedStation::sensors[2] = sensor2; |
GTNicholson | 0:9f82ee1feae7 | 34 | sensor_2 = sensor2; |
GTNicholson | 0:9f82ee1feae7 | 35 | |
GTNicholson | 0:9f82ee1feae7 | 36 | /* |
GTNicholson | 0:9f82ee1feae7 | 37 | sensor_pulse sensor3(p6); |
GTNicholson | 0:9f82ee1feae7 | 38 | sensor3.sensor_id = 4; |
GTNicholson | 0:9f82ee1feae7 | 39 | sensor3.enabled = true; |
GTNicholson | 0:9f82ee1feae7 | 40 | MBedStation::sensors[3] = sensor3; |
GTNicholson | 0:9f82ee1feae7 | 41 | sensor_3 = sensor3; |
GTNicholson | 0:9f82ee1feae7 | 42 | */ |
GTNicholson | 0:9f82ee1feae7 | 43 | } |