-1

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();
  }
}
Azhar Khan
  • 3,829
  • 11
  • 26
  • 32
  • Welcome to Stackoverflow. The full error message should point you to some lines in your code. If you think it doesn‘t please post it here in full. This greatly increases the probability of getting meaningful answers. – Grimaldi Feb 05 '23 at 19:23

1 Answers1

0

I copy pasted your code and it compiled just fine for the ATTiny85. Try redownloading that library using the library manager in the IDE

Roman
  • 124
  • 6