HazardsMind:
Go to the IRremote library folder -> look for IRremoteInt.h -> right click and select EDIT -> find WProgram.h and change it to Arduino.h -> Save file -> restart the arduino software.
Question: I'm trying to continue my small project, which is control 3 servos with IR remote (directly to arduino), each button (1,2,3) makes different types of movement. can anybody help with my program? when I verify this i get
a lot of compiling error. Please help me fix it.
#include <IRremote.h>
#include <IRremoteInt.h>
#include <Servo.h>
int IR_PIN = 2; // IR Sensor pin
IRrecv irrecv(IR_PIN);
decode_results IRResult;
int pos = 0;
unsigned long IRValue;
Servo myservo1;
Servo myservo2;
Servo myservo3;
void setup()
{
myservo1.attach(9);
myservo2.attach(10);
myservo3.attach(11);
pinMode(IR_PIN, INPUT);
irrecv.enableIRIn();
}
void loop()
{
if (irrecv.decode(&IRResult))
{
IRValue = IRResult.value;
if ((IRValue == 1) || (IRValue == 2049))
{
//If 1 is pressed
}
if ((IRValue == 2) || (IRValue == 2050))
{
//If 2 is pressed
}
if((IRValue == 3) || (IRValue == 2051))
{
//If 3 is pressed
}
delay(1000);
irrecv.resume();
}
}
I change WProgram.h to Arduino.h, in an include statement.
If you still have errors, you need to post them.
In file included from KI_Alat_Lipat_Baju.ino:2:
D:\Arduino Libraries\libraries\IRremote/IRremoteInt.h:87: error: 'uint8_t' does not name a type
D:\Arduino Libraries\libraries\IRremote/IRremoteInt.h:88: error: 'uint8_t' does not name a type
D:\Arduino Libraries\libraries\IRremote/IRremoteInt.h:89: error: 'uint8_t' does not name a type
D:\Arduino Libraries\libraries\IRremote/IRremoteInt.h:92: error: 'uint8_t' does not name a type
Go to the IRremote library folder -> look for IRremoteInt.h -> right click and select EDIT -> find WProgram.h and change it to Arduino.h -> Save file -> restart the arduino software.
HazardsMind:
Go to the IRremote library folder -> look for IRremoteInt.h -> right click and select EDIT -> find WProgram.h and change it to Arduino.h -> Save file -> restart the arduino software.
Thank you so much for the info, now my code is working.