Shamooooot
Newbie level 6
- Joined
- Jan 1, 2013
- Messages
- 14
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,420
I am trying to read the temperature value on a LM35 sensor via ADC0804 to AT89C51
this is my code in mikroc:
the program shows me error with the OW_read() I think it's not a valid command, and I don't know how can I read the input bits on the input pins to be shown on the LCD in Celsius.
here is my ckt:
this is my code in mikroc:
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 // LCD module connections char OW_val; sbit LCD_RS at P0_2_bit; sbit LCD_EN at P2_3_bit; sbit LCD_D4 at P2_4_bit; sbit LCD_D5 at P2_5_bit; sbit LCD_D6 at P2_6_bit; sbit LCD_D7 at P2_7_bit; // End LCD module connections sbit OW_Bit1 at P1_0_bit; sbit OW_Bit2 at P1_1_bit; sbit OW_Bit3 at P1_2_bit; sbit OW_Bit4 at P1_3_bit; sbit OW_Bit5 at P1_4_bit; sbit OW_Bit6 at P1_5_bit; sbit OW_Bit7 at P1_6_bit; sbit OW_Bit8 at P1_7_bit; char txt3[] = "Jordan university"; char txt4[] = "of science"; char txt5[] = "and technology"; void main(){ Lcd_Init(); // Initialize LCD Lcd_Cmd(_LCD_CLEAR); // Clear display Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off LCD_Out(1,1,txt3); // Write text in first row LCD_Out(2,3,txt4); // Write text in second row Delay_ms(1000); Lcd_Cmd(_LCD_CLEAR); LCD_Out(1,2,txt5); Delay_ms(1000); Lcd_Cmd(_LCD_CLEAR); OW_val = OW_read(0); LCD_Out(1,1,OW_val); }
the program shows me error with the OW_read() I think it's not a valid command, and I don't know how can I read the input bits on the input pins to be shown on the LCD in Celsius.
here is my ckt: