diff --git a/Button/Button.atsuo b/Button/Button.atsuo index f045b10..88004ff 100644 Binary files a/Button/Button.atsuo and b/Button/Button.atsuo differ diff --git a/Button/Button/Led.hpp b/Button/Button/Led.hpp index 8dc3552..311b8b1 100644 --- a/Button/Button/Led.hpp +++ b/Button/Button/Led.hpp @@ -9,6 +9,7 @@ #define LED_H_ #include "pin.hpp" +#include template class Led { @@ -56,17 +57,47 @@ class Led { } private: void init() { + r = 0; + g = 0; + b = 0; red::make_output(); green::make_output(); blue::make_output(); + + // Timer/Counter 0 initialization + // Clock source: System Clock + // Clock value: 16000,000 kHz + // Mode: Normal top=0xFF + // OC0 output: Disconnected + // Timer Period: 0,016 ms + TCCR0=(0< red; const typedef avrlib::pin green; const typedef avrlib::pin blue; - uint8_t r = 0; - uint8_t g = 0; - uint8_t b = 0; + static uint8_t r; + static uint8_t g; + static uint8_t b; + /* TIMER0_OVF_vect */ + static void timer_int() __asm__("__vector_11") __attribute__((__signal__, __used__)) { + for(uint8_t i=0;i<0xFF;i++) { + uint8_t rgb = 0; + if(icolor(rgb); + } + } }; diff --git a/Button/Button/canaddress.h b/Button/Button/canaddress.h index 8533826..e752f77 100644 --- a/Button/Button/canaddress.h +++ b/Button/Button/canaddress.h @@ -14,6 +14,8 @@ #define CAN_SEND_BUTTON_ID 0x01 #define CAN_GET_BUTTON_ID 0x02 #define CAN_GET_COLOR 0x03 +#define CAN_GET_OK 0x04 +#define CAN_GET_WRONG 0x05