problem with lm35dz and transfer data from pic to pic to activate 7 seg display

Status
Not open for further replies.
Aha, found your mistake. Your polling R/S but it is not marked as an input! I would just tie R/S to ground and use a delay instead of checking the busy flag, good luck
 
newbie

hi all,
i am a newbie here.. and i am more interested in the c code than asm.. this code was in the examples given in mikroC

unsigned int temp_res;

void main() {
ADCON1 = 0x80; // Configure analog inputs and Vref
TRISA = 0xFF; // PORTA is input
TRISB = 0x3F; // Pins RB7, RB6 are outputs
TRISD = 0; // PORTD is output

do {
temp_res = Adc_Read(2); // Get results of ADC
PORTD = temp_res; // Send lower 8 bits to PORTD
PORTB = temp_res >> 2;
} while(1);
}

the value in temp_res gives the temperature right?? so can i not compare it with a reference value and perform a particular operation, say running a fan?
 
Sure, who said you couldn't?
I'm not sure how the Adc_Read() method works though, sorry.

hi sorry , back with some question again.
birdman0_o , can you send me the schematics for ur uart asm code?
anyway , do you use the ht12e/ht12d for encoding and decoding?
 
Mmm I don't really have a schematic, are you trying to do wireless, you would need to use different code, because using that code the transmitter would attenuate if you keep a constant high signal which isnt good. I would look into manchester encoding, Nigel has a great example!
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…