+1] = tempv_char [0]; tempb_char [n +2] = tempv_char [1];}// 10 <= x <100
{tempb_char [n] = tempv_char [0]; tempb_char [n +1] = tempv_char [1]; tempb_char [n +2] = tempv_char [2];}// 10 <= x <100
_1 (); (i = 0; i
{_char = tempb_char [i]; _wr = temp_char; _write ();
}// for i
}// if n! = 0
} ;//while: CCP1CON = 0;
}
// ---------------------- Temperature ---------------------- ---------- temp (void)
{tempw, temp_char; i; (select == 0) {};. TRISC3 = 1;// initialize MSSP module.TRISC4 = 1; = 0b00101000;. SMP = 1; = 0x05;
bits.TMR1IF = 0 ;//load Timer1 for 2 sec overflowH = 0; L = 0; {
// GET_TEMP_temp: cmd_byte = 0x01;// config register command byte
// TEMP_NOW_now: SSPSTATbits.CKE = 1;// SMBUS spec for TC74
bits.SEN = 1 ;//write to TC74 (SSPCON2bits.SEN == 1) {}; = 0b10011010 ;//send TC74 ADDRESS (write)
ssprw ();
while (SSPCON2bits.ACKSTAT == 1) {} ;//ack?
= cmd_byte; = WREG ;//send COMMAND byte (config) (); (SSPCON2bits.ACKSTAT == 1) {} ;//ack?
bits.RSEN = 1 ;//send repeated start (SSPCON2bits.RSEN == 1) {}; = 0b10011011 ;//send TC74 ADDRESS (read) () ;//module idle? (SSPCON2bits.ACKSTAT == 1) {} ;//ack?
bits.RCEN = 1 ;//enable receive mode (SSPCON2bits.RCEN == 1) {};
= SSPBUF;// retrieve config reg or temp reg
bits.ACKDT = 1 ;//send NOT-ACKbits.ACKEN = 1; (SSPCON2bits.ACKEN == 1) {};
bits.PEN = 1;// stop (SSPCON2bits.PEN == 1) {}; = WREG; (cmd_byte == 1) {//config command OR temp command = tempw;
_asm0x40// is temp ready?? 0x40
_endasm (STATUSbits.Z == 0) {goto get_temp;} _byte = 0x00; temp_now;
}
{_char = tempt_char [i]; _wr = temp_char; _write ();
}// for i_2 (); _pos = 9; _char_2 ();
} while (select == 1);
}
// ----------------- CLOCK --------------------------- --------------- clock (void)
{temp_char; i, n; (select == 0) {};
CON = 0x0F; = 0; minutes = 0; hours = 0; {bits.TMR1IF = 0; H = 0x68; L = 0x00;
+ +; (seconds-60 == 0) {+ +; = 0;
} (minutes-60 == 0) {+ +; = 0;
} (hours-13 == 0) {= 0;
} (scroll == 0) clock_set ();
clock_draw ();
_2 ();
ptr_pos = 7; _char_2 (); (PIR1bits.TMR1IF == 0) {if (scroll == 0) clock_set ();};
} while (select == 1);
}
clock_set (void)
{(scroll == 0) {}; (select == 1) {(scroll == 1) {_draw (); _2 (); _pos = 12; _char_2 (); (select == 0) { minutes + +;} (minutes-60 == 0) {+ +; = 0;
}// if (hours-13 == 0) {hours = 0;}
}// while (scroll == 0) {}; (scroll == 1) {_draw (); _2 (); _pos = 13; _char_2 (); (select == 0) {hours + +;} ( hours-13 == 0) {hours = 0;}
} (scroll == 0) {}; (scroll == 1) {_draw (); _2 (); _pos = 14; _char_2 (); (select == 0)
{goto clock_set_end;}
}
} _set...