Offline
Newbie
Karma: 0
Posts: 11
|
 |
« Reply #5 on: February 23, 2012, 08:48:44 am » |
Bought the Tiny shield...Nicely constructed piece!
But, i have an UNO SMD WITH NO SERIAL NUMBER - WILL IT WORK? see 10A.
I ran the arduino as ISP-tinyShield Un-mounted on Ardy (NO SERIAL NUM ON BOARD)
Wrote a litttle rg Not b, candle routine running off pins 9 and 10(red and green) to produce yellow/orange with common anode RGB LED.
1. ran fine on arduino; 2 mounted attiny85 on TSboard ; 3. While TS unmounted , ran ISP on Arduno (SMD Edition) using Arduino UNO and Comm3; 4. No errors, but no indication it took; 5.loaded my program and changed pins 9->0,10 ->1; 6. Using for (i=0; i<1;i++); /* to set pin mode, and later send PWM values. .what c commands does the AtTiny 85 understand? */ 7. Mounted TS On Ardy 8. Chose Attiny85 w/Ardy as ISP 10. Tried uploading program to Attiny85 on TS...see errors at the end.
10A. As per many instructions re Ardy UNO, while programming the AtTiny 85, there needs to be a 10mfd electolytic condenser between gnd and reset....OR an ~120 ohm resister between reset and 5v.....do I need to do this with your board, or have you compensated for the UNO? I notice what might be a resistor between 3.5v and gnd.
11. I see no real explanation of the red, blue and white LEDs on you(our) board, unless they are the LEDs suggested AT THE TOP in the arduino as ISP SKETCH.
12.See below when I uploaded....please advise -–--------
// Output (anode to digital gnd- using common anode RGB LEDS, (thus the reversed PWM values)R,G,B attached to PWM 9,10,11, re-pgm'd for AtTiny PWM 0,1 as below )
int i=0; int redPin = 0; // Red LED, connected to digital pin 0 int grnPin = 1; // Green LED, connected to digital pin 10
int PiN[2] = { 0,1}; // Color arrays int white[3] = { 0, 0, 0 }; int black[3] = { 255,255,255}; int red[3] = { 100, 250, 0 }; int green[3] = { 0, 100, 0 }; int blue[3] = { 0, 0, 100 }; int yellow[3] = { 85, 200, 255 }; int dimWhite[3] = { 30, 30, 30 }; int rndVal;
int redVal = white[0]; int grnVal = white[1]; int bluVal = white[2];
int wait = 100; int hold = 0; // Optional hold when a color is complete, before the next crossFade int DEBUG = 1; // DEBUG counter; if set to 1, will write values back via serial
// Set up the LED outputs void setup() { pinMode(0, OUTPUT); // sets the pins as output pinMode(1, OUTPUT); // sets the pins as output
}
// Main program: list the order of crossfades void loop() { for (i=0; i <2; i++) {
analogWrite(PiN, yellow); // showNum(PiN,yellow); } Rando(3540); for (i=0; i < 2; i++) { // Rando(); analogWrite(PiN, black); // showNum(PiN,black); } Rando(25); }
void Rando(int seed) { // randomSeed(analogRead(0));
delay(int(random(seed))); } /* void showNum(int pinNum,int value) { if (DEBUG) { // If we want serial output, print it at the Serial.print("pin# "); Serial.print(pinNum); Serial.print("Color= "); Serial.println(value); DEBUG += 1; } } */
-------------------------------------
RGB_FLAME_cAnode_AtTiny85.cpp:4:21: error: Arduino.h: No such file or directory RGB_FLAME_cAnode_AtTiny85.cpp: In function 'void setup()': RGB_FLAME_cAnode_AtTiny85:30: error: 'OUTPUT' was not declared in this scope RGB_FLAME_cAnode_AtTiny85:30: error: 'pinMode' was not declared in this scope RGB_FLAME_cAnode_AtTiny85.cpp: In function 'void loop()': RGB_FLAME_cAnode_AtTiny85:44: error: 'analogWrite' was not declared in this scope RGB_FLAME_cAnode_AtTiny85:53: error: 'analogWrite' was not declared in this scope RGB_FLAME_cAnode_AtTiny85.cpp: In function 'void Rando(int)': RGB_FLAME_cAnode_AtTiny85:66: error: 'random' was not declared in this scope RGB_FLAME_cAnode_AtTiny85:66: error: 'delay' was not declared in this scope
As I said, please advise
chas
|