Hello everyone, I'm building with a group of friends a pinball machine. We are using an Arduino Leonardo, a Tinkerkit sensor shield connected with two light sensors and an LCD display shield. Basically I need help coding the Arduino board so that everytime the ball passes over a sensor, the display shows a higher score. In addition to this the other sensor will have to detect the ball for three times before resetting the score and bring it back to zero. Anyone who has any idea?
I have ideas enough, but your question is quite vague.
What is the problem you cannot solve? Is it sensor related, is it coding related, design? how to avoid delay() with millis() or counting to three, the reset, the display, ...?
unsigned int score = 0;
if (sensorHit())
{
score = score + 1;
if (score >= 3) score = 0;
}
lcd.print(score)
16x2 lcd ? you can use coomposite video out also for using old tv screen as a huge lcd ..llol
rob my question is about the general code. I've never coded but with your idea is great. i'll try to code using yours the starting point. thanks