Page 1 of 1

using to switchs counting up and down on leds

Posted: Thu Dec 11, 2025 10:35 pm
by angel15
count 3 bit count when a switch button is on it counts up and when button is off counts down but also adding a another switch which counts up 4 bits when button is on and then when button is off it counts 4 bit down. I struggling with having the tw0 buttons when setting both buttons on one line,doing a 3 bit counter going up and down on the same button i can do and it works fine but copying that code underneath it just confusing the way the buttons work.This is the close i got to it working but it not counting up 4 bits when off it counting down 3 bit. Anyone can help?

Re: using to switchs counting up and down on leds

Posted: Fri Dec 12, 2025 9:17 am
by Steve-Matrix
You may need to explain what you are trying to achieve because I might be misunderstanding.

You seem to be saying there are 2 switches which work as follows:
  • Switch A on = count up 3 bits
  • Switch A off = count down 3 bits
  • Switch B on = count up 4 bits
  • Switch B off = count down 4 bits
But in this, what should happen when Switch A is on and Switch B is off (count up 3 bits or count down 4 bits - it can't do both)?

Also, what do you mean by "count 4 bit down", etc.?