Attiny85 based 1 channel ir controll

hiii
i was making digisparks attiny85 based remote controlled simple switch
here is the code but i cant compile , there is tons ofs erorrs..
how can i fix can anyone help...??

#include <IRremote.h>

int RECV_PIN = 0; // Pin connected to the IR receiver
int RELAY_PIN = 1; // Pin connected to the relay

IRrecv irrecv(RECV_PIN);
decode_results results;

bool relayState = false; // Initial state: relay off

void setup() {
  irrecv.enableIRIn(); // Start the IR receiver
  pinMode(RELAY_PIN, OUTPUT);
  digitalWrite(RELAY_PIN, LOW); // Initial state: relay off
}

void loop() {
  if (irrecv.decode(&results)) {
    relayState = !relayState; // Toggle the relay state
    digitalWrite(RELAY_PIN, relayState ? HIGH : LOW); // Set the relay state
    irrecv.resume(); // Receive the next value
  }
}

That usually does not sound like "avrdude, stk500, bootloaderissues"; topic moved to a more suitable location on the forum.

By showing the errors ?

The IRremote library has significantly changed; which version are you using? Going back to version 2.x (or earlier) might solve the errors.

1 Like

thnks for the replay.. im new here
sry for topic issuse
there is lots off erorr
im using lateast ir laibrey
when i downgarde the laibrey to 4.0 and change the board type to attiny85 it compille .. but when i change to digispearks attiny85 erorrs .
i have to change irremote.h to .cpp or .hpp..?

In file included from c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRremoteInt.h:124:0,
                 from c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRremote.hpp:256,
                 from c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRremote.h:10,
                 from C:\Users\nagmani\Documents\Arduino\New folder\ir\ir.ino:1:
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRProtocol.h:161:7: error: '__FlashStringHelper' does not name a type
 const __FlashStringHelper* getProtocolString(decode_type_t aProtocol);
       ^
In file included from c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRremote.hpp:256:0,
                 from c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRremote.h:10,
                 from C:\Users\nagmani\Documents\Arduino\New folder\ir\ir.ino:1:
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRremoteInt.h:234:11: error: '__FlashStringHelper' does not name a type
     const __FlashStringHelper* getProtocolString();
           ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRremoteInt.h:363:1: error: 'constexpr' does not name a type
 constexpr auto enableLEDFeedbackForReceive = enableLEDFeedback; // alias for enableLEDFeedback
 ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRremoteInt.h:363:1: note: C++11 'constexpr' only available with -std=c++11 or -std=gnu++11
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRremoteInt.h:365:1: error: 'constexpr' does not name a type
 constexpr auto disableLEDFeedbackForReceive = disableLEDFeedback; // alias for enableLEDFeedback
 ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRremoteInt.h:365:1: note: C++11 'constexpr' only available with -std=c++11 or -std=gnu++11
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRremoteInt.h:554:27: error: '__FlashStringHelper' does not name a type
     void sendPronto(const __FlashStringHelper *str, int_fast8_t aNumberOfRepeats = NO_REPEATS);
                           ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRremoteInt.h:554:48: error: ISO C++ forbids declaration of 'str' with no type [-fpermissive]
     void sendPronto(const __FlashStringHelper *str, int_fast8_t aNumberOfRepeats = NO_REPEATS);
                                                ^
In file included from c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRremote.hpp:283:0,
                 from c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRremote.h:10,
                 from C:\Users\nagmani\Documents\Arduino\New folder\ir\ir.ino:1:
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRProtocol.hpp:91:7: error: '__FlashStringHelper' does not name a type
 const __FlashStringHelper* getProtocolString(decode_type_t aProtocol) {
       ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRProtocol.hpp: In function 'void printIRResultShort(Print*, IRData*, bool)':
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRProtocol.hpp:168:58: error: 'getProtocolString' was not declared in this scope
     aSerial->print(getProtocolString(aIRDataPtr->protocol));
                                                          ^
In file included from c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRremote.hpp:285:0,
                 from c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRremote.h:10,
                 from C:\Users\nagmani\Documents\Arduino\New folder\ir\ir.ino:1:
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRReceive.hpp: In function 'void IRReceiveTimerInterruptHandler()':
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRReceive.hpp:147:38: error: 'UINT16_MAX' was not declared in this scope
     if (irparams.TickCounterForISR < UINT16_MAX) {
                                      ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRReceive.hpp: In member function 'bool IRrecv::decodePulseDistanceWidthData(uint_fast8_t, IRRawlenType, uint16_t, uint16_t, uint16_t, uint16_t, bool)':
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRReceive.hpp:706:11: error: ISO C++ forbids declaration of 'tRawBufPointer' with no type [-fpermissive]
     auto *tRawBufPointer = &decodedIRData.rawDataPtr->rawbuf[aStartOffset];
           ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRReceive.hpp:706:74: error: invalid conversion from 'uint16_t* {aka unsigned int*}' to 'int*' [-fpermissive]
     auto *tRawBufPointer = &decodedIRData.rawDataPtr->rawbuf[aStartOffset];
                                                                          ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRReceive.hpp: In member function 'void IRrecv::printIRSendUsage(Print*)':
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRReceive.hpp:1299:40: error: 'getProtocolString' was not declared in this scope
         Serial.print(getProtocolString());
                                        ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRReceive.hpp:1345:46: error: 'getProtocolString' was not declared in this scope
             aSerial->print(getProtocolString());
                                              ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRReceive.hpp: In member function 'void IRrecv::printIRResultRawFormatted(Print*, bool)':
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRReceive.hpp:1507:14: error: 'tCurrentTicks' does not name a type
         auto tCurrentTicks = decodedIRData.rawDataPtr->rawbuf[i];
              ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRReceive.hpp:1509:25: error: 'tCurrentTicks' was not declared in this scope
             tDuration = tCurrentTicks * MICROS_PER_TICK;
                         ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRReceive.hpp:1511:25: error: 'tCurrentTicks' was not declared in this scope
             tDuration = tCurrentTicks;
                         ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRReceive.hpp:1513:32: error: 'tCurrentTicks' was not declared in this scope
         tSumOfDurationTicks += tCurrentTicks; // compute length of protocol frame
                                ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRReceive.hpp: In member function 'void IRrecv::compensateAndPrintIRResultAsCArray(Print*, bool)':
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRReceive.hpp:1592:32: error: 'UINT8_MAX' was not declared in this scope
             tTicks = (tTicks > UINT8_MAX) ? UINT8_MAX : tTicks;
                                ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRReceive.hpp: In member function 'void IRrecv::compensateAndStoreIRResultInArray(uint8_t*)':
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRReceive.hpp:1633:32: error: 'UINT8_MAX' was not declared in this scope
         *aArrayPtr = (tTicks > UINT8_MAX) ? UINT8_MAX : tTicks; // we store it in an 8 bit array
                                ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRReceive.hpp: At global scope:
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRReceive.hpp:1676:7: error: '__FlashStringHelper' does not name a type
 const __FlashStringHelper* IRrecv::getProtocolString() {
       ^
In file included from c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRremote.hpp:287:0,
                 from c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRremote.h:10,
                 from C:\Users\nagmani\Documents\Arduino\New folder\ir\ir.ino:1:
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp: In member function 'size_t IRsend::write(IRData*, int_fast8_t)':
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:172:10: error: 'tProtocol' does not name a type
     auto tProtocol = aIRSendData->protocol;
          ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:173:10: error: 'tAddress' does not name a type
     auto tAddress = aIRSendData->address;
          ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:174:10: error: 'tCommand' does not name a type
     auto tCommand = aIRSendData->command;
          ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:214:9: error: 'tProtocol' was not declared in this scope
     if (tProtocol == NEC) {
         ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:215:17: error: 'tAddress' was not declared in this scope
         sendNEC(tAddress, tCommand, aNumberOfRepeats);
                 ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:215:27: error: 'tCommand' was not declared in this scope
         sendNEC(tAddress, tCommand, aNumberOfRepeats);
                           ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:218:21: error: 'tAddress' was not declared in this scope
         sendSamsung(tAddress, tCommand, aNumberOfRepeats);
                     ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:218:31: error: 'tCommand' was not declared in this scope
         sendSamsung(tAddress, tCommand, aNumberOfRepeats);
                               ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:221:23: error: 'tAddress' was not declared in this scope
         sendSamsung48(tAddress, tCommand, aNumberOfRepeats);
                       ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:221:33: error: 'tCommand' was not declared in this scope
         sendSamsung48(tAddress, tCommand, aNumberOfRepeats);
                                 ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:224:23: error: 'tAddress' was not declared in this scope
         sendSamsungLG(tAddress, tCommand, aNumberOfRepeats);
                       ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:224:33: error: 'tCommand' was not declared in this scope
         sendSamsungLG(tAddress, tCommand, aNumberOfRepeats);
                                 ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:227:18: error: 'tAddress' was not declared in this scope
         sendSony(tAddress, tCommand, aNumberOfRepeats, aIRSendData->numberOfBits);
                  ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:227:28: error: 'tCommand' was not declared in this scope
         sendSony(tAddress, tCommand, aNumberOfRepeats, aIRSendData->numberOfBits);
                            ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:230:23: error: 'tAddress' was not declared in this scope
         sendPanasonic(tAddress, tCommand, aNumberOfRepeats);
                       ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:230:33: error: 'tCommand' was not declared in this scope
         sendPanasonic(tAddress, tCommand, aNumberOfRepeats);
                                 ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:233:19: error: 'tAddress' was not declared in this scope
         sendDenon(tAddress, tCommand, aNumberOfRepeats);
                   ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:233:29: error: 'tCommand' was not declared in this scope
         sendDenon(tAddress, tCommand, aNumberOfRepeats);
                             ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:236:19: error: 'tAddress' was not declared in this scope
         sendSharp(tAddress, tCommand, aNumberOfRepeats);
                   ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:236:29: error: 'tCommand' was not declared in this scope
         sendSharp(tAddress, tCommand, aNumberOfRepeats);
                             ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:239:16: error: 'tAddress' was not declared in this scope
         sendLG(tAddress, tCommand, aNumberOfRepeats);
                ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:239:26: error: 'tCommand' was not declared in this scope
         sendLG(tAddress, tCommand, aNumberOfRepeats);
                          ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:242:27: error: 'tAddress' was not declared in this scope
         sendJVC((uint8_t) tAddress, (uint8_t) tCommand, aNumberOfRepeats); // casts are required to specify the right function
                           ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:242:47: error: 'tCommand' was not declared in this scope
         sendJVC((uint8_t) tAddress, (uint8_t) tCommand, aNumberOfRepeats); // casts are required to specify the right function
                                               ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:245:17: error: 'tAddress' was not declared in this scope
         sendRC5(tAddress, tCommand, aNumberOfRepeats, !tIsRepeat); // No toggle for repeats
                 ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:245:27: error: 'tCommand' was not declared in this scope
         sendRC5(tAddress, tCommand, aNumberOfRepeats, !tIsRepeat); // No toggle for repeats
                           ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:248:17: error: 'tAddress' was not declared in this scope
         sendRC6(tAddress, tCommand, aNumberOfRepeats, !tIsRepeat); // No toggle for repeats
                 ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:248:27: error: 'tCommand' was not declared in this scope
         sendRC6(tAddress, tCommand, aNumberOfRepeats, !tIsRepeat); // No toggle for repeats
                           ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:251:26: error: 'tAddress' was not declared in this scope
         sendKaseikyo_JVC(tAddress, tCommand, aNumberOfRepeats);
                          ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:251:36: error: 'tCommand' was not declared in this scope
         sendKaseikyo_JVC(tAddress, tCommand, aNumberOfRepeats);
                                    ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:254:28: error: 'tAddress' was not declared in this scope
         sendKaseikyo_Denon(tAddress, tCommand, aNumberOfRepeats);
                            ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:254:38: error: 'tCommand' was not declared in this scope
         sendKaseikyo_Denon(tAddress, tCommand, aNumberOfRepeats);
                                      ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:257:28: error: 'tAddress' was not declared in this scope
         sendKaseikyo_Sharp(tAddress, tCommand, aNumberOfRepeats);
                            ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:257:38: error: 'tCommand' was not declared in this scope
         sendKaseikyo_Sharp(tAddress, tCommand, aNumberOfRepeats);
                                      ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:260:33: error: 'tAddress' was not declared in this scope
         sendKaseikyo_Mitsubishi(tAddress, tCommand, aNumberOfRepeats);
                                 ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:260:43: error: 'tCommand' was not declared in this scope
         sendKaseikyo_Mitsubishi(tAddress, tCommand, aNumberOfRepeats);
                                           ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:263:18: error: 'tAddress' was not declared in this scope
         sendNEC2(tAddress, tCommand, aNumberOfRepeats);
                  ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:263:28: error: 'tCommand' was not declared in this scope
         sendNEC2(tAddress, tCommand, aNumberOfRepeats);
                            ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:266:19: error: 'tAddress' was not declared in this scope
         sendOnkyo(tAddress, tCommand, aNumberOfRepeats);
                   ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:266:29: error: 'tCommand' was not declared in this scope
         sendOnkyo(tAddress, tCommand, aNumberOfRepeats);
                             ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:269:19: error: 'tAddress' was not declared in this scope
         sendApple(tAddress, tCommand, aNumberOfRepeats);
                   ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:269:29: error: 'tCommand' was not declared in this scope
         sendApple(tAddress, tCommand, aNumberOfRepeats);
                             ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:273:22: error: 'tCommand' was not declared in this scope
         sendBoseWave(tCommand, aNumberOfRepeats);
                      ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:277:52: error: 'tCommand' was not declared in this scope
         sendMagiQuest(aIRSendData->decodedRawData, tCommand);
                                                    ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:281:18: error: 'tCommand' was not declared in this scope
         sendFAST(tCommand, aNumberOfRepeats);
                  ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:284:32: error: 'tAddress' was not declared in this scope
         sendLegoPowerFunctions(tAddress, tCommand, tCommand >> 4, tIsRepeat); // send 5 autorepeats
                                ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:284:42: error: 'tCommand' was not declared in this scope
         sendLegoPowerFunctions(tAddress, tCommand, tCommand >> 4, tIsRepeat); // send 5 autorepeats
                                          ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp: In member function 'void IRsend::sendRaw_P(const uint16_t*, uint_fast16_t, uint_fast8_t)':
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:465:14: error: 'duration' does not name a type
         auto duration = pgm_read_word(&aBufferWithMicroseconds[i]);
              ^
In file included from C:\Users\nagmani\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny/pins_arduino.h:31:0,
                 from C:\Users\nagmani\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny/WProgram.h:13,
                 from C:\Users\nagmani\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny/Arduino.h:4,
                 from C:\Users\nagmani\AppData\Local\Temp\arduino\sketches\DEC7B797AC2382832F0143E854481C29\sketch\ir.ino.cpp:1:
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:465:25: error: expected primary-expression before ')' token
         auto duration = pgm_read_word(&aBufferWithMicroseconds[i]);
                         ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:465:25: error: expected ';' before ')' token
In file included from c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRremote.hpp:287:0,
                 from c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRremote.h:10,
                 from C:\Users\nagmani\Documents\Arduino\New folder\ir\ir.ino:1:
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:468:19: error: 'duration' was not declared in this scope
             space(duration);
                   ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:473:18: error: 'duration' was not declared in this scope
             mark(duration);
                  ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp: In member function 'void IRsend::sendPulseDistanceWidthFromArray(uint_fast8_t, uint16_t, uint16_t, uint16_t, uint16_t, uint16_t, uint16_t, IRRawDataType*, uint16_t, uint8_t, uint16_t, int_fast8_t)':
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:592:18: error: 'tFrameDurationMillis' does not name a type
             auto tFrameDurationMillis = millis() - tStartOfFrameMillis;
                  ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:593:39: error: 'tFrameDurationMillis' was not declared in this scope
             if (aRepeatPeriodMillis > tFrameDurationMillis) {
                                       ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp: In member function 'void IRsend::sendPulseDistanceWidthFromArray(PulseDistanceWidthProtocolConstants*, IRRawDataType*, uint16_t, int_fast8_t)':
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:639:14: error: 'tStartOfFrameMillis' does not name a type
         auto tStartOfFrameMillis = millis();
              ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:640:14: error: 'tNumberOfBits' does not name a type
         auto tNumberOfBits = aNumberOfBits; // refresh value for repeats
              ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:653:43: error: 'tNumberOfBits' was not declared in this scope
                 tNumberOfBitsForOneSend = tNumberOfBits;
                                           ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:666:13: error: 'tNumberOfBits' was not declared in this scope
             tNumberOfBits -= BITS_IN_RAW_DATA_TYPE;
             ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:675:18: error: 'tFrameDurationMillis' does not name a type
             auto tFrameDurationMillis = millis() - tStartOfFrameMillis;
                  ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:676:58: error: 'tFrameDurationMillis' was not declared in this scope
             if (aProtocolConstants->RepeatPeriodMillis > tFrameDurationMillis) {
                                                          ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp: In member function 'void IRsend::sendPulseDistanceWidth(PulseDistanceWidthProtocolConstants*, IRRawDataType, uint_fast8_t, int_fast8_t)':
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:737:18: error: 'tCurrentFrameDurationMillis' does not name a type
             auto tCurrentFrameDurationMillis = millis() - tStartOfFrameMillis;
                  ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:741:58: error: 'tCurrentFrameDurationMillis' was not declared in this scope
             if (aProtocolConstants->RepeatPeriodMillis > tCurrentFrameDurationMillis) {
                                                          ^
In file included from c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRremote.hpp:287:0,
                 from c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRremote.h:10,
                 from C:\Users\nagmani\Documents\Arduino\New folder\ir\ir.ino:1:
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp: In member function 'void IRsend::sendPulseDistanceWidth(uint_fast8_t, uint16_t, uint16_t, uint16_t, uint16_t, uint16_t, uint16_t, IRRawDataType, uint_fast8_t, uint8_t, uint16_t, int_fast8_t, void (*)())':
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:796:18: error: 'tFrameDurationMillis' does not name a type
             auto tFrameDurationMillis = millis() - tStartOfFrameMillis;
                  ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRSend.hpp:797:39: error: 'tFrameDurationMillis' was not declared in this scope
             if (aRepeatPeriodMillis > tFrameDurationMillis) {
                                       ^
In file included from c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRremote.hpp:306:0,
                 from c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRremote.h:10,
                 from C:\Users\nagmani\Documents\Arduino\New folder\ir\ir.ino:1:
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/ir_Pronto.hpp: In member function 'void IRsend::sendPronto(const uint16_t*, uint16_t, int_fast8_t)':
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/ir_Pronto.hpp:102:49: error: 'UINT16_MAX' was not declared in this scope
         durations[i] = (uint16_t) ((duration <= UINT16_MAX) ? duration : UINT16_MAX);
                                                 ^
In file included from c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRremote.hpp:306:0,
                 from c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRremote.h:10,
                 from C:\Users\nagmani\Documents\Arduino\New folder\ir\ir.ino:1:
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/ir_Pronto.hpp: At global scope:
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/ir_Pronto.hpp:190:31: error: '__FlashStringHelper' does not name a type
 void IRsend::sendPronto(const __FlashStringHelper *str, int_fast8_t aNumberOfRepeats) {
                               ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/ir_Pronto.hpp:190:52: error: ISO C++ forbids declaration of 'str' with no type [-fpermissive]
 void IRsend::sendPronto(const __FlashStringHelper *str, int_fast8_t aNumberOfRepeats) {
                                                    ^
In file included from c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRremote.hpp:308:0,
                 from c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/IRremote.h:10,
                 from C:\Users\nagmani\Documents\Arduino\New folder\ir\ir.ino:1:
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/ir_DistanceWidthProtocol.hpp: In member function 'bool IRrecv::decodeDistanceWidth()':
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/ir_DistanceWidthProtocol.hpp:174:14: error: 'tDurationTicks' does not name a type
         auto tDurationTicks = decodedIRData.rawDataPtr->rawbuf[i];
              ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/ir_DistanceWidthProtocol.hpp:175:13: error: 'tDurationTicks' was not declared in this scope
         if (tDurationTicks < DURATION_ARRAY_SIZE) {
             ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/ir_DistanceWidthProtocol.hpp:221:14: error: 'tDurationTicks' does not name a type
         auto tDurationTicks = decodedIRData.rawDataPtr->rawbuf[i];
              ^
c:\Users\nagmani\Documents\Arduino\libraries\IRremote\src/ir_DistanceWidthProtocol.hpp:222:13: error: 'tDurationTicks' was not declared in this scope
         if (tDurationTicks < DURATION_ARRAY_SIZE) {
             ^

exit status 1

Compilation error: exit status 1

tons off erorrs

i did and it works with tinycore boards ...
i use avr programer to upload the code
after uploading the code nothing works..
remote function didnt work at all

Which board package do you use?
Do I understand you correctly that you can compile and upload without errors and it works as expected?

Did you install a board package for the digispark? If yes, please provide the URL. Else indicate which exact selection you made in tools / boards.

sry for confusiod
when i installed lower ver. of ir remote and select board type as ' attiny ' the code uploads without any erorr but the ir function didnt works i mean if i press the any buttion relay didnt on or off...

i did install digispark boards but i didnt find digisprk url in boars manager urls is nthis couse the erorr

You can not select 'attiny' of you did not have a board package for it installed. I would like to know which one.

How; you must have found it somewhere?


I'm not familiar with the ATtiny; I seem to know that there is something with 'clockwise' and 'counter-clockwise' counting of pins but I'm not sure of the details. You have to do some research to figure out if that might be the cause why the ATtiny code does not work. I apologise in advance if that is not the reason and I put you on the wrong track.

1 Like

1- maybe i mistakely deleted digispark url
after installing digispark board..
i noticed just now
i will install..

thnks for your help..

2- i have url for "attiny " board.
and i installed attiny board package
when program
i select attiny85 in "attiny" in board manager
selet clock 8mhz internal
program as usbasp
and program with avr programmer..

1.

Are you using one of the following Digispark Attiny85 Dev Boards (Fig-1 and Fig-2)?


Figure-1:


Figure-2:

2. Please, post hand drawn IR Receiver Circuit connected at DPin-0 of the ATtiny85 Dev Board.

figure 1

ir receiver to pb0

You have an IR Transmitter (TV Remote Controller) on your hand and an IR Receiver at the ATtiny85 side. I am asking for the circuit of the IR Receiver.

got it im trying to upload.. but im using mobile.. not pc. can i send photo of wireing

I have compiled your sketch of post #1 without any error except a warning of excessive memory usage.

Indicate the type number of the 3-pin IR Receiver/Decoder.

wow.. for digispark attiny85 board..?
it worked.?

are you using latest ver. of irreceiver ..?
or which ver.library you useing..?

Version: 4.3.1
IRremote-4.3.1.zip (1016.6 KB)

I am lucky to have an IR Receiver/Decoder from my old store and have tested your sketch of post #1; it works well.

awesome can you tell which version of irreciver library you are using