So why does that <b>first</b> project have to be so complicated ?
Nobody fell out of the womb and landed on their feet in a dead run, human beings do not learn that way, we learn in chunks, and fail until we get the gestalt of that chunk, that becomes the cornerstone and we bite off another chunk, It's why some people here constantly ask about blinkys, cause if you cannot do that . . . you're basically screwed. You build a house, 1st Foundation, 2 stemwall, 3 Floor joists,subfloor, Walls, Rafters . . . If you build the roof first, then someone is going to have to help you put it on. In this instance, he would do well to set aside the keypad routine untill he can do with buttons what he wants, make the device work first, then think about how to JAZZ IT UP. Yes you can make a suit out of patches, but would anyone wear it to an interview?
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
gee, that example is confusing. all i want to use is 5 buttons on port c of my 16f873.
button A = High Setpoint
buttonB = Low Setpoint
buttonC= Increment
buttonD= Decrement
buttonE= Return to main display
At power up of my device, I want my program to prompt the user to enter a high and low setpoint then continue to display the main program afterwards. If the user decides to change setpoint, then the buttons above can be used.
Yes, it can be so why bother with all that keypad code then?
To address your original question, you may wish to store the value in the eeprom of your chip. Use WRITE command to store and READ to retrieve the values.Code:'simple if then loop BUTTONA VAR PORTC.0 BUTTONB VAR PORTC.1 BUTTONC VAR PORTC.2 ' and so on . . . MAIN: IF BUTTONA = 0 THEN gosub High_Setpoint IF BUTTONB = 0 THEN GOSUB Low_Setpoint IF BUTTONC = 0 THEN GOSUB Increment ' More code goes in here GOTO MAIN high_setpoint: 'do something in here return Low_Setpoint: 'do something in here return Increment: 'do something in here return 'more sub directories here end
Last edited by Archangel; - 9th October 2008 at 10:08.
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
think it will be easier to use 5 buttons instead of using a matrix keypad. How would I prompt the user to enter high and low setpoints immediately once the device is powered? With that, how would i configure a button to act as an "enter" button? The reason i ask this is because i want the program to ask the user to enter high setpoint then the user should press enter. The program should then ask the user to enter a low setpoint and pressing enter again will cause the program the jump to the main temperature display.
Last edited by Kalind; - 13th October 2008 at 12:46.
Write some code...write some code...write some code. You have the PBP manual, you have internet access, you can search for methods on how to use BASIC, you can do almost anything, so, write some code. When that code that YOU write doesn't work, I'm sure a load of people here will help you troubleshoot that code to figure out why it doesn't work the way you want it to work. If you can't write the code, at least write out what you want to do on paper. Use a 'flowchart' type of setup. Just write it out. 'cause quite frankly, good luck finding somebody to write the code for you...
Bookmarks