Close

Testing The Tile Holder Buttons

A project log for MacroPad With Tile Buttons

As a quick follow-up to my “A Tile Based MacroPad” I present an alternative.

michael-gardiMichael Gardi 10/11/2023 at 00:590 Comments

Before I start soldering in the tile holder buttons I want to make sure that they are working as expected. So I setup a pro Micro with a little wiring harness and a simple sketch to test both of the sensors.  Here is the tile holder button that I just made wired for testing.

The sketch is very straight forward.

int sensorPin0 = A0;   // Hell Effect 0.
int sensorPin1 = A0;   // Hell Effect 1.

int sensorValue = 0;  // variable to store the value coming from the sensor

void setup() {
  // Setup serial output.
  Serial.begin(115200);
  while (!Serial) {
    delay(1000);
  }
  Serial.println("Test Tile Button!");
}

void loop() {
  // Read the value from the first sensor.
  sensorValue = analogRead(sensorPin0);
  Serial.print(sensorValue);
  Serial.print(" ");
  // Read the value from the second sensor.
  sensorValue = analogRead(sensorPin1);
  Serial.println(sensorValue);
  delay(1000);
}

It just emits the readings from both sensors once a second to the serial monitor.

I started it with no tile, then dropped a [0-0] tile in. You can see the change in readings indication all is well with this button.  Next. 

Discussions