Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Thread Tools Display Modes
Old 20th December 2004, 10:47 PM   (permalink)
Default Question on writing code for PIC

I would like to modify a keypad routine so that it accepts a three digit input from the numbers "006 to 180" and store that value if it is in this range into eeprom memory, if not in this range display "- - -". It would display each digit as it is entered; example: if entering 888 it would display the first two digits 88 when entered and when the third digit 8 is entered display "- - -" on a seven segment display. I have code already for a 3x4 keypad and three seven segment displays that works and would like to add to this. The target device is a 16f628a. Could anyone point me to some sample code I had look at?
Thanks
johnnyquest is offline  
Reply With Quote
Old 21st December 2004, 05:44 AM   (permalink)
Default Re: Question on writing code for PIC

Quote:
Originally Posted by johnnyquest
I would like to modify a keypad routine so that it accepts a three digit input from the numbers "006 to 180" and store that value if it is in this range into eeprom memory, if not in this range display "- - -". It would display each digit as it is entered; example: if entering 888 it would display the first two digits 88 when entered and when the third digit 8 is entered display "- - -" on a seven segment display. I have code already for a 3x4 keypad and three seven segment displays that works and would like to add to this. The target device is a 16f628a. Could anyone point me to some sample code I had look at?
Thanks
You could try my keypad tutorials, one of which gives code for a digital lock - not exactly what you want, but it might give some pointers?.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Reply With Quote
Old 21st December 2004, 05:54 AM   (permalink)
Default

Think State Machine.
checkmate is offline  
Reply With Quote
Old 21st December 2004, 12:05 PM   (permalink)
Default

I could kick myself for not thinking if that. I did design a state machine using a PLD a few years ago. I found some free software for State Machines targeted at PIC micros here http://www.generexe.com
Thanks
johnnyquest is offline  
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes




All times are GMT. The time now is 06:10 AM.


Electronic Circuits  |  Electronics Wiki
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.