i has the advantages to be 'user configurable' and support many matrix Keypad type... up to 8X8.
Can be used in a Timer interrupt as well, so you can read from it when you want, etc etc.
Enjoy!
i has the advantages to be 'user configurable' and support many matrix Keypad type... up to 8X8.
Can be used in a Timer interrupt as well, so you can read from it when you want, etc etc.
Enjoy!
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
It looks quite comprehensive.
I tend to base most of my algorithms around direct logic - boolean algebraic structures - rather than continuous mathematics, i.e calculations. PIC's are not as well equipped for calculations.
If that was true... ASM additions, substraction, bit shifting functions and few STATUS register bits wouldn't exist...(carry/Borrow, Z)
Last edited by mister_e; - 12th May 2007 at 23:35.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Last edited by T.Jackson; - 13th May 2007 at 06:47.
Trent, If your example was right i could agree with some part of it... programming method and code optimization is an endless story... i'm not going to argument on which is better, which is worst... it's not what the actual thread is about anyway.
100X ??? NAH, i don't think so. Depending the Value of I, few times maybe... but not 100 for sure. and * 2, is just a Byte shifting, one position to the left... not much... 1-2 cycle not much.
-----------------------------
Charudatt,
before going in sleep mode, make sure those PINs are set to input (with pull-up) and the others are set LOW and OUTPUT (or input but with pull-down resistor). Once you'll press a key, RB<7:4> should see the LOW signal... which should wake your PIC, then you call the keypad scan.
Last edited by mister_e; - 13th May 2007 at 09:11.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Huh? Lookups have their place (and I love them when needed) but to say PICs are not equipped for calculations is just plain silly.I tend to base most of my algorithms around direct logic - boolean algebraic structures - rather than continuous mathematics, i.e calculations. PIC's are not as well equipped for calculations.
For all your projects (that you have posted), was time of the issue or code space? (answer = the latter). With your example equation, which one takes less code space? Which one is faster for larger I? (answer = calculation based approach).
orCode:' Calculation based equation A = 100/I +J*2 If I > 100 then A = J<<1 ELSE A = 100 FOR X = 1 to 100 A = A – I IF A < I then OUT NEXT X OUT: A = X+ J<<1 ENDIF
Code:' lookup based equation A = 100/I +J*2 IF I = 1 then A = 100+J<<1 If I = 2 then A = 50 +J<<1 If I = 3 then A = 33+J<<1 If I = 4 then A = 25+J<<1 ... ' (a bunch more if-thens) ... if I =100 then A = 1+J<<1 If I > 100 then A = J<<1
Paul Borgmeier
Salt Lake City, UT
USA
__________________
I know the Pull up Resistor attaches to Vss but where does it go else wise? Also... What happens to other test programs etc by its presence?
Paul
I didn't say not equipped - I said not as well equipped. And, I'm more so referring to something that's more so "hard coded" over calculations. When I say hard coded I'm talking about something that's direct as in (a = 100) Vs (a = b x 10 / 2) No prizes for guessing which is faster and uses less resource.
Last edited by T.Jackson; - 23rd May 2007 at 09:28.
Bookmarks