Go Down

Topic: School project (arrays) (Read 549 times) previous topic - next topic

Olof90

Hi!

Me and a friend is currently working on a school project. The point is to answer three questions (three buttons) where each question has one right answer. After the task is completed (every question is answered) two servos shall begin to move and one led start to fade, depending on how many of the questions is answered correctly (one answer = one event).

So far we have used arrays to make this work. But it seems that the code needs a debounce function. Is there any one who have a solution to our problem or is there possibly another way?

Her are our codes:
http://codepad.org/2rw6yF0z
http://codepad.org/o3qj2U2h

Thanks in advance // Olof and Tim           

AWOL

You need to figure out how to combine comparisons first.
(Hint: don't use commas)
Code: [Select]
if (value,value2,value3 == HIGH){
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

robtillaart


debouncing code can be found on the Arduino playground
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

PaulS

Quote
Me and a friend is currently working on a school project.

Hopefully you are paying more attention in this class than in your grammar classes,

Quote
Her are our codes:

Or your spelling class...

ksan


Quote
Me and a friend is currently working on a school project.

Hopefully you are paying more attention in this class than in your grammar classes,

Quote
Her are our codes:

Or your spelling class...


Feel better? Nothing like a daily dose of adult internet scolding to put a teen off from these forums... Ever wonder whether English might not even be his first language? Take a hint... Olof... Met any Olof's recently in Seattle?

Go Up