loading

Why isn't my ATTiny85 accepting this SoftwareSerial???!?

My code is from the IR Cloud light instructable. I am trying to place a smaller, more abbreviated code into an ATTiny85. The tutorial written by MIT says we can put SoftWareSerial on it (reference: http://hlt.media.mit.edu/?p=1695). But anyway, Code:


#include <IRremote.h>

int RECV_PIN = 0;
int green = 4;
int yellow = 2;
int blue = 3;
int white = 1;

#define powercode 16712445
#define stormcode 16745085                




IRrecv irrecv(RECV_PIN);
decode_results results;

void setup()
{
  pinMode(green, OUTPUT);
    pinMode(yellow, OUTPUT);
        pinMode(blue, OUTPUT);
            pinMode(white, OUTPUT);
  irrecv.enableIRIn(); // Start the receiver
}

int whitebool = 0;
int rainbool = 0;
int yellowbool = 0;
int bluebool = 0;
int greenbool = 0;

unsigned long last = millis();

void loop() {
  if (irrecv.decode(&results)) {
   
                
//Sun

if (results.value == 16712445) {
      if (millis() - last > 250) {
        whitebool = !whitebool;
        digitalWrite(white, whitebool ? HIGH : LOW);
      }
      last = millis();
    }
   
//red
      if (results.value == 16745085) {
      if (millis() - last > 250) {
        greenbool = !greenbool;
        digitalWrite(green, greenbool ? HIGH : LOW);
      }
      last = millis();
    }
//yellow
    if (results.value == 16726725) { // Sun up
      // If it's been at least 1/4 second since the last
      // IR received, toggle the relay
      if (millis() - last > 250) {
        yellowbool = !yellowbool;
        digitalWrite(yellow, yellowbool ? HIGH : LOW);
      }
      last = millis();
    }
//blue
        if (results.value == 16759365) { // Sun up
      // If it's been at least 1/4 second since the last
      // IR received, toggle the relay
      if (millis() - last > 250) {
        bluebool = !bluebool;
        digitalWrite(blue, bluebool ? HIGH : LOW);
      }
      last = millis();
    }
    irrecv.resume(); // Receive the next value
  }
 
 
}




And error :

/Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp: In member function 'void IRsend::mark(int)':
/Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:227: error: 'TCCR2A' was not declared in this scope
/Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:227: error: 'COM2B1' was not declared in this scope
/Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp: In member function 'void IRsend::space(int)':
/Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:235: error: 'TCCR2A' was not declared in this scope
/Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:235: error: 'COM2B1' was not declared in this scope
/Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp: In member function 'void IRsend::enableIROut(int)':
/Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:253: error: 'TIMSK2' was not declared in this scope
/Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:263: error: 'TCCR2A' was not declared in this scope
/Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:263: error: 'WGM20' was not declared in this scope
/Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:263: error: 'TCCR2B' was not declared in this scope
/Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:263: error: 'WGM22' was not declared in this scope
/Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:263: error: 'CS20' was not declared in this scope
/Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:263: error: 'OCR2A' was not declared in this scope
/Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:263: error: 'OCR2B' was not declared in this scope
/Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp: In member function 'void IRrecv::enableIRIn()':
/Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:279: error: 'TCCR2A' was not declared in this scope
/Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:279: error: 'WGM21' was not declared in this scope
/Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:279: error: 'TCCR2B' was not declared in this scope
/Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:279: error: 'CS21' was not declared in this scope
/Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:279: error: 'OCR2A' was not declared in this scope
/Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:279: error: 'TCNT2' was not declared in this scope
/Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:282: error: 'TIMSK2' was not declared in this scope
/Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:282: error: 'OCIE2A' was not declared in this scope



What's the big idea??? If this is way too deep, I'll just use an Arduino Uno for this project... I just really want this to be tiny. :(

sort by: active | newest | oldest
This might help
http://ubiyubix.wordpress.com/2012/05/05/porting-the-arduino-irremote-library-to-the-attiny4313/
pyates1 (author) 4 years ago
Pardon my ignorance, but it was my understanding that the irrecv.enableIRIn(); was some sort of serial system. It took the IR signal and made it to readable code for the program.

When I look at the MAKE magazines' video of the ATTiny tutorial I see another guy in the comments with this problem...

It seems like the ATTiny 85 isn't capable of including libraries into the chip. I am so new to this stuff... Thanks again
IRremote is an entire library for handling basic IR comms. Yes, Its A SORT of "serial comms", but when you invoke "softwareserial" in the title of your question, I am forced to thinking you really ARE using software serial to talk to a terminal program.

The Attiny is PERFECTLY capable of including libraries, but they have to be pretty tiny ones to begin with, and they HAVE to be designed to talk to the tiny's limited hardware resources. The link I've given you should really help.

You can make a VERY small arduino with the Atmega328......
pyates1 (author)  steveastrouk4 years ago
Wow thanks a lot, this is very enlightening... I'll finish the project with the UNO but I'll look in to this! Thank you so much for your time!
Ah, you'll have to hack the IRremote library, because the Attiny doesn;t HAVE 2 timers, and the code uses them. You could look at the library and see how the remote is implemented - if they only use one timer, you can change all the references to the 2nd back to 0.
Do you have the Attiny set as your target processor ?
pyates1 (author)  steveastrouk4 years ago
I do... I followed the video that MAKE had made (which has worked with other projects).... I also selected the board to be the ATTiny85 (w/ 8 MHz Internal clock) as well... Shouldn't it work??

Thank you!
pyates1 (author)  pyates14 years ago
Possibly, does it matter that the IR Receive pin MUST be pin 11??? I am unfamiliar with including other codes in sketches