Hi, I have two working sketches, they share inputs and output pin outs on the UNO. What I am trying to figure out is how to using a normally open button switch from one sketch to the other. Any direction on how to do this would be much appreciated.
I have placed the sketches as attachments due to length limitations.
I had planed on using a NO button on A2 as it is unassigned.
Thanks, will give it a look/try. One thing off the bat is the Resolve any dual use of hardware resources..both sketches use the same pin outs, or will that be resolved in the loops?
Yeah, you'll need to change which pins are used for the functionality coming from one of the sketches. That's what "Resolve any dual use of hardware resources" means
DrAzzy:
Yeah, you'll need to change which pins are used for the functionality coming from one of the sketches. That's what "Resolve any dual use of hardware resources" means
Ouch as I am maxed out as far as pins go, I might be screwed. I guess I could just use two Uno's and have the switch power up one or the other.
One thing off the bat is the Resolve any dual use of hardware resources..both sketches use the same pin outs,
If they use the same pins to talk to the same hardware then that is fine. If it is different hardware on the same pins then you have to add extra pins.
Ouch as I am maxed out as far as pins go,
No you just add as many port expanders as you need.
The MCP23S17 - gives you 16 I/O pins on the SPI bus or the MCP23017 gives you the same on the I2C bus.
Grumpy_Mike:
If they use the same pins to talk to the same hardware then that is fine. If it is different hardware on the same pins then you have to add extra pins.
No you just add as many port expanders as you need.
The MCP23S17 - gives you 16 I/O pins on the SPI bus or the MCP23017 gives you the same on the I2C bus.
gotcha, these two programs in reality are just two sets of different count down timers. The input and out put the same so only the button function and timers differ. I was wondering if I could do this using "cases" where the switch on A2 changes the cases.
Never use switch-case instead of if-else-if unless you have a good reason - switch-case code is harder to debug, has more gotchas to trip up new users, and rarely offers significant benefits.
DrAzzy:
Never use switch-case instead of if-else-if unless you have a good reason - switch-case code is harder to debug, has more gotchas to trip up new users, and rarely offers significant benefits.
I am a hardware guy, build proto's and such, I know electronics but when it comes to code it is like learning greek. I can fumble my way though stuff that exists, in the end it's old dog...new tricks...growling.