author
4Comments

Tell us about yourself!

Complete Your Profile
  • gbwith commented on HavocRC's instructable How to Use IR Remotes With Arduino9 months ago
    How to Use IR Remotes With Arduino

    Thanks for all your work. I should have been a little clearer on my objective. I just want a remote to turn on and off a strobe (or fade) effect in the for loop area either with the same button or by using 2 separate remote buttons. The following is what I've been able to get me close. I can get it turn on and do as I wanted however I can't get it to shut off by remote. in the else statement the value > 1 was changed from = 0 because it would on go through 1 cycle and end with it > 1 it would continue the cycling. Hope this makes sense. Any ideas. Here's what I have.#include <IRremote.h>int RECV_PIN = 12; // the pin where you connect the output pin of IR Receiverint ledPin = 5; // Led connected to digital pin 11int cycle = 75;int strobe = cycle * 20; // calculate strobe del...

    see more »

    Thanks for all your work. I should have been a little clearer on my objective. I just want a remote to turn on and off a strobe (or fade) effect in the for loop area either with the same button or by using 2 separate remote buttons. The following is what I've been able to get me close. I can get it turn on and do as I wanted however I can't get it to shut off by remote. in the else statement the value > 1 was changed from = 0 because it would on go through 1 cycle and end with it > 1 it would continue the cycling. Hope this makes sense. Any ideas. Here's what I have.#include <IRremote.h>int RECV_PIN = 12; // the pin where you connect the output pin of IR Receiverint ledPin = 5; // Led connected to digital pin 11int cycle = 75;int strobe = cycle * 20; // calculate strobe delayint maxFade = 75; // maximum brightness before strobeint fadeValue;#define code1 41565 // code received from Power ButtonIRrecv irrecv(RECV_PIN);decode_results results;void setup() { pinMode(ledPin, OUTPUT); irrecv.enableIRIn(); // Start the receiver}void loop(){ // variable to remember the last value from the remote static int value = 0; // if remote keypress received if (irrecv.decode(&results)) { // if currently not fading if (value == 0) { value = results.value; } else { value > 0; // this is what was = 0 but didn't work } irrecv.resume(); } // take action switch (value) { case code1: for (int fadeValue = 0 ; fadeValue <= maxFade; fadeValue += 2) { analogWrite(ledPin, fadeValue); delay(cycle); } analogWrite(ledPin, 255); delay(strobe); analogWrite(ledPin, maxFade); for (int fadeValue = maxFade ; fadeValue >= 0; fadeValue -= 2) { analogWrite(ledPin, fadeValue); delay(cycle); } }}

    View Instructable »
  • gbwith commented on HavocRC's instructable How to Use IR Remotes With Arduino9 months ago
    How to Use IR Remotes With Arduino

    did you happen to look at those sketches? I looked at what I had sent you and it looked like a mess, however where you originally posted the IR Remote I did see where I (gbwith) commented and the sketches look a little more readable. Thank you

    View Instructable »
  • gbwith followed arduino channel 9 months ago
  • gbwith commented on HavocRC's instructable How to Use IR Remotes With Arduino9 months ago
    How to Use IR Remotes With Arduino

    I've combined as much as my limited knowledge allowed me without getting an error. Thanks for looking. /* source: www.electroschematics.com You'll need to change the led pins and the codes accordingly to your configuration and IR remote */ #include <IRremote.h> int RECV_PIN = 12; // the pin where you connect the output pin of IR Receiver int cycle=75; int strobe=cycle*20; // calculate strobe delay int ledPin=11; int maxFade=75; // maximum brightness before strobe int fadeValue; int itsONled[] = {0,0,0,0,0}; /* the initial state of LEDs is OFF (zero) the first zero must remain zero but you can change the others to 1's if you want a certain led to light when the board is powered */ #define code1 41565 // code received from Power Button IRrecv ir...

    see more »

    I've combined as much as my limited knowledge allowed me without getting an error. Thanks for looking. /* source: www.electroschematics.com You'll need to change the led pins and the codes accordingly to your configuration and IR remote */ #include <IRremote.h> int RECV_PIN = 12; // the pin where you connect the output pin of IR Receiver int cycle=75; int strobe=cycle*20; // calculate strobe delay int ledPin=11; int maxFade=75; // maximum brightness before strobe int fadeValue; int itsONled[] = {0,0,0,0,0}; /* the initial state of LEDs is OFF (zero) the first zero must remain zero but you can change the others to 1's if you want a certain led to light when the board is powered */ #define code1 41565 // code received from Power Button IRrecv irrecv(RECV_PIN); decode_results results; void setup() { irrecv.enableIRIn(); // Start the receiver pinMode(ledPin, OUTPUT); } void loop() { if (irrecv.decode(&results)) { unsigned int value = results.value; switch(value) { case code1: if(itsONled[1] == 1) { // if first led is on then digitalWrite(ledPin, LOW); // turn it off when button is pressed itsONled[1] = 0; // and set its state as off } else { // else if first led is off digitalWrite(ledPin, HIGH); // turn it on when the button is pressed itsONled[1] = 1; // and set its state as on } break; } irrecv.resume(); // Receive the next value } }STROBeint cycle=75;int strobe=cycle*20; // calculate strobe delayint maxFade=75; // maximum brightness before strobeint ledPin = 11; // Led connected to digital pin 11int fadeValue;void setup() {// nothing happens in set}void loop() {// fade in from min to max in increments of 2 points:for (int fadeValue = 0 ; fadeValue <= maxFade; fadeValue += 2) {// sets the value (range from 0 to maxFade):analogWrite(ledPin, fadeValue);// wait for "cycle" milliseconds to see the dimming effectdelay(cycle);}analogWrite(ledPin, 255); // simulate a rotating beacon catching your eyedelay(strobe); // hold full brightness for strobe delayanalogWrite(ledPin, maxFade);// fade out from maxFade to min in increments of 2 points:for (int fadeValue = maxFade ; fadeValue >= 0; fadeValue -= 2) {// sets the value (range from 0 to maxFade):analogWrite(ledPin, fadeValue);// wait for "cycle" milliseconds to see the dimming effectdelay(cycle);}}

    View Instructable »
  • gbwith followed gbwith and GWPoulos3 years ago
  • gbwith followed arduino channel 3 years ago