I have couple of ideas for fabacademy final project ideas.
ABOVE ARE SOME OF THE IDEAS I BRAINSTORMED. I REALLY LIKE THE IDEA THAT CAME UP WITH THE FORTURE TELLER THAT "HELP MAKERS IDEATE".SO I AM THINKING ABOUT MAKING A SLOT MACHINE THAT HELP TO IDEATE. yetch made by laura kampf is really inspiring for this idea.
sample circuit i made using ciruit.io
i am brainstoring about what all options i can give the dials.
why can't i add a clock with it. so this could be. a slot machine and clock at the same time.
so i have to drill the magnets out and refill it.
// Define the pin for the hall effect sensor
const int hallEffectPin = 31;
// Variable to store the count of magnet detections
int magnetCount = 0;
// Flag to track whether the sensor was already triggered
bool sensorTriggered = false;
void setup() {
// Initialize serial communication
Serial.begin(9600);
// Set the hall effect sensor pin as input
pinMode(hallEffectPin, INPUT);
}
void loop() {
// Read the state of the hall effect sensor
int sensorState = digitalRead(hallEffectPin);
// If the sensor detects a magnet (LOW state) and it wasn't triggered before
if (sensorState == LOW && !sensorTriggered) {
// Increment the magnet count
magnetCount++;
// Print the current magnet count
Serial.print("Magnet detected! Count: ");
Serial.println(magnetCount);
// Set the sensor triggered flag to true
sensorTriggered = true;
}
// If the sensor is not detecting a magnet (HIGH state)
// reset the sensor triggered flag to false
if (sensorState == HIGH) {
sensorTriggered = false;
}
// // A short delay to prevent rapid counting due to sensor noise
// delay(100);
}
the code