2020-07-18から1日間の記事一覧
pp.494-495 今50 Hzの方形波(周期20 ms)を入力している。 #define F_CPU 8000000UL #include <avr/io.h> #include <avr/interrupt.h> #include "LCDClass.h" LCDClass lcd("PD7","PD6","PD5","PD4","PD3","PD2"); // (RS,EN,D4,D5,D6,D7)の順番で指定する。 volatile uint16_t timeOld; </avr/interrupt.h></avr/io.h>…
p.494 ICP1ピン(PB0)に入力したパルスのパルスエッジが検出されたら、そのときのタイマー1のカウント値をキャプチャして表示する。 #define F_CPU 8000000UL #include <avr/io.h> #include <avr/interrupt.h> #include "LCDClass.h" LCDClass lcd("PD7","PD6","PD5","PD4","PD3","PD2");</avr/interrupt.h></avr/io.h>…