Why would this code.. [Solved]

Why would this code

``````/*
LED Candle
Mercilessly Hacked By Doc Edison
Makes an LED pulse randomly to simulate a candles flame. Takes a series of values and randomly
generates sets of pulses with varied brightness and frequency within these values.

"by A Green for x2Jiggy.com"

*/

int ledPin = 1; // Pin the LED is connected to
int pulseMin = 2; // Minimum number of pulses in each set
int pulseMax = 9; // Maximum number of pulses in each set
int brightMin = 16; // Baseline LED brightness. Cannot exceed 128.
int minDelay = 1000; // Minimum delay between pulse sets (ms)
int maxDelay = 5000; // Maximum delay between pulse sets (ms)
void setup()
{
randomSeed (analogRead (3)); // Randomise  pinMode(ledPin, OUTPUT); // Sets LED Pin to be an output
}
void loop()
{
// For loop sets the number of pulses and repeats these pulses
for (int x = random(pulseMin, pulseMax); x > 0; x-- )
{
int bright = 224 - random(96); // Sets a random maximum brightness level for this pulse
// For loop raises the brightness of the LED from minimum to maximum value
for (int y = brightMin; y < bright ; y++)
{
analogWrite(ledPin, y);
delay(3);
}
// For loop lowers the brightness of the LED from maximum to minimum value
for (int y = bright; y > brightMin; y--)
{
analogWrite(ledPin, y);
delay(3);
}
delay(10); // Adds a delay between pulses to make them more visible
}
analogWrite(ledPin, brightMin);
delay(random(minDelay,maxDelay)); // Adds a delay between pulse sets
}
``````

Behave radically different… On a Tiny 85 @ 1 MHz internal clock and the same code on a Tiny 85 @ 8 MHz internal clock?
With the 8 MHz internal clock the lighting effects are slow and gradual and with the 1 MHz internal clock the lighting effects are speeded up and stacatto in appearance… As if the delay period was too short.
Starting from a bare chip 1. burn the bootloader (set the right fuses) 2. load the code via Arduino as ISP. Not trying to change the fuses and use the loaded code.
I would like to use the 85 core for some small jobs but I need to understand why this happens first.
And how do I get rid of this error message?

avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny85

Doc
BTW for once MR Google was less that helpful… I thought he was tired so I tried several times later… No Luck At All
Some time later…
But Jack Christensen Was most helpful…
« Reply #13 on: October 27, 2012, 01:11:21 PM »
{Edited for brevity}… Last paragraph.

As long as the fuses burned in the MCU match the f_cpu for the selected boards.txt entry, delay(1000) should give a one-second delay with either a 1MHz or 8MHz system clock, so something is amiss here. Your symptoms could be explained if the fuses were set to provide an 8MHz clock, but a 1MHz board was selected in the IDE. Simply changing the board in the IDE does not alter the system clock frequency setting in the hardware. “Burn bootloader” will do that.

Doc

avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny85

common error that I get every time on a tiny for years, safe to ignore

as far as your led issue, it may be taking so much time at 1mhz to update that it just jumps, were as 8 times the speed it smooths over it

Thank You, Sir… My mental processes are somewhat slow today for some reason… A little thought and some reading brought me to the conclusion that I had selected the board properly for programming… everything but the right fuses.

Doc