Debian Codegraph @

examples/freq-counter.c

raw symbols SCIP
1 // Connect the pulse output set on PD7 to the input PB1
2
3 #include <avr/kp.h> // Include file libkp
4
5 int main()
6 {
7 uint32_t f;
8
9 set_sqr_tc2(1000); // Set a square wave on TC2 output (PD7)
10 lcd_init();
11 while(1)
12 {
13 f = measure_freq(); // Measures on T1 (PB1)
14 lcd_clear();
15 lcd_put_string("f=");
16 lcd_put_long(f);
17 delay_ms(200);
18 }
19 }