Tātad esmu uzmeistarojis kautko līdzīgu eglītei, nu vismaz es tā cerēju ka sanāks, bet cerēto nesasniedzu
Bet nu par to ko uzstaisīju , ir no LED , kartās līmes stienīšiem , daudz vadiem , ARDUINO , viss sākās ar to ka gribēju likt RGB (Red Green Blue) diodes , bet nesanāca dabūt , tapēc uzstaisīju tikai ar zilām , bet neslikti beigās izskatās
Kodi ir divi dažādi , tapēc lūk arī viņi :
1) kad vienkārši mirgo :
void setup()
{
pinMode(13, OUTPUT);
pinMode(12, OUTPUT);
pinMode(11, OUTPUT);
pinMode(10, OUTPUT);
pinMode(9, OUTPUT);
pinMode(8, OUTPUT);
pinMode(7, OUTPUT);
pinMode(6, OUTPUT);
pinMode(5, OUTPUT);
pinMode(4, OUTPUT);
pinMode(3, OUTPUT);
pinMode(2, OUTPUT);
}
void loop()
{
//
{
digitalWrite(13, true);
digitalWrite(12, true);
digitalWrite(11, true);
digitalWrite(10, true);
digitalWrite(9, true);
digitalWrite(8, true);
digitalWrite(7, true);
digitalWrite(6, true);
digitalWrite(5, true);
digitalWrite(4, true);
digitalWrite(3, true);
digitalWrite(2, true);
}
delay(200);
//
{
digitalWrite(13, false);
digitalWrite(12, false);
digitalWrite(11, false);
digitalWrite(10, false);
digitalWrite(9, false);
digitalWrite(8, false);
digitalWrite(7, false);
digitalWrite(6, false);
digitalWrite(5, false);
digitalWrite(4, false);
digitalWrite(3, false);
digitalWrite(2, false);
}
delay(200);
}
************************************************************************************************
2) Kad randomā spīd :
int howBright;
void setup()
{
pinMode(13, OUTPUT);
pinMode(12, OUTPUT);
pinMode(11, OUTPUT); // 11 ir galotne
pinMode(10, OUTPUT);
pinMode(9, OUTPUT);
pinMode(8, OUTPUT);
pinMode(7, OUTPUT);
pinMode(6, OUTPUT);
pinMode(5, OUTPUT);
pinMode(4, OUTPUT);
pinMode(3, OUTPUT);
pinMode(2, OUTPUT);
}
void loop()
{
howBright = random(0,255);
analogWrite(13, howBright);
delay(random(0,255));
howBright = random(0,255);
analogWrite(12, howBright);
delay(random(0,255));
howBright = random(0,255);
analogWrite(11, howBright);
delay(random(0,255));
howBright = random(0,255);
analogWrite(10, howBright);
delay(random(0,255));
howBright = random(0,255);
analogWrite(9, howBright);
delay(random(0,255));
howBright = random(0,255);
analogWrite(8, howBright);
delay(random(0,255));
howBright = random(0,255);
analogWrite(7, howBright);
delay(random(0,255));
howBright = random(0,255);
analogWrite(6, howBright);
delay(random(0,255));
howBright = random(0,255);
analogWrite(5, howBright);
delay(random(0,255));
howBright = random(0,255);
analogWrite(4, howBright);
delay(random(0,255));
howBright = random(0,255);
analogWrite(3, howBright);
delay(random(0,255));
howBright = random(0,255);
analogWrite(2, howBright);
delay(random(0,255));
}
........................................................................................................................
Zinu ka dažās bilodēs izskatās drausmīgi , JĀ un bildes nav pa katru soli, jo bija liela koncentrācīja lai pareizi saliktu , tapec ir ar lieliem vilcieniem fočēts, bet ideju var saprast.
Video var redzēt gala rezultātus , vēl varbūt pielabošu līdz galam , lai smukāk izskatās , vēlēk pielabošu rakstu , lai redzētu izmaiņas.
Tātad sākam: