@runaway_pancake @johnwasser @Grumpy_Mike @blh64
Thanks guys!
Going to go...
BRB.
Edit: When I uploaded the code from @blh64 the light turned on but at the other end of the column. Guess that rules out the LED matrix??? The problem light that's on still represents the same square on my chessboard (squareH1 or pin13) So I decided to shift some pins around to rule out the potential serial port problems (pin1&2). I shifted those down and it didn't help. Then I moved pin13 to see if the on board MegaLED was interfering. I moved it to Pin 18 (which was now available due to the previous shift of pins.
It works!
To sum up, pin13 was the culprit. I don't know why, and that bothers me. Here is the final code with updated pin locations. Any ideas why pin 13 would light up with & without a magnet? I did read the voltage at the sensor before moving the hall sensor to pin18 and it read -2V. Thought that was weird.
Guess I should mention I wired everything to a shield because I assumed my soldering would be messy. It was ![]()
/* Include the LedControl library */
#include "LedControl.h"
// Create a LedControl for the first 8 devices...
LedControl lc1 = LedControl(19, 21, 20, 1);
const byte pins[] = {
6, 5, 38, 36, A7, A8, 37, 39, // A
7, 4, 40, 34, A6, A9, 35, 41, // B
8, 3, 42, 32, A5, A10, 33, 43, // C
9, 2, 44, 30, A4, A11, 31, 45, // D
10, 14, 46, 28, A3, A12, 29, 47, // E
11, 15, 48, 26, A2, A13, 27, 49, // F
12, 16, 50, 24, A1, A14, 25, 51, // G
18, 17, 52, 22, A0, A15, 23, 53, // H
};
const byte nPins = sizeof(pins) / sizeof(pins[0]);
void setup() {
// all pins are INPUT by default
for (int index = 0; index < lc1.getDeviceCount(); index++) {
lc1.shutdown(index, false);
}
}
void loop() {
for ( int i = 0; i < nPins; ++i ) {
int hallState = digitalRead( pins[i] );
int state = false;
int row = i / 8;
int col = i % 8;
if (hallState == LOW) {
state = true;
}
lc1.setLed(0, row, col, state);
}
}