can anybody help? i want to confirm my selection by pressing a button. the selection is a number from my 7 seg display.... can anybody help....URGENTTTTTTTT!!!!!!
1- 7seg display shows number i want
2- press button to confirm selection of number
configure a pin as an input with internal pullup resistor enabled. Wire a button to connect the pin to ground.
After your display is set, read the button to see if it went low and go from there.
The button will go 010101010000 a few times (bounce) as you press it, and 10101011111 as you release it, so after you see it change give it a chance to settle before reading it again.
Or use the button library & have it take of debouncing for you.
sorry, im new at the arduino stuff, its for my assignment and so far most of what i have done is stuff from online reading....but its hard to find stuff about this...isit possible for more detailed help maybe something on a noob level? would be highly appreciated
It's not clear what you wanted. Will the number be changing while you get ready to push the button? You should post your assignment, what university and professor
Not getting it is different from not trying it. If you have some code, that is trying, if not, good luck.
the number can be changed using a potentiometer and once you have changed the number to the one you want, i want a button which will confirm the selection....which is also using a beep from a buzzer once it has been confirmed
can anybody help?
i have the potentiometer set with the 7seg display and it changes the numbers when i move it...
Sorry quake, after your first post I was convinced that you are just messing with us.
I would like to know, what is your experience level with writing codes, any kind? Just to know where these advices are leading you. Yep, I'm still learning my self C-language, but it is not just writing the code, it's more like thinking the whole or partial prosess in your mind before writing.
sorry for the late reply guys ive run out of internet at my uni halls....
well ive started uni, 1st year, not been able to go to much of the c programming lectures/lessons as i dnt stay well...so ive missd allot of stuff...but i understand the very basics.....and thats jus begining of C to be honest...
Hi Quake, I have a sneaky suspicion we might go to the same university. (I'm not going to say which for obvious reasons)
So, the code is quite simple. You need to first define your button at the top of the code as something like:
#define BUT 10 (I think they range from 10-13)
In your code you'll need to setup that button as an input which is done in the setup() function.
pinMode(BUT,INPUT);
In the loop() function you'll need to create a variable and then set it to digitalRead(BUT). Use this variable to check if the buttonState == LOW if is it call the game function.
quake:
the number can be changed using a potentiometer and once you have changed the number to the one you want, i want a button which will confirm the selection....which is also using a beep from a buzzer once it has been confirmed
can anybody help?
i have the potentiometer set with the 7seg display and it changes the numbers when i move it...