Honestly..., I had to use the MCSP debugger to find the step -1. Saw that the FOR loop was never getting executed. Made it easy.
But a million years, you'd have got it.
Glad to help.
<br>
Honestly..., I had to use the MCSP debugger to find the step -1. Saw that the FOR loop was never getting executed. Made it easy.
But a million years, you'd have got it.
Glad to help.
<br>
DT
Darrel you are amazing!
I tried this out yesterday and it exactly what I'm looking for ( I am making a fuel consumption / complex odometer for my ancient Land Rover) and as I can't see close up without glasses, but have perfect long distance vision, a normal LCD display on the dashboard is quite useless and I had been considering large 7 seg display, but this is beautiful! Thanks a million.
PS: any tips on saving a counter on power-down? I was going to have the PIC running off big electrolytic for long power down delay, and then have one port sensing the instant loss of the (voltage divided) 12v ignition and then quickly write to EEProm, but would it be clever to use a brown out flag or something like that?
Thanks, but the credit goes to Scott Edwards on that one.
If you have a PIC with an LVD (LOW VOLTAGE DETECT) pin. You can use it to generate an interrupt when it detects the loss of power.
Then you can imediately set all pins to input and shut-down any on-chip peripherals to save current.
You should be able to run long enough to save about 8-10 bytes with just 10uf or so..
DT
Hello Everyone,
This is cool. Anyone got an idea how to force this code to display 4 digits all the time? From 0000 to 9999? Scotts code works well. I tried dispVal = 0000 prior to the LCDOUT I,cgRAM statement and that did alright to start counter at zero and eliminate the initial display of a psudorandom 4 digit number at startup, I am sure it is simple, alas so am I.
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.
Ahhh, I figured out 1 way, Preload with dispVal = 10000. I watched it count up until it overflowed and the zeros remained. Are there better ways ?
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.
> Anyone got an idea how to force this code to display 4 digits all the time?
LCDOut DEC4 MyVar
>> Anyone got an idea how to force this code to display 4 digits all the time?
Just comment out this line ...Added: Or better yet, make it ...Code:; if dispVal < decade then blankItThen if you want leading zero's just set the bit.Code:LeadingZeros VAR BIT if (LeadingZeros = 0) AND (dispVal < decade) then blankIt
<br>
Last edited by Darrel Taylor; - 21st July 2007 at 11:48. Reason: Leading
DT
Bookmarks