Offline
Newbie
Karma: 0
Posts: 21
|
 |
« on: March 14, 2013, 09:50:03 am » |
PROBLEM SOLVED! Thanks to HazardMind! 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(); } }
|
|
|
|
« Last Edit: March 14, 2013, 10:23:02 am by warboyzzzz »
|
Logged
|
|
|
|
|
Queens, New York
Offline
Edison Member
Karma: 27
Posts: 1537
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
|
 |
« Reply #1 on: March 14, 2013, 09:55:23 am » |
when I verify this i get a lot of compiling error. Ok, what errors?
|
|
|
|
|
Logged
|
UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W, Gameduino
Arduino Tutorials, coming soon.
"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown
|
|
|
|
Offline
Full Member
Karma: 4
Posts: 187
|
 |
« Reply #2 on: March 14, 2013, 09:56:22 am » |
How to use this forum - please read. Yes, Please read. it will tell you if there is any error in your code always post it with your code. 
|
|
|
|
|
Logged
|
From Idea To Invention
|
|
|
|
Seattle, WA USA
Offline
Brattain Member
Karma: 311
Posts: 35470
Seattle, WA USA
|
 |
« Reply #3 on: March 14, 2013, 09:59:55 am » |
I have the IRremote library installed in the right place, although it is an older version that was not compatible with 1.0+.
I pasted your code, and got a number of errors. I edited IRremoteInt.h, changed WProgramh to Arduino.h, and all the errors went away.
Perhaps you need to do that, too.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 21
|
 |
« Reply #4 on: March 14, 2013, 10:06:32 am » |
I have the IRremote library installed in the right place, although it is an older version that was not compatible with 1.0+.
I pasted your code, and got a number of errors. I edited IRremoteInt.h, changed WProgramh to Arduino.h, and all the errors went away.
Perhaps you need to do that, too.
i'm sorry, what do you mean by 'changed WProgramh to Arduino.h' ? i have changed the code and the number of errors is smaller.
|
|
|
|
|
Logged
|
|
|
|
|
Queens, New York
Offline
Edison Member
Karma: 27
Posts: 1537
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
|
 |
« Reply #5 on: March 14, 2013, 10:08:10 am » |
Did you go into the .h file and actually change WProgram.h to Arduino.h?
|
|
|
|
|
Logged
|
UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W, Gameduino
Arduino Tutorials, coming soon.
"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown
|
|
|
|
Seattle, WA USA
Offline
Brattain Member
Karma: 311
Posts: 35470
Seattle, WA USA
|
 |
« Reply #6 on: March 14, 2013, 10:08:59 am » |
Somewhere or other, a dot got lost.
I change WProgram.h to Arduino.h, in an include statement.
If you still have errors, you need to post them.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 21
|
 |
« Reply #7 on: March 14, 2013, 10:09:23 am » |
Did you go into the .h file and actually change WProgram.h to Arduino.h?
i dont get it, how to do that?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 21
|
 |
« Reply #8 on: March 14, 2013, 10:12:13 am » |
Somewhere or other, a dot got lost.
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
|
|
|
|
|
Logged
|
|
|
|
|
Seattle, WA USA
Offline
Brattain Member
Karma: 311
Posts: 35470
Seattle, WA USA
|
 |
« Reply #9 on: March 14, 2013, 10:14:59 am » |
i dont get it, how to do that? Perhaps, if you used capital letters, like a big boy... Use any text editor.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 21
|
 |
« Reply #10 on: March 14, 2013, 10:16:16 am » |
i dont get it, how to do that? Perhaps, if you used capital letters, like a big boy... Use any text editor. #include <IRremote.h> #include <IRremoteInt.h> #include <Servo.h> #include "Arduino.h" I have put these, but the error still came. why?
|
|
|
|
|
Logged
|
|
|
|
|
Queens, New York
Offline
Edison Member
Karma: 27
Posts: 1537
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
|
 |
« Reply #11 on: March 14, 2013, 10:17:39 am » |
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.
|
|
|
|
|
Logged
|
UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W, Gameduino
Arduino Tutorials, coming soon.
"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 21
|
 |
« Reply #12 on: March 14, 2013, 10:21:27 am » |
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. 
|
|
|
|
|
Logged
|
|
|
|
|
|