Show Posts
|
|
Pages: [1] 2
|
|
6
|
Using Arduino / Project Guidance / Re: analog input issuses
|
on: December 28, 2012, 09:01:14 am
|
|
i loaded the sketch and all buttons work. cept the start button. so i changed the sketches buttons allocations, so changed the start and up around. same story. what used to be the start buttons works now to increase the values, but it still wont start when you press the new start button
hope that makes sense
|
|
|
|
|
9
|
Using Arduino / Project Guidance / Re: analog input issuses
|
on: December 23, 2012, 11:13:24 am
|
|
hey guys thanks for the advice i did the serialwrite thing to check if its picking up the inputs. and when i run the simple sketch it picks up all the buttons . but when i put the end cct together it will not pick up the start stop button. but picks up all the others? any ideas?
|
|
|
|
|
15
|
Using Arduino / Project Guidance / Re: analog input issuses
|
on: December 11, 2012, 02:36:09 pm
|
|
second half
//function to check the state of the up button and increment interval accordingly. void checkUp(){ upReading = digitalRead(upPin); if (upReading == HIGH && prevUpReading == LOW && millis() - pressUpTime > debounceDelay){ activityTime = millis(); if (changeNumPics){ if (numPics >= 9950){ //allows variable to wrap around. numPics = 0; } else{ numPics += 50; numPicsChanged = millis(); } } else{ if (interval >= 999){ interval = 0; } else{ interval += 1; } } pressUpTime = millis(); } prevUpReading = upReading; }
//function to check the state of the down button and increment interval accordingly. void checkDown(){ downReading = digitalRead(downPin); if (downReading == HIGH && prevDownReading == LOW && millis() - pressDownTime > debounceDelay){ activityTime = millis(); if (changeNumPics){ if (numPics <= 0){ //allows variable to wrap around. numPics = 9950; } else{ numPics -= 50; numPicsChanged = millis(); } } else{ if (interval <= 0){ interval = 999; } else{ interval -= 1; } } pressDownTime = millis(); } prevDownReading = downReading; }
//function to display a 3 digit number on 7-segment displays. void displayDEC(int i){ for (byte bitMask = 128; bitMask > 0; bitMask >>= 1){ digitalWrite(clockPin, LOW); digitalWrite(serialOnesPin, bitMask & ~digits[i%10] ? HIGH : LOW); digitalWrite(serialTensPin, bitMask & ~digits[(i/10%10)] ? HIGH : LOW); digitalWrite(serialHundsPin, bitMask & ~digits[i/100] ? HIGH : LOW); digitalWrite(clockPin, HIGH); } }
//function to display "inf" on 3 7-segment displays. void displayINF(){ for (byte bitMask = 128; bitMask > 0; bitMask >>= 1){ digitalWrite(clockPin, LOW); digitalWrite(serialOnesPin, bitMask & ~inf[2] ? HIGH : LOW); digitalWrite(serialTensPin, bitMask & ~inf[1] ? HIGH : LOW); digitalWrite(serialHundsPin, bitMask & ~inf[0] ? HIGH : LOW); digitalWrite(clockPin, HIGH); } }
void displayPIC(){ for (byte bitMask = 128; bitMask > 0; bitMask >>= 1){ digitalWrite(clockPin, LOW); digitalWrite(serialOnesPin, bitMask & ~pic[2] ? HIGH : LOW); digitalWrite(serialTensPin, bitMask & ~pic[1] ? HIGH : LOW); digitalWrite(serialHundsPin, bitMask & ~pic[0] ? HIGH : LOW); digitalWrite(clockPin, HIGH); } } void displayINT(){ for (byte bitMask = 128; bitMask > 0; bitMask >>= 1){ digitalWrite(clockPin, LOW); digitalWrite(serialOnesPin, bitMask & ~intvl[2] ? HIGH : LOW); digitalWrite(serialTensPin, bitMask & ~intvl[1] ? HIGH : LOW); digitalWrite(serialHundsPin, bitMask & ~intvl[0] ? HIGH : LOW); digitalWrite(clockPin, HIGH); } } void displayOFF(){ for (byte bitMask = 128; bitMask > 0; bitMask >>= 1){ digitalWrite(clockPin, LOW); digitalWrite(serialOnesPin, HIGH); digitalWrite(serialTensPin, HIGH); digitalWrite(serialHundsPin, HIGH); digitalWrite(clockPin, HIGH); } } ///////////////////////////////////////////[
|
|
|
|
|