Working laser maze comparator. Solar cells need to be connected with ground and the +ve line connected to A0 - A4. These correspond to the output on D6-D2 respectively. Reseting the nucleo takes a base reading of the solar cells. This base reading is used, along with the #define OFFSET value to either output a 0 or a 1 if the solar cell value is over the first reading + offset.
Diff: main.cpp
- Revision:
- 1:59475336cb66
- Parent:
- 0:465fb31c5651
- Child:
- 2:87c34bb330c2
--- a/main.cpp Mon Jan 08 18:11:30 2018 +0000 +++ b/main.cpp Mon Jan 08 18:19:51 2018 +0000 @@ -17,11 +17,11 @@ AnalogIn ainChannels[CHANNEL_COUNT] = {Ain0, Ain1, Ain2, Ain3, Ain4}; //digital out channels for signaling to pi -DigitalOut Dout0(D2); -DigitalOut Dout1(D3); +DigitalOut Dout0(D6); +DigitalOut Dout1(D5); DigitalOut Dout2(D4); -DigitalOut Dout3(D5); -DigitalOut Dout4(D6); +DigitalOut Dout3(D3); +DigitalOut Dout4(D2); //array of digital channels DigitalOut doutChannels[CHANNEL_COUNT] = {Dout0, Dout1, Dout2, Dout3, Dout4};