Tiny Arcade With Mini (ANTI MISSILE ROBOT _part 3)
by David_Lin in Circuits > Arduino
537 Views, 1 Favorites, 0 Comments
Tiny Arcade With Mini (ANTI MISSILE ROBOT _part 3)
A video game !
the water-rocket robot is a player who playing against with arduino mini !
Metrial
Connecting Heart and Every Part of the Robot
when the IIC displayer is working OK now,
#include LiquidCrystal_I2C.h
LiquidCrystal_I2C lcd(0x27,2,1,0,4,5,6,7,3,POSITIVE);
then replace and may remove the IIC interface and
update the program with:
#include LiquidCrystal.h
LiquidCrystal lcd(11, 9, 6, 5, 4, 3);
Embedding It Into a Cardboard Box
i placed a piece of wood thin board as the button table.
and i placed another piece of thin board to integrate
the mini and the lcd displayer as one single panel !
and i soldering the mini and the button and the displayer
......all together.
final, i embed them into a small cardboard box.
Coding
maybe there are someone wanna to know
how does it work?
i use the INT 0 (PIN 2) to pick the button signal,
attachInterrupt(0/*PIN_BUTTON*/, buttonPush, FALLING);
when it is falling to low(pressed)
then call ISR named buttonPush.
and because the sounds is extra-slow than light
300M/s .vs. 30000000M/s
so i use play melody first then draw the animate to sync.
mute = 1;
and i use mute to control the demo mode when user do not press the button,
it will automatic mute after user turn the power on.
and i use
delay(20);
in order to avoid the delay time to zero,
because 1/0 = divided by zero(error).
and then i use
delay(100-(distance/10));
for automatic speed controlling.
since the delay going to fewer
therefor the more the distance the more the speed ! !
upload the program and play now !
HAVE FUN !!
Test Drive
the more the scores(distance) the more the speed ! !
Coding
i use the INT 0 (PIN 2) to pick the button signal,
attachInterrupt(0/*PIN_BUTTON*/, buttonPush, FALLING);
when it is falling to low(pressed) then call ISR named buttonPush.
and because sound is extra-slow than light
300M/s .vs. 30000000M/s
so i use play melody first then draw the animate to sync.
mute = 1;
and i use mute to control the demo mode
when user do not press the button, it will
automatic mute after user turn the power on.
and i use
delay(20);
in order to avoid the delay time to zero,
because 1/0 = divided by zero(error).
and then i use
delay(100-(distance/10));
for automatic speed controlling.
since the delay going to fewer,
the more the distance the more the speed ! !
upload the program and play now !
HAVE FUN !!