//just no time.. to find out how transmition from ir remote is build up.. so just connectet the typical 3pin IR receiver to +5V Ground and B1 (B1 in line with 49kOhm resistor to Ground and B1 in line with (must be ~50-100yF SMD capacitor) also to ground.. //just simple meassure the B1 voltage and switch led on/off if switchingvaliu settet by analogmeassurevoltage is reached.. (reching tragetmeassure value goes slow caused display resfresh/show) works with every remote controlll XD if remotecontroll not transmitting, resistor charge ir receiver loadet capacitor back to none transmitting voltage.. see how simple it is //led switched: BLUE SMD GPIO PC15 to GND //use it if usefull SSD1306 not needet can also use delay(millisecondsinnumber); function or count the verry long millis(); number #include #include #include #include //open this file to see possible functions // /\/\replace path to zip unzip directory (also in other ccp and h files in folder) //connect display to SCL: PB6 -- SDA: PB7 -- VCC: 5V (3.3V also works) -- GND: G #define OLED_RESET 4 Adafruit_SSD1306 display(OLED_RESET); const unsigned char PROGMEM cat [] = // width 66px height 46 { 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, // ## 0x00, 0x00, 0x0F, 0x0E, 0x18, 0x60, 0x00, 0x00, 0x00, // #### ### ## ## 0x00, 0x00, 0x04, 0x94, 0xF9, 0xE0, 0x00, 0x00, 0x00, // # # # # ##### #### 0x00, 0x00, 0x02, 0x67, 0xB7, 0x40, 0x00, 0x00, 0x00, // # ## #### ## ### # 0x00, 0x3F, 0xFC, 0x22, 0x26, 0x40, 0x00, 0x00, 0x00, // ############ # # # ## # 0x01, 0xE0, 0x04, 0x62, 0x2C, 0x60, 0x00, 0x00, 0x00, // #### # ## # # ## ## 0x07, 0x00, 0x00, 0x02, 0x38, 0x3F, 0xF8, 0x00, 0x00, // ### # ### ########### 0x3C, 0x00, 0x00, 0x02, 0x10, 0x00, 0x0F, 0x80, 0x00, // #### # # ##### 0x60, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x00, // ## ##### #### 0xDF, 0xE0, 0x7F, 0xE0, 0x01, 0xFE, 0x00, 0x1C, 0x00, // ## ######## ########## ######## ### 0xF0, 0x30, 0xFF, 0xF0, 0x07, 0xFF, 0x00, 0x07, 0x00, // #### ## ############ ########### ### 0x80, 0x18, 0xFF, 0xF0, 0x0F, 0xFF, 0x00, 0x01, 0x80, // # ## ############ ############ ## 0xC0, 0x31, 0xFF, 0xF8, 0x1F, 0xFF, 0x83, 0xFC, 0xC0, // ## ## ############## ############## ######## ## 0x41, 0x19, 0xFF, 0xF8, 0x1F, 0xFF, 0x82, 0x07, 0xC0, // # # ## ############## ############## # ##### 0x61, 0xF1, 0xFF, 0xF8, 0x1F, 0xFF, 0xCE, 0x00, 0x40, // ## ##### ############## ############### ### # 0x20, 0x81, 0xFF, 0xFC, 0x1F, 0xFF, 0xC7, 0xC0, 0x40, // # # ############### ############### ##### # 0x30, 0x71, 0xFF, 0xFC, 0x3F, 0xFF, 0xC0, 0x40, 0xC0, // ## ### ############### ################ # ## 0x10, 0x39, 0x3F, 0xE4, 0x3F, 0xFF, 0xC1, 0x80, 0x80, // # ### # ######### # ################ ## # 0x18, 0x41, 0x00, 0x04, 0x3F, 0xFE, 0x66, 0x00, 0x80, // ## # # # ############# ## ## # 0x0E, 0x01, 0xFF, 0xE4, 0x3F, 0xF0, 0x23, 0x01, 0x80, // ### ############ # ########## # ## ## 0x03, 0x01, 0xC0, 0x3C, 0x20, 0x00, 0x20, 0x03, 0x00, // ## ### #### # # ## 0x01, 0x81, 0x00, 0x08, 0x3F, 0x00, 0x20, 0x02, 0x00, // ## # # ###### # # 0x00, 0x80, 0x00, 0x00, 0x31, 0xFE, 0x60, 0x06, 0x00, // # ## ######## ## ## 0x00, 0xC0, 0x00, 0x00, 0x00, 0x03, 0xC0, 0x0C, 0x00, // ## #### ## 0x00, 0x70, 0x0F, 0xE0, 0x00, 0x00, 0xC0, 0x18, 0x00, // ### ####### ## ## 0x00, 0x1C, 0x38, 0x11, 0xE7, 0xF0, 0x00, 0x30, 0x00, // ### ### # #### ####### ## 0x00, 0x04, 0x60, 0xF1, 0xC3, 0x9C, 0x00, 0x60, 0x00, // # ## #### ### ### ### ## 0x00, 0x0C, 0xC1, 0x80, 0x80, 0xC6, 0x40, 0xC0, 0x00, // ## ## ## # ## ## # ## 0x00, 0x10, 0x83, 0x00, 0x00, 0x60, 0x67, 0x80, 0x00, // # # ## ## ## #### 0x00, 0xE0, 0x06, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, // ### ## #### 0x01, 0x80, 0x04, 0x00, 0x80, 0x80, 0x30, 0x00, 0x00, // ## # # # ## 0x00, 0xFF, 0x80, 0x20, 0x81, 0xF0, 0x0E, 0x00, 0x00, // ######### # # ##### ### 0x00, 0x18, 0x60, 0x11, 0xC6, 0x18, 0x03, 0xC0, 0x00, // ## ## # ### ## ## #### 0x00, 0x60, 0x00, 0x1F, 0x7C, 0x0C, 0x3C, 0x60, 0x00, // ## ##### ##### ## #### ## 0x00, 0x7F, 0x80, 0x14, 0x28, 0x04, 0x07, 0xC0, 0x00, // ######## # # # # # ##### 0x00, 0x43, 0xF0, 0x18, 0x1E, 0x34, 0x01, 0x00, 0x00, // # ###### ## #### ## # # 0x00, 0x02, 0x1C, 0x00, 0x02, 0x1C, 0x3D, 0x00, 0x00, // # ### # ### #### # 0x00, 0x06, 0x00, 0x00, 0x03, 0x10, 0x67, 0x80, 0x00, // ## ## # ## #### 0x00, 0x01, 0xC0, 0x00, 0x01, 0xB0, 0x34, 0x00, 0x00, // ### ## ## ## # 0x00, 0x00, 0x78, 0x00, 0x00, 0xE7, 0xF8, 0x00, 0x00, // #### ### ######## 0x00, 0x00, 0x0E, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, // ### ### 0x00, 0x00, 0x03, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, // ## # 0x00, 0x00, 0x01, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, // # # 0x00, 0x00, 0x01, 0x80, 0x00, 0x60, 0x00, 0x00, 0x00, // ## ## 0x00, 0x00, 0x00, 0x80, 0x00, 0x40, 0x00, 0x00, 0x00, // # # 0x00, 0x00, 0x00, 0x80, 0x00, 0x40, 0x00, 0x00, 0x00, // # # }; //use dotfactory to convert picture to array #define IR PB1 #define meld PC13 #define blau PC15 void setup() { delay(200); display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // initialize with the I2C addr 0x3D (for the 128x64) display.clearDisplay(); display.display(); pinMode(meld, OUTPUT); pinMode(blau, OUTPUT); //Serial3.begin(9600); } int dasist=278; boolean onk=false; void loop() { display.clearDisplay(); //istserial(); //machCATZ(); wasir(); display.fillRect(0,32,(270-dasist)*4,48,WHITE); display.display(); if (onk==true) {digitalWrite(blau,HIGH);} if (onk==false) {digitalWrite(blau,LOW);} } void wasir(void){ if ((analogRead(IR)/4) > dasist) {dasist+=1;} if ((analogRead(IR)/4) < dasist) {dasist-=1;} if (dasist < 240) {schaltmal(); dasist=250;} zeigzahl(dasist);} void schaltmal(void){ if (onk==true) {onk=false; return;}else {onk=true; return;} } void zeigzahl(int mich){String michauch=""; display.setTextSize(4); display.setCursor(0,0); display.setTextColor(WHITE); if (mich <9) {michauch+="0";} if (mich <99) {michauch+="0";} if (mich <999) {michauch+="0";} if (mich <9999) {michauch+="0";} michauch+=mich; display.println(michauch);} int8_t posr,posrm,posrr,posrrm,randy,randy2; void machCATZ() { if (posr >randy2) {posrm=1;randy2=random(20,5);} if (posrm ==1) {posr--;} if (posr <1) {posrm =0;} if (posrm ==0) {posr++;} if (posrr >randy) {posrrm=1; randy=random(55,10);} if (posrrm ==1) {posrr--; } if (posrr <1) {posrrm =0;} if (posrrm ==0) {posrr++;} display.drawBitmap(55-posrr, 20-posr,cat,66, 46, WHITE); if (randy > 11 && randy <13){ standart();} } /* String irgentwas="";int cachs,lang,neuda; void istserial(void){ if(Serial3.available()>0) { int cachs = Serial3.read(); irgentwas += (char)cachs; lang++;neuda=1; if (lang > 120) {lang=0;irgentwas="";} } display.setCursor(5,5);display.setTextSize(1);display.setTextColor(WHITE); display.println(irgentwas); } */ int16_t wusel=0; void standart(void) { wusel++; if (wusel >128){wusel=0;} display.clearDisplay(); display.setTextSize(3); display.setTextColor(WHITE); display.setCursor(0,0); display.print("MEOW "); display.print(wusel); display.drawRect(32, 0, 96, 34, WHITE); //ramen x,y,w,h } /* * MEOW! For using the SSD1306 I2C onb STM32F1203C8T6 with adafruit * by marderchen =^.^= its free use it or parts if there is something usefull * do what you want! * ___ * _.-| | / |\__/,| (`\ { | | -- |^ ^ |__ _) ) "-.|___| \ _.( Y ) ` / .--'-`-. _((_ `^--' /__< \ ....-+|______|__.-||__)`-' (((/ (((/ CATS are awesome! */