Re: 555 countdown timer design question
Yes, that is correct - my bad.
I don't speak binary so I'm having a hard time following those numbers, what do they mean exactly ? Gotta hand it to the people who can actually write code like that
Since they follow a DEFINE tag, it would seem you assign CH_A/B/C those values (much like I tried to do when I wrote "define CH_A 2" which assigns pin 2 to that CH_A). This worked for me as well: the code still executed properly even after using DEFINE instead of INT for my "button pin" (the same pin as before, just for testing purposes), which I read was not only better as far as memory usage is concerned, but it also prevents errors, something you mentioned way back when you said the compiler can detect errors - I may be wrong in these assumptions though.
The problem was trying to read the bastards at the same time, since it resulted in the erratic behavior I mentioned. Seems I was on to something and got close enough, just have to use an AND rather than OR - slightly counterintuitive, since logically your brain tells you "if this OR that is pressed, do something", but it's not quite like that for a micro
Originally posted by Curious.George
View Post
#define CH_A 0x40
#define CH_B 0x08
#define CH_C 0x04
#define CH_D 0x01
#define CH_B 0x08
#define CH_C 0x04
#define CH_D 0x01

The problem was trying to read the bastards at the same time, since it resulted in the erratic behavior I mentioned. Seems I was on to something and got close enough, just have to use an AND rather than OR - slightly counterintuitive, since logically your brain tells you "if this OR that is pressed, do something", but it's not quite like that for a micro

Comment