Pages: [1]   Go Down
Author Topic: School project (arrays)  (Read 485 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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             
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 290
Posts: 25770
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You need to figure out how to combine comparisons first.
(Hint: don't use commas)
Code:
if (value,value2,value3 == HIGH){
Logged

"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.

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 212
Posts: 13531
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


debouncing code can be found on the Arduino playground
Logged

Rob Tillaart

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

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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...
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Pages: [1]   Go Up
Jump to: