This .PBAS works, but....
denno
Posts: 223
in Propeller 1
First I am using an Scott Edwards LCD, which has it own set of "Character Codes"..0 through 255. Plus, as you can see in the code, there are also Constants to controll the LCD...position commands, backlight on and off...etc.
From the code, I have put in a fixed temperature reading of 125 degrees, into the HUB and then passed that to COG 7 to use in the "LCD" display. The problem I am having is when the RDLONG degrees, temp get the number from the HUB, and pass it down to the SEROUT command, instead of printing the "125", the LCD display thinks I am send it a control command, which is a "right hand bracket" instead of the temperature of 125 degrees. How do I make that PBAS command of SEROUT send the "number" 125 to be printed on the display...keep in mind that the number 125 is just a test number, as later on I will be using an LM34 to make temperature reading....and pass that value to COG 7 for a digital readout........thanks DenO
From the code, I have put in a fixed temperature reading of 125 degrees, into the HUB and then passed that to COG 7 to use in the "LCD" display. The problem I am having is when the RDLONG degrees, temp get the number from the HUB, and pass it down to the SEROUT command, instead of printing the "125", the LCD display thinks I am send it a control command, which is a "right hand bracket" instead of the temperature of 125 degrees. How do I make that PBAS command of SEROUT send the "number" 125 to be printed on the display...keep in mind that the number 125 is just a test number, as later on I will be using an LM34 to make temperature reading....and pass that value to COG 7 for a digital readout........thanks DenO
DEVICE P8X32A, XTAL1, PLL16X XIN 5_000_000 STACK 10 baud CON "N9600" carr_return CON 13 clrLCD CON 12 'clear the screen on the lcd posCMD CON 16 'position the curser command hideCUR CON 4 'hide the curser command blinkCUR CON 6 'blink the curser command degreeSYM CON 223 'the "degree" symbol receive_data CON 255 backLTon CON 14 'turn the back light on backLToff CON 15 'turn the back light off brightness_ctl CON 27 quarter_bright CON 48 half_bright CON 49 three_quarter_bright CON 50 full_bright CON 51 beep CON 7 'beep command right_align CON 18 'RIGHT ALIGN COMMAND start_big_char CON 2 end_big_char CON 3 astrike CON 42 block_char CON 134 carReturn CON 13 'carriage return command blank_char CON 32 left_arrow CON 127 right_arrow CON 126 LR_arrow CON 131 LL_arrow CON 128 UR_arrow CON 129 UL_arrow CON 130 down_arrow CON 132 up_arrow CON 133 equal_sign CON 61 first_line CON 64 second_line CON 104 degrees HUB LONG temp VAR LONG LCD_data_out PIN 0 LOW LCD_display TASK PROGRAM START START: temp = 125 WRLONG degrees, temp COGINIT LCD_display, 7 'cog 7 END TASK LCD_display temp VAR LONG RDLONG degrees, temp SEROUT LCD_data_out, baud, clrLCD SEROUT LCD_data_out, baud, beep SEROUT LCD_data_out, baud, backLTon PAUSE 1000 SEROUT LCD_data_out, baud, posCMD SEROUT LCD_data_out, baud, 64 SEROUT LCD_data_out, baud, "TEMPERATURE IS" SEROUT LCD_data_out, baud, posCMD SEROUT LCD_data_out, baud, 84 SEROUT LCD_data_out, baud, temp '<<<<<<<the problem......? ENDTASK
Comments
Bean
If you refer to these commands in the PropBASIC manual things will become much easier for you.
I have a copy double side printed and in a binder and it's almost a necessity to do something similar when
learning a new variant of a language.
Here's the description of STR:
And, I will take your advice about printing out all the manual for 1.48 propbasic....
DennO