This Arduino library provides the code running on the board's microcontroller.
Clone this repo into YOUR_ARDUINO_FOLDER/libraries/.
If you're just interested in using the board with a script or the app, you'll want
to run the serial_binboard sketch from the library's examples folder.
Each photoresistor requires a threshold value which triggers when each square is occupied or not. There are two options you can use to set the threshold values for each square.
By default, Liboard is configured to use the Global threshold mode. If you want to change it Per-Square thresholds, then edit the following variable:
// !!! choose mode: 1 = global single value, 0 = per-square array !!!
#define USE_GLOBAL_THRESHOLD 1Global Threshold mode applies the same threshold value to every photoresistor. If you need to change the sensitivity of the photoresistors, change the value of this variable:
// Option 1 - Global Threshold (Applies to all photoresistors)
unsigned short THRESHOLD = 100;You can also set individual thresholds for each photoresisor. This is useful if not all your photoresistors are the same type. Per-square thresholds also has more accuracy. You can adjust each square threshold individually by editing each number.
// Option 2 - Per-square threshold (Applies to each individual photoresistor)
unsigned short THRESHOLD[64] = {
// A1..H1
150, 150, 150, 150, 150, 150, 150, 150,
// A2..H2
150, 150, 150, 150, 150, 150, 150, 150,
// A3..H3
100, 100, 100, 100, 100, 100, 100, 100,
// A4..H4
100, 100, 100, 100, 100, 100, 100, 100,
// A5..H5
600, 600, 600, 600, 600, 600, 600, 600,
// A6..H6
600, 600, 600, 600, 600, 600, 600, 600,
// A7..H7
300, 300, 300, 300, 300, 300, 300, 300,
// A8..H8
300, 300, 300, 300, 300, 300, 300, 300
};