syeda amna
Full Member level 4
- Joined
- Jun 1, 2010
- Messages
- 222
- Helped
- 24
- Reputation
- 48
- Reaction score
- 22
- Trophy points
- 1,308
- Location
- Pakistan
- Activity points
- 2,551
hi
I am trying to interface TC74 with PIC. it is not working. What is wrong with the code?
I am trying to interface TC74 with PIC. it is not working. What is wrong with the code?
Code:
#include <18F452.h>
#use delay (clock=4M)
#include <flex_for_test_lcd.c> //LCD driver
#fuses HS,NOLVP,NOWDT
#fuses XT //for crystal
#use I2C(scl=PIN_C3, sda=PIN_C4)
void main(){
int16 temp;
//LCD
output_low(PIN_E2);
lcd_init();
lcd_putc("Temperature:");
//I2C
i2c_start(); // Start condition
i2c_write(0x9A); //device Address 0x9A
i2c_Write(0x00);
i2c_start();
i2c_Write(0x9B);
temp = i2c_Read(0);
i2c_stop(); // Stop condition
printf(lcd_putc, "%lu" temp);
}