Go Down

Topic: Help with Bulldozer project (Read 784 times) previous topic - next topic

Becky2015

Hi All,  I hope I am posting on the correct board.  We have been trying to complete a family project and we are stumped!  We have the Make: it Bulldozer with Audrino Uno board and IR remote.  It seems that the code is verified and it uploads but the remote will not work the robot. It does nothing.  We are beginners so any help with troubleshooting is appreciated!  Thanks, Becky

JimboZA

Without seeing your sketch or circuitry, or knowing what troubleshooting you already tried, difficult to help.

But as a start you need to see what codes the IR is actually producing, or rather what the Arduino is seeing. You should use the Serial.print() to print out the remote's codes as the IR receiver on the robot decodes them. Then check to see that your sketch is looking for those codes, I'm guessing in "if" commands, so it can decide what to do.

The code below, for example, looks for certain codes to dim or brighten an LED; I'm guessing you have similar stuff in your code.

Code: [Select]
/*
 * IRremote: IRrecvDemo - demonstrates receiving IR codes with IRrecv
 * An IR detector/demodulator must be connected to the input RECV_PIN.
 * Version 0.1 July, 2009
 * Copyright 2009 Ken Shirriff
 * http://arcfn.com
 */
 
/* well now it controls the brightness of an LED
   LED is PWM'd on pin5
   *******   PWM on pin3 seems disabled when using IR?
   uses the volume key... up to brighten, down to dim
   under rc5, the keys have two toggled values
   down:    411 or c11 hex; 1041 or 3089 dec
   up:      410 or c10 hex; 1040 or 3088 dec
*/
               

#include <IRremote.h>

int RECV_PIN = 11;
int led_pin = 5;   // seems PWM not work on 3 with IR library
int led_bright = 130;  //half way to start
int led_step = 10;     // and change in pwm steps of 10

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()
{
  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver
  pinMode(led_pin, OUTPUT);
  analogWrite(led_pin, led_bright);
}

void loop() {
  if (irrecv.decode(&results)) {
    Serial.println(results.value, HEX);
    irrecv.resume(); // Receive the next value
   
    //now check if it's correct key and act...
    //down
    if (results.value == 1041 || results.value == 3089) {
      led_bright = led_bright - led_step;
      if (led_bright < 10) {
        led_bright = 10;
        }
      Serial.print("Going down to ");
      Serial.println(led_bright);
      analogWrite(led_pin, led_bright);
    }
   
    //up
    if (results.value == 1040 || results.value == 3088) {
      led_bright = led_bright + led_step;
      if (led_bright > 255) {
        led_bright = 255;
      }
      Serial.print("Going up to ");
      Serial.println(led_bright);
      analogWrite(led_pin, led_bright);
    }
  }
}


Once you have verified the IR codes are being tested for, then we can look further to see why those codes are not activating the 'dozer.

Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)
Dr Perry Cox: "Help me to help you, help me to help you...."
Your answer may already be here: https://forum.arduino.cc/index.php?topic=384198.0

Becky2015

Thank You!  I don't know what I did but it is working!!!!!

JimboZA

Well I doubt anything I suggested helped you yet so probably no thanks necessary!

Glad you got it going.

But you really should try to back-track what you did, so that you understand what happened. Otherwise if it goes hinky again, you won't have much idea about how to fix it.
Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)
Dr Perry Cox: "Help me to help you, help me to help you...."
Your answer may already be here: https://forum.arduino.cc/index.php?topic=384198.0

Go Up