I'm hoping this will be an easy question :
I am running a little program on an arduino to flash some leds randomly. This works fine on my arduino board with an atmel 8. I ordered two new arduini from Sparkfun and they came with atmel 168 and now my code doesn't work. I am sure this is a problem with the new boards as I am running the exact same program, just picking up the breadboard shield and moving from the atmel 8 to the atmel 168... then it doesn't work. Here is the code, changed just a bit from the example: is there a change I need to make for these new boards?
//**************************************************************//
// Name : shiftOutCode, Hello World //
// Author : Carlyn Maw,Tom Igoe //
// Date : 25 Oct, 2006 //
// Version : 1.0 //
// Notes : Code for using a 74HC595 Shift Register //
// : to count from 0 to 255 //
//****************************************************************
//Pin connected to ST_CP of 74HC595
int latchPin = 8;
//Pin connected to SH_CP of 74HC595
int clockPin = 12;
////Pin connected to DS of 74HC595
int dataPin = 11;
int time;
long randNumber;
long srandNumber;
void setup() {
//set pins to output because they are addressed in the main loop
pinMode(latchPin, OUTPUT);
pinMode(clockPin, OUTPUT);
pinMode(dataPin, OUTPUT);
}
void loop() {
time = millis();
randomSeed(time);
// return a random number from 0 - 300
randNumber = random(300);
srandNumber = random(300);
//ground latchPin and hold low for as long as you are transmitting
digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, LSBFIRST, randNumber);
shiftOut(dataPin, clockPin, LSBFIRST, srandNumber);
//return the latch pin high to signal chip that it
//no longer needs to listen for information
digitalWrite(latchPin, HIGH);
delay(1200);
}