I am attempting to upload my code to the ATTiny85, but whenever I do, I get this error.
Here is the error:
error: ISO C++ forbids declaration of 'str' with no type [-fpermissive]
void sendPronto(const __FlashStringHelper *str, unsigned int times = 1U);
Here is the code:
#include <IRremote.h>
int IRpin = 1;
IRrecv IR(IRpin);
//Motor 1 (Right) Backward Pin
const byte MOTOR1_BWD = 2;
//Motor 1 (Right) Forward Pin
const byte MOTOR1_FWD = 3;
decode_results cmd;
int speedpin = 5;
const byte spd = 255;
void stop() {
digitalWrite(MOTOR1_BWD, LOW);
digitalWrite(MOTOR1_FWD, LOW);
}
void back() {
digitalWrite(MOTOR1_BWD, HIGH);
digitalWrite(MOTOR1_FWD, LOW);
analogWrite(speedpin, spd);
}
void forward() {
digitalWrite(MOTOR1_BWD, LOW);
digitalWrite(MOTOR1_FWD, HIGH);
analogWrite(speedpin, spd);
}
void setup() {
IR.enableIRIn();
pinMode(MOTOR1_BWD, OUTPUT);
pinMode(MOTOR1_FWD, OUTPUT);
digitalWrite(MOTOR1_BWD, LOW);
digitalWrite(MOTOR1_FWD, LOW);
stop();
}
void loop() {
IR.resume();
if (cmd.value == 0xFF906F) {
forward();
}
if (cmd.value == 0xFFA25D) {
stop();
}
if (cmd.value == 0xFFE01F) {
back();
}
}