What does it mean?
Code: Select all
/* Fillarimittari
Polkupyörän matka- / matka-aikamittari
- PIC16F876 @ 8MHz
- 2x16 LCD näyttö
*/
static unsigned CIRC = 2064; // Renkaan ympärysmitta (mm)
static unsigned long TRIP = 0; // Osamatka
static unsigned TIME = 0; // Osa-aika
static float SPEED = 0; // Nykyinen nopeus
static float TOPSPEED = 0; // Huippunopeus
void alustus()
{
Lcd_Init(&PORTB);
Lcd_Cmd(Lcd_CLEAR);
Lcd_Cmd(Lcd_CURSOR_OFF);
Lcd_Out(1, 1, "-Fillarimittari-");
INTCON.INTE = 1; // Enable INTE (RB0 external interrupt)
INTCON.GIE = 1;
&TRISB = 0b00000001; // RB0 is input
&TRISC = 0b00000000;
PORTC = 0;
Delay_ms(2000);
}
void interrupt()
{
INTCON.INTF = 0; // clear INTF
INTCON.INTE = 0; // disable external interrupts
TRIP = TRIP + CIRC;
PORTC = 2;
INTCON.INTE = 1; // Enable INTE
}
void main(void)
{
float TRIP2;
char *txt;
alustus();
while (1)
{
Lcd_Out(1, 1, "23,6 19,4 56,8");
TRIP2 = TRIP /100000;
FloatToStr(TRIP2,txt);
Lcd_Out(2, 1, txt);
}
}