GreyHairOldGuy
New Member
I have been doing a fair amount of controller programming with Oshonsoft and it has been fantastic. I now want to add a simple 2x16 line display and am using 9600 baud serial because it is just one I/O line and I can use almost any spare bit in my PIC controller (using DIGOLE.COM Serial or I2C - LCD Controller - under $10 on ebay)
I am calculating temperature in degrees F. using the following formula and PTT is my 8 bit count from the A/D (from a thermistor) and PTP is a calculated 16 bit word containing my degrees in F to 1 decimal place (IE 789m = 78.9 degrees F.
ptp = ((255 - ptt) * 100 / 16) - 150 (which all works fine and calculates correctly)
My present print statement:
Serout tx, 9600, "Ct=", #ptt, " Tp=", #ptp, "F", 0xd 'Print Temperature in Degrees F
Which displays for 66.8 degrees F (with an input A/D count of 124)
Ct=124 Tp=668F
So my (Obvious?) question: How do I get it to display 66.8 instead of 668
Second question on the same vein (am I allowed two?)
I have two operator controllers that generate a code of - 0 through 3 for Off, Low, Med and High
Presently I just print the 0-3 code from both Pump 1 and Pump 2 with the following print statement:
Serout tx, 9600, "Pump1=", #pp1, " ", "Pump2=", #pp2, 0xd 'Print Out Pump Codes
If I wanted to take that 0-2 code and print out for example:
Pump 1 = High (which would represent a count of 3), or Pump 1 = Low (etc)
How would I do that?
(....am I asking how to work with strings????)
Thank you in advance for what is probably a dumb question, and I really hope someone can give me a simple explanation.
I am calculating temperature in degrees F. using the following formula and PTT is my 8 bit count from the A/D (from a thermistor) and PTP is a calculated 16 bit word containing my degrees in F to 1 decimal place (IE 789m = 78.9 degrees F.
ptp = ((255 - ptt) * 100 / 16) - 150 (which all works fine and calculates correctly)
My present print statement:
Serout tx, 9600, "Ct=", #ptt, " Tp=", #ptp, "F", 0xd 'Print Temperature in Degrees F
Which displays for 66.8 degrees F (with an input A/D count of 124)
Ct=124 Tp=668F
So my (Obvious?) question: How do I get it to display 66.8 instead of 668
Second question on the same vein (am I allowed two?)
I have two operator controllers that generate a code of - 0 through 3 for Off, Low, Med and High
Presently I just print the 0-3 code from both Pump 1 and Pump 2 with the following print statement:
Serout tx, 9600, "Pump1=", #pp1, " ", "Pump2=", #pp2, 0xd 'Print Out Pump Codes
If I wanted to take that 0-2 code and print out for example:
Pump 1 = High (which would represent a count of 3), or Pump 1 = Low (etc)
How would I do that?
(....am I asking how to work with strings????)
Thank you in advance for what is probably a dumb question, and I really hope someone can give me a simple explanation.