Push Button
whitelancer
Posts: 23
To anyone that can help,
I want to have my code run only when a button on the starter kit breadboard is pressed and then stop when it is pressed again. I was wondering what code and setup would be needed to complete this idea. Thank you for any help.
Sincerely,
I want to have my code run only when a button on the starter kit breadboard is pressed and then stop when it is pressed again. I was wondering what code and setup would be needed to complete this idea. Thank you for any help.
Sincerely,
Comments
regards peter
I appreciate all of the help. I was hoping someone could explain the wiring on the breadboard to make a button work with the posted program. Thanks.
Sincerely,
Connect a normally open button between GND and javelin I/O pin 0.
regards peter
Connection VDD is the +5V. The demoboard
is described in the manual.
regards peter
Sincerely,
·
You will get better responses·if you attached your entire program and a detailed
description of your hardware setup.
regards peter
while (!isButtonPressed(1))
by
while (!isButtonPressed(CPU.pin1))
Change isButtonPressed by
··· private static boolean isButtonPressed( int pinNumber ) {
······· return !CPU.readPin(pinNumber); //return true if pin low (eg. button pressed)
··· }
regards peter
Sincerely,
that is the pin used in the Uart declaration.
Make sure the javelin GND is connected to the servo board GND.
regards peter
Sincerely,
Jon