EveryCircuit
Contact
Reviews
Home
CoolBots
modified 7 years ago

Reed switch matrix scan simulation

9
0
420
05:22:14
Simple reed switch matrix scan simulator for a 3x3 matrix board, such as a magnetic Tic-Tac-Toe game board. The LEDs are both visual indicators of the selected cells, and diodes to prevent "ghosting". Columns are set to INPUT_PULLUP, so the corresponding pins read HIGH, as indicated by 3 top logic source buttons. Rows are initially OUTPUT HIGH, but are pulled LOW during the scan, one by one. This is accomplished by the 3 side logic train buttons, set to 33% pulse width, with 0%, 33.3% and 66.7% delay, top to bottom. On an Arduino, this can be done with a nested for-loop, presuming a rows[] and columns[] arrays are configured with corresponding pins, and the pins are properly initialized: for (int row = 0; row < 3; row++) { // Pull the row LOW to test it digitalWrite(rows[row], LOW); // Scan each column at this row for(int col = 0; col < 3; col++) { // LOW pins are ON at [row, col] bool isOn = digitalRead(columns[col]) == LOW; } // Pull the row HIGH to test the next row digitalWrite(rows[row], HIGH); } To simulate a magnet placed on the board, close the SPST switch next to the corresponding LED. To remove the magnet, open the switch.
published 7 years ago

EveryCircuit is an easy to use, highly interactive circuit simulator and schematic capture tool. Real-time circuit simulation, interactivity, and dynamic visualization make it a must have application for professionals and academia. EveryCircuit user community has collaboratively created the largest searchable library of circuit designs. EveryCircuit app runs online in popular browsers and on mobile phones and tablets, enabling you to capture design ideas and learn electronics on the go.

Copyright © 2026 by MuseMaze, Inc.     Terms of use     Privacy policy