slimpeng
- 17th January 2008, 12:21
Hello i want to send out the temeperature data out at portc.6 so wat is the commnet i should to choose it and can u write down in my programming and at the portc.6 is my transmitter so the comment should is wat...and i want every 5s the data will display at LCD and send the data out again.....who can help me...pls........
DEFINE debug_mode 0 ' Debug sending True serial data
DEFINE debug_reg portc ' Debug Port = PortC
DEFINE debug_bit 6 ' Debug.bit = PortC.6
DEFINE debug_baud 9600 ' Default baud rate = 9600
DEFINE osc 4 ' We're using a 4 MHz oscillator
DEFINE ADC_BITS 8
DEFINE ADC_CLOCK 1 ' Set A/D clock Fosc/8
DEFINE ADC_SAMPLEUS 50 ' Set A/D sampling time @ 50 uS
DEFINE LCD_DREG PORTB
DEFINE LCD_DBIT 4
DEFINE LCD_RSREG PORTB
DEFINE LCD_RSBIT 0
DEFINE LCD_EREG PORTB
DEFINE LCD_EBIT 1
DEFINE LCD_BITS 4
DEFINE LCD_LINES 2
DEFINE LCD_COMMANDUS 2000
LCDOUT 254,1
LCDOUT 254,2, "WELCOME MY"
LCDOUT 254,192,"TEMP IS:"
TRISC=255
TRISD=0
TRISB=0
B0 VAR BYTE
LOOP:
ADCON1=0
ADCIN 0,B0
if b0=0 then OUTT
IF B0=10 THEN OUT
IF B0=20 THEN OUT1
IF B0=30 THEN OUT2
IF B0=41 THEN OUT3
IF B0=51 THEN OUT4
IF B0=61 THEN OUT5
IF B0=71 THEN OUT6
IF B0=81 THEN OUT7
IF B0=92 THEN OUT8
IF B0=102 THEN OUT9
OUTT:
LCDOUT 254,201,"<0'C"
GOTO LOOP
OUT:
LCDOUT 254,201,"5'C "
GOTO LOOP
OUT1:
LCDOUT 254,201,"10'C "
GOTO LOOP
OUT2:
LCDOUT 254,201,"15'C "
GOTO LOOP
OUT3:
LCDOUT 254,201,"20'C "
GOTO LOOP
OUT4:
LCDOUT 254,201,"25'C "
GOTO LOOP
OUT5:
LCDOUT 254,201,"30'C "
PORTD=32
GOTO LOOP
OUT6:
LCDOUT 254,201,"35'C "
GOTO LOOP
OUT7:
LCDOUT 254,201,"40'C "
GOTO LOOP
OUT8:
LCDOUT 254,201,"45'C "
GOTO LOOP
OUT9:
LCDOUT 254,201,"50'C "
GOTO LOOP
end
DEFINE debug_mode 0 ' Debug sending True serial data
DEFINE debug_reg portc ' Debug Port = PortC
DEFINE debug_bit 6 ' Debug.bit = PortC.6
DEFINE debug_baud 9600 ' Default baud rate = 9600
DEFINE osc 4 ' We're using a 4 MHz oscillator
DEFINE ADC_BITS 8
DEFINE ADC_CLOCK 1 ' Set A/D clock Fosc/8
DEFINE ADC_SAMPLEUS 50 ' Set A/D sampling time @ 50 uS
DEFINE LCD_DREG PORTB
DEFINE LCD_DBIT 4
DEFINE LCD_RSREG PORTB
DEFINE LCD_RSBIT 0
DEFINE LCD_EREG PORTB
DEFINE LCD_EBIT 1
DEFINE LCD_BITS 4
DEFINE LCD_LINES 2
DEFINE LCD_COMMANDUS 2000
LCDOUT 254,1
LCDOUT 254,2, "WELCOME MY"
LCDOUT 254,192,"TEMP IS:"
TRISC=255
TRISD=0
TRISB=0
B0 VAR BYTE
LOOP:
ADCON1=0
ADCIN 0,B0
if b0=0 then OUTT
IF B0=10 THEN OUT
IF B0=20 THEN OUT1
IF B0=30 THEN OUT2
IF B0=41 THEN OUT3
IF B0=51 THEN OUT4
IF B0=61 THEN OUT5
IF B0=71 THEN OUT6
IF B0=81 THEN OUT7
IF B0=92 THEN OUT8
IF B0=102 THEN OUT9
OUTT:
LCDOUT 254,201,"<0'C"
GOTO LOOP
OUT:
LCDOUT 254,201,"5'C "
GOTO LOOP
OUT1:
LCDOUT 254,201,"10'C "
GOTO LOOP
OUT2:
LCDOUT 254,201,"15'C "
GOTO LOOP
OUT3:
LCDOUT 254,201,"20'C "
GOTO LOOP
OUT4:
LCDOUT 254,201,"25'C "
GOTO LOOP
OUT5:
LCDOUT 254,201,"30'C "
PORTD=32
GOTO LOOP
OUT6:
LCDOUT 254,201,"35'C "
GOTO LOOP
OUT7:
LCDOUT 254,201,"40'C "
GOTO LOOP
OUT8:
LCDOUT 254,201,"45'C "
GOTO LOOP
OUT9:
LCDOUT 254,201,"50'C "
GOTO LOOP
end