Okay so I am trying to program an Attiny84 using my arduino as the ISP. All is well and I am making sure I burn bootloader to 8mHZ on the Attiny84 to ensure SoftwareSerial is supported. That goes well. However when I try uploading or even verifying the sketch I get this error: 'class SoftwareSerial' has no member named 'parseInt'
Here is the code:
//pins for the LEDs:
const int redPin = 3;
const int greenPin = 5;
const int bluePin = 6;
const int redPin2 = 9;
const int greenPin2 = 10;
const int bluePin2 = 11;
#define REDPIN 3
#define GREENPIN 5
#define BLUEPIN 6
#define FADESPEED 5
#include <SoftwareSerial.h>
SoftwareSerial mySerial(3, 4 ); // RX, TX
void setup()
{
// initialize serial:
mySerial.begin(9600);
// make the pins outputs:
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
pinMode(redPin2, OUTPUT);
pinMode(greenPin2, OUTPUT);
pinMode(bluePin2, OUTPUT);
mySerial.print("Arduino control RGB LEDs Connected OK ( Sent From Arduinno Board )");
mySerial.print('\n');
}
void loop()
{
// if there's any serial available, read it:
while (mySerial.available() > 0)
{
int red = mySerial.parseInt();
int green = mySerial.parseInt();
int blue = mySerial.parseInt();
int red2 = mySerial.parseInt();
int green2 = mySerial.parseInt();
int blue2 = mySerial.parseInt();
// look for the newline. That's the end of your sentence:
if (mySerial.read() == '\n')
{
// constrain the values to 0 - 255 and invert
// if you're using a common-cathode LED, just use "constrain(color, 0, 255);"
// red = 255 - constrain(red, 0, 255);
// green = 255 - constrain(green, 0, 255);
// blue = 255 - constrain(blue, 0, 255);
red = constrain(red, 0, 255 );
green = constrain(green, 0, 255);
blue = constrain(blue, 0, 255);
red2 = constrain(red2, 0, 255);
green2 = constrain(green2, 0, 255);
blue2 = constrain(blue2, 0, 255);
// fade the red, green, and blue legs of the LED:
analogWrite(redPin, (255 - red));
analogWrite(greenPin, (255 - green));
analogWrite(bluePin, (255 - blue));
analogWrite(redPin2, (255 - red));
analogWrite(greenPin2, (255 - green));
analogWrite(bluePin2, (255 - blue));
// print the three numbers in one string as hexadecimal:
mySerial.print("Data Response : ");
mySerial.print(red, HEX);
mySerial.print(green, HEX);
mySerial.println(blue, HEX);
}
}
}
The code verifies and uploads fine using an Uno board but am getting this error when trying to switch to Attiny84 @8MHz. Any thoughts? Suggestions? Please.