Hi folks, first let me start by saying that I am very new to Arduino, and microcontrollers in general. I've played around with Picaxe for a few weeks and learned quite a bit, but now I feel like I'm starting all over, but that's ok, as I love to challenge myself Just be advised I have NO formal training in programming.
I've recently taken up model building and my ultimate goal is to create a few simple programs to control LED lighting effects in Star Trek model ships, like ramping up and fading LEDs with button presses from a momentary switch and blinking LEDs on two outputs at different rates simultaneously.
Long story short, I've built myself a little Arduino shield to program attiny85s using the Arduino as an ISP. I found this "example sketch" here--> ( http://www.gammon.com.au/forum/?id=11411 ) There's also a Library zip file which I cannot get to work, nor will the "sketch" compile
// Example of flashing multiple LEDs at different rates without delays
// Author: Nick Gammon
// Date: 23 December 2012
#include <LedFlasher.h>
// set up some LEDs
LedFlasher floodLight (8, 200, 300);
LedFlasher shuttleBayDoors (9, 300, 600);
LedFlasher impulseEngine (10, 900, 100);
LedFlasher strobe (11, 500, 1000);
LedFlasher navigation (12, 1000, 2000);
LedFlasher torpedoes (13, 250, 500);
void setup()
{
floodLight.begin ();
shuttleBayDoors.begin ();
impulseEngine.begin ();
strobe.begin ();
navigation.begin ();
torpedoes.begin ();
} // end of setup
void loop()
{
// update lights
floodLight.update ();
shuttleBayDoors.update ();
impulseEngine.update ();
strobe.update ();
navigation.update ();
torpedoes.update ();
// do other useful stuff here ...
} // end of loop
But I don't need all of that code, as I do not need to control that many LEDs, so I've modified it to suit my needs for the attiny85........
// set up some leds
#include LedFlasher strobe (2, 500, 70); // pin2 off for 500 mS, on for 70 mS
#include LedFlasher navigation (3, 1200, 1200); //pin 3 off for 1200 ms on for 1200 ms
void setup()
{
strobe.begin ();
navigation.begin ();
} // end of setup
void loop()
{
// update lights
strobe.update ();
navigation.update ();
} //end of loop
Is it a major operation to transform that into a workable sketch???