From 6fac9c92d03b0fd46fddb837017f231409152d23 Mon Sep 17 00:00:00 2001 From: BlubbFish Date: Fri, 15 Nov 2013 18:16:09 +0000 Subject: [PATCH] 20131115-191620 --- Button/Button.atsuo | Bin 18944 -> 19456 bytes Button/Button/Led.hpp | 37 ++++++++++++++++++++++++++++++++++--- Button/Button/canaddress.h | 2 ++ 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/Button/Button.atsuo b/Button/Button.atsuo index f045b1079b09d741d34ec963d4b3d31d95d1942c..88004ffd2a7d12038057e20b9acd421c3a4afc7c 100644 GIT binary patch delta 209 zcmZpe!q_l_aYF|arwRiD!@vLk|Nq-Ok?A%gpMmEZ2H{8N7@2{>4BDHkSd{bxR{)tS zfp`@VuLk0O8v}zGH<@?{vgiPLllzr5CYQMSPd?0IxcQ6g8OBNS4wF2bIT^KqlDbd@ ztV@85Rg-@zXfj$%R%DT#d_cg2Z8=bki*a(Gj@RTP9(yJ`$oFX`GL$hCF~l%rGUPMl vG8i)$F(fkRF=Q}YnfcH_y~}g$_1g*m+wUBWW}V!i>@fL(M+z7x=r{rZ^)f;A delta 119 zcmZpe!Pqc`aYF|a>%ag1|Nq+viK{;+BT(0W9jM6WFRo`8CnxAQOmb10tmL6M`7nzi>k^>ks>y*m P-jiKC_W&hbfV2$&zIH2{ 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