暗いところに持っていくと点滅します。 部品はtiny2313とLEDを1個ずつ。 LEDを光センサーとして使っています。 // AVR Hotaru #include <avr/io.h> //#include <avr/interrupt.h> #include <util/delay.h> #define nop() __asm__ __volatile__ ("nop") #define SERIAL_DEBUG 0 #if SERIAL_DEBUG #define BAUD 2400 //#define SET_PORT(PORT, MASK, VALUE) PORT = (VALUE & MASK)|((~MASK) & PORT) void usart_init(void) { #define _UBRR (F_CPU/16/BAUD-1) UBRRH = _UBRR>>8;
![AVRホタル - ふつうのプログラマーが電子工作に再チャレンジ](https://cdn-ak-scissors.b.st-hatena.com/image/square/f95a0448e193c7f78ba70e2465732b9efa89dcf1/height=288;version=1;width=512/https%3A%2F%2Fcdn-ak.f.st-hatena.com%2Fimages%2Ffotolife%2Fe%2Felec_avr%2F20080712%2F20080712122902.jpg)