Hello
I am working in project to measure the temperature of the room
when i did it in proteus program it's working,
but can anyone check the connection of the pins ?
because i think we should use capacitor and resistor?
if we should use it, where i can connect them in the circuit?
I am working in project to measure the temperature of the room
when i did it in proteus program it's working,
but can anyone check the connection of the pins ?
because i think we should use capacitor and resistor?
if we should use it, where i can connect them in the circuit?
Rich (BB code):
// Lcd pinout settings
sbit LCD_RS at RB4_bit;
sbit LCD_EN at RB5_bit;
sbit LCD_D7 at RB3_bit;
sbit LCD_D6 at RB2_bit;
sbit LCD_D5 at RB1_bit;
sbit LCD_D4 at RB0_bit;
// Pin direction
sbit LCD_RS_Direction at TRISB4_bit;
sbit LCD_EN_Direction at TRISB5_bit;
sbit LCD_D7_Direction at TRISB3_bit;
sbit LCD_D6_Direction at TRISB2_bit;
sbit LCD_D5_Direction at TRISB1_bit;
sbit LCD_D4_Direction at TRISB0_bit;
int x=0;
float temp=0;
char txt[12];
void main() {
lcd_init (); ADC_init (); //analogue and digital converter
lcd_cmd(_lcd_cursor_off);
trisa.b0=1;
porta.b0=0;
trisd.b1=0;
portd.b1=0;
while (1) {
x=ADC_read (0); // 0 refers to the port number
temp=x*0.489;
floattostr (temp,txt);
lcd_out (1,1,txt);
if (temp<24) { portd.b0=0; }
else { portd.b1=1;}
} }