Documente Academic
Documente Profesional
Documente Cultură
Raport
privind practica de producţie
Chişinău 2019
1
Cuprins
2
1 Descrierea locului petrecerii practicii în producţie
1.1 Contextul
Am ales să efectuez practica în producție la SRL”Orange Systems ” . Scopul principal
în efectuarea acestei practici era de a obţine anumitre deprinderi de lucru cu crearea unui
proiect prin aplicarea cunoştinţelor acumulate zi de zi de la facultate si din experiența
acumulată de la locul de practică.
1.2 Tema
3
mai importat să fie înteresant de folosit, ca utilizatorilor să aibă dorința de a achiziționa așa
un produs.
Smart-Tree este un proiect mai mult pentru distractie, care poate fi folosit atât pe un
braduț pentru sărbătorile de Craciun, sau în casă pentru înfrumusețare. Acest produs este un
bun exemplu pentru micii copii pentru ai motiva să se implice în domeniu tehnologiilor
avansate
4
IDE a fost disponibil în mod liber de la versiunea 0.1, publicată în mai 2013, iar apoi sa
mutat în testări beta, începând cu versiunea 0.8, lansată în iunie 2014. Prima versiune stabilă
1.0 a fost lansată în decembrie 2014, când sa oprit suportul pentru plug-in-ul de dezvoltare
Android Tools (ADT) pentru Eclipse.
Android Studio, bazat pe software-ul JetBrains IntelliJ IDEA, este instrumentul oficial
de dezvoltare a aplicațiilor Android [2]. Acest mediu de dezvoltare este disponibil pentru
Windows, OS X și Linux [3]. La 17 mai 2017, la conferința anuală Google I / O, Google a
anunțat sprijinul pentru limba Kotlin utilizată în Android Studio ca limbă de programare
oficială pentru platforma Android, pe lângă Java și C ++.
Noile caracteristici apar cu fiecare nouă versiune de Android Studio. În prezent sunt
disponibile următoarele funcții [4]:
5
Android Studio 2.1 acceptă SDK Android N Preview, ceea ce înseamnă că
dezvoltatorii pot începe să lucreze la crearea unei aplicații pentru o nouă platformă
software.
Noua versiune de Android Studio 2.1 este capabilă să colaboreze cu compilatorul Jack
actualizat și a primit, de asemenea, suport îmbunătățit pentru Java 8 și o
caracteristică îmbunătățită Instant Run [6].
Începând cu Platform-tools 23.1.0 pentru Linux este exclusiv pe 64 de biți. [7]
În aplicația Android Studio 3.0, instrumentele de limbă Kotlin bazate pe IDE JetBrains
vor fi incluse ca standard [8]
6
Arduino poate fi folosit atât pentru a crea obiecte autonome de automatizare, cât și
pentru conectarea la software pe un computer prin interfețe standard cu fir și fără fir.
Programarea se realizează în întregime prin shell-ul său propriu (IDE), disponibil
gratuit pe site-ul web Arduino (distribuit în termenii GPLv2) [14] [15]. Această coală conține
un editor de text, un manager de proiect, un preprocesor, un compilator și instrumentele
pentru încărcarea programului în microcontroler. Coajă este scrisă în Java bazată pe proiectul
Procesare, rulează sub Windows, Mac OS X și Linux.
Limbajul de programare
Limba de programare Arduino este un standard C ++ (sunt folosite compilatoare de
familie GNU Compiler Collection) cu câteva caracteristici care îi fac pe începători mai ușor
să scrie primul program de lucru.
7
Managerul de proiect al IDE Arduino are un mecanism de adăugare a bibliotecii non-
standard. Bibliotecile ca texte sursă din standardul C ++ sunt adăugate într-un director special
din directorul de lucru IDE. În acest caz, numele bibliotecii este adăugat la lista de biblioteci
din meniul IDE. Programatorul marchează bibliotecile necesare și se adaugă la lista de
compilare.
ID-ul Arduino nu oferă niciun set de compilatoare și minimizează alte setări, ceea ce
simplifică începutul pentru începători și reduce riscul de probleme.
Acesta este textul integral al celui mai simplu program (schița) a LED-ului care
clipește conectat la pinul 13 al arduinului, cu o perioadă de 2 secunde [17]
8
Figura 3.1 Bandă LED Figura 3.2 ESP12f și HC-0 Figura 3.3 Aplicatia Smart-
Tree
În proiectarea benzilor RGB se folosesc LED-uri alternante de trei culori (roșu, verde,
albastru) plasate pe o bază (bandă), adică această bandă poate fi reprezentată ca trei benzi
monocrome sau LED-uri RGB cu trei componente, având în componență trei emițători
semiconductori roșu, verde și albastru, combinate într-un caz.
4.3 HC-05
Modul Bluetooth SPP (Serial Port Protocol) pentru HC-05(Figura 3.2) Acesta este un port
serial bluetooth V2.0 + EDR (Enhanced Data Rate) 3Mbps Modulation cu un transceiver
radio de 2,4 GHz și o bandă de bază. Folosește funcția de hărțire a frecvențelor adaptive CSR
Bluecore 04.
Modulul Bluetooth HC-05 este un modul MASTER / SLAVE. Este setat implicit
pentru modulul (Slave) și poate fi configurat numai de dispozitivul Bluetooth. Se poate
accepta că se poate conecta la alte dispozitive.
10
5. Proectul final
5.1 Preseturile
11
Figura 5.1 Preseturile
12
Figura 5.2 Starea inițială
13
Figura 5.3 Random mode
14
Concluzie
În final putem spune că am primit un produs final care lucrează excelent și care poate fi
vândut pe piață. Am dobândit o experiență foarte utilă pentru viitorul nostru în calitate de
ingenieri in domeniul IT.
Am făcut cunoștintă aprofundată cu softuri si harduri noi, ne-am învațat să lucrăm în
echipe și să colaborăm pentru crearea unui produs final.
15
Bibliografie
1. https://store.arduino.cc/mega-2560-r3
2. https://www.makeuseof.com/tag/6-easy-ways-connect-arduino-android/
3. https://www.instructables.com/id/Arduin-Adroid-USB-Serial-Communication/
4. https://www.digikey.com/en/maker/projects/how-to-use-your-android-to-communicate-
with-your-arduino/aed1f8e3fa044264a4310c6b3b2a4364
5. https://startandroid.ru/ru/
6. https://4creates.com/training/102-video-uroki-android-studio-rus.html
7. https://developer.android.com/training/basics/firstapp
8. https://www.javaworld.com/article/3340234/tutorial-series-android-studio-for-
beginners.html
9. https://www.androidauthority.com/android-studio-tutorial-beginners-637572/
16
Anexe
ARDUINO IDE
1.1 ChristmassTree
#include "LedConfig.h"
#include "BluetoothConfig.h"
volatile int status = 0;
int currentPattern = 0;
String inputString = ""; // a String to hold incoming data
bool stringComplete = false; // whether the string is complete
int intArr[4];
void setup() {
initStrip();
clearLeds(NUM_LEDS);
FastLED.show();
delay(500);
Serial.begin(9600);
pinMode(2, INPUT_PULLUP);
//sei();
//attachInterrupt(digitalPinToInterrupt(2), getDataFromSerial, CHANGE );
}
void loop() {
if (stringComplete) {
Serial.print("array: ");
Serial.print(intArr[0]); Serial.print(" ");
Serial.print(intArr[1]); Serial.print(" ");
Serial.print(intArr[2]); Serial.print(" ");
Serial.println(intArr[3]);
17
inputString = "";
stringComplete = false;
}
int arr[] = {125,0,0,
0,125,0,
0,0,125,125,0,0,0,125,0,125,0,0,0,125,0,0,0,125,125,0,0,0,125,0,125,0,0,0,125,0,0,0,125,125,
0,0,0,125,0,125,0,0,0,125,0,0,0,125,125,0,0,0,125,0};
int arr2[] = {125,0,0,0,125,0,0,0,125,125,0,0};
switch(status) {
case 1:
//clearLeds(NUM_LEDS);
ledSet(intArr[0],intArr[1],intArr[2],intArr[3]);
//ledArraySet(arr, sizeof(arr)/sizeof(arr[0]));
break;
case 2: {
Fire2012();
break;}
case 3:{
cylon();
break;
}
case 4:{
lightning(CRGB::White,20,20,20);
break;
}
case 5:{
theaterChase(randomColor(),10,251);
18
break;
}
case 6:{
fill_grad();
break;
}
case 7:{
flash(randomColor(),10,50);
break;
}
case 8:{
break;
}
case 9:{
rainbow(5,1);
break;
}
case 10:{
RunningLights(0x99,0x32,0xCC, 50);
break;
}
case 11:{
meteorRain(0xf1,0x04,0xff,10, 64, true, 30);
break;
}
case 12:{
TwinkleRandom(20, 100, false);
break;
19
}
case 13:{
Fire(55,120,15);
break;
}
case 14:{
FadeInOut(0xff, 0x77, 0x00);
break;
}
case 15:{
Strobe(0xff, 0xff, 0xff, 10, 50, 100);
break;
}
case 16:{
Strobe(0xff, 0xff, 0xff, 10, 100, 20);
break;
}
case 17:{
NewKITT(0xff, 0, 0, 8, 10, 50);
break;
}
case 18:{
Sparkle(0xff, 0xff, 0xff, 0);
break;
}
case 19:{
SnowSparkle(0x10, 0x10, 0x10, 20, random(100,1000));
break;
20
}
case 20:{
SnowSparkle(0x10, 0x10, 0x10, 20, random(100,1000));
break;
}
default: {
clearLeds(NUM_LEDS);
status = 0;
ledArraySet(intArr, sizeof(intArr)/sizeof(intArr[0]));
//ledSet(intArr[0],intArr[1],intArr[2],intArr[3]);
clearLeds(NUM_LEDS);
//if(status != 0) break;
status = 0;
}
}
FastLED.show();
}
void serialEvent() {
char inChar;
bool mode = false;
while (Serial.available()) {
// add it to the inputString:
// get the new byte:
inChar = (char)Serial.read();
delay(10);
if ( (inChar == 'm' || inChar == 'M' || mode == true) && (inChar != '\n') ){
mode = true;
inputString += inChar;
21
}
if( mode == false && inChar != '\n' ){ //in this case we are geting the info for
corresponding LED
inputString += inChar;
}
if ( mode == true && inChar == '\n'){
inputString.replace('m','0');
inputString.replace('M','0');
status = inputString.toInt();
}
}
stringComplete = true;
if(mode == false){
parseArray(inputString,intArr);
}
}
void parseArray(String charArr, int arr[4]){
String tempStr = "";
int cnt = 0;
int length = charArr.length();
for (int i = 0; i < charArr.length(); i++) {
tempStr += charArr.charAt(i);
if((i+1) % 3 == 0){
arr[cnt] = tempStr.toInt();
tempStr = "";
cnt++;
}
}
22
}
1.2 BluetoothConfig.cpp
#include "BluetoothConfig.h"
int checkForArrayFromBluetooth(){
int status = 0;
if(Serial.available() > 0){ // Checks whether data is comming from the serial port
status = Serial.read(); // Reads the data from the serial port
}
return status;
}
1.3 BluetoothConfig.h
#ifndef BluetoothConfig_h
#define BluetoothConfig_h
#include <HardwareSerial.h>
int checkForArrayFromBluetooth();
#endif
1.4 LedConfig
#include "LedConfig.h"
// Define the array of leds
CRGB leds[NUM_LEDS];
bool gReverseDirection = false;
void initStrip(){
FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
}
void ledSet(int ledCnt, int red, int green, int blue){
leds[ledCnt] = CRGB(red, green, blue);
23
void ledArraySet(int ledArr[], int arrSize){
int i=0;
for(int j=0;j<arrSize;j++){
leds[i] = CRGB(ledArr[j], ledArr[j+1], ledArr[j+2]);
i++;
j=j+2;
}
}
24
for( int j = 0; j < NUM_LEDS; j++) {
CRGB color = HeatColor( heat[j]);
int pixelnumber;
if( gReverseDirection ) {
pixelnumber = (NUM_LEDS-1) - j;
} else {
pixelnumber = j;
}
leds[pixelnumber] = color;
}
}
void fadeall() { for(int i = 0; i < NUM_LEDS; i++) { leds[i].nscale8(250); } }
void cylon() {
static uint8_t hue = 0;
// First slide the led in one direction
for(int i = 0; i < NUM_LEDS; i++) {
// Set the i'th led to red
leds[i] = CHSV(hue++, 255, 255);
// Show the leds
FastLED.show();
// now that we've shown the leds, reset the i'th led to black
// leds[i] = CRGB::Black;
fadeall();
// Wait a little bit before we loop around and do it again
delay(10);
}
25
for(int i = (NUM_LEDS)-1; i >= 0; i--) {
// Set the i'th led to red
leds[i] = CHSV(hue++, 255, 255);
// Show the leds
FastLED.show();
// now that we've shown the leds, reset the i'th led to black
// leds[i] = CRGB::Black;
fadeall();
// Wait a little bit before we loop around and do it again
delay(10);
}
}
CRGB randomColor(){
return Wheel(random(256));
}
CRGB Wheel(byte WheelPos) {
if(WheelPos < 85) {
return CRGB(WheelPos * 3, 255 - WheelPos * 3, 0);
}
else if(WheelPos < 170) {
WheelPos -= 85;
return CRGB(255 - WheelPos * 3, 0, WheelPos * 3);
}
else {
WheelPos -= 170;
return CRGB(0, WheelPos * 3, 255 - WheelPos * 3);
}
26
}
27
for (int i=0; i < NUM_LEDS; i=i+3) {
leds[i+q] = CRGB::Black; //turn every third pixel off
}
}
}
}
delay(speed);
28
leds[i] = Wheel(((i * 256 / NUM_LEDS)) & 255);
}
FastLED.show();
}
else{
for(int j=0; j<256*cycles; j++) {
for(int i=0; i< NUM_LEDS; i++) {
leds[i] = Wheel(((i * 256 / NUM_LEDS) + j) & 255);
}
FastLED.show();
delay(speed);
}
}
}
void allColor(CRGB c){
for(int i=0; i<NUM_LEDS; i++){
leds[i] = c;
}
FastLED.show();
}
void five() {
static uint8_t hue = 0;
int x = 0;
// First slide the led in one direction
for(int i = 0; i < NUM_LEDS; i++) {
// Set the i'th led to red
if(i == x) {
leds[i] = CRGB::White;
29
delay(250);
leds[i] = CRGB::Black;
delay(500);
leds[i] = CRGB::White;
delay(100);
x += 5;
}
else { leds[i] = CHSV(hue++, 155, 155); }
// Show the leds
FastLED.show();
// now that we've shown the leds, reset the i'th led to black
// leds[i] = CRGB::Black;
if(x != i) fadeall();
else leds[i] = CRGB::Black;
// Wait a little bit before we loop around and do it again
delay(10);
}
}
void flash(CRGB c, int count, int speed){
for(int i=0; i<count; i++){
if(c){
allColor(c);
}
else{
allColor(randomColor());
}
delay(speed);
allColor(CRGB::Black);
30
delay(speed);
}
}
void fill_grad() {
uint8_t starthue = beatsin8(5, 0, 255);
uint8_t endhue = beatsin8(7, 0, 255);
if (starthue < endhue) {
fill_gradient(leds, NUM_LEDS, CHSV(starthue,255,255), CHSV(endhue,255,255),
FORWARD_HUES); // If we don't have this, the colour fill will flip around.
} else {
fill_gradient(leds, NUM_LEDS, CHSV(starthue,255,255), CHSV(endhue,255,255),
BACKWARD_HUES);
}
}
void showStrip() {
#ifdef ADAFRUIT_NEOPIXEL_H
// NeoPixel
strip.show();
#endif
#ifndef ADAFRUIT_NEOPIXEL_H
// FastLED
FastLED.show();
#endif
}
void setPixel(int Pixel, byte red, byte green, byte blue) {
#ifdef ADAFRUIT_NEOPIXEL_H
// NeoPixel
strip.setPixelColor(Pixel, strip.Color(red, green, blue));
31
#endif
#ifndef ADAFRUIT_NEOPIXEL_H
// FastLED
leds[Pixel].r = red;
leds[Pixel].g = green;
leds[Pixel].b = blue;
#endif
}
void setAll(byte red, byte green, byte blue) {
for(int i = 0; i < NUM_LEDS; i++ ) {
setPixel(i, red, green, blue);
}
showStrip();
}
void TwinkleRandom(int Count, int SpeedDelay, boolean OnlyOne) {
setAll(0,0,0);
for (int i=0; i<Count; i++) {
setPixel(random(NUM_LEDS),random(0,255),random(0,255),random(0,255));
showStrip();
delay(SpeedDelay);
if(OnlyOne) {
setAll(0,0,0);
}
}
delay(SpeedDelay);
}
32
void RunningLights(byte red, byte green, byte blue, int WaveDelay) {
int Position=0;
for(int j=0; j<NUM_LEDS*2; j++)
{
Position++; // = 0; //Position + Rate;
for(int i=0; i<NUM_LEDS; i++) {
// sine wave, 3 offset waves make a rainbow!
//float level = sin(i+Position) * 127 + 128;
//setPixel(i,level,0,0);
//float level = sin(i+Position) * 127 + 128;
setPixel(i,((sin(i+Position) * 127 + 128)/255)*red,
((sin(i+Position) * 127 + 128)/255)*green,
((sin(i+Position) * 127 + 128)/255)*blue);
}
showStrip();
delay(WaveDelay);
}
}
void meteorRain(byte red, byte green, byte blue, byte meteorSize, byte meteorTrailDecay,
boolean meteorRandomDecay, int SpeedDelay) {
setAll(0,0,0);
for(int i = 0; i < NUM_LEDS+NUM_LEDS; i++) {
// fade brightness all LEDs one step
for(int j=0; j<NUM_LEDS; j++) {
if( (!meteorRandomDecay) || (random(10)>5) ) {
fadeToBlack(j, meteorTrailDecay );
}
}
33
// draw meteor
for(int j = 0; j < meteorSize; j++) {
if( ( i-j <NUM_LEDS) && (i-j>=0) ) {
setPixel(i-j, red, green, blue);
}
}
showStrip();
delay(SpeedDelay);
}
}
void fadeToBlack(int ledNo, byte fadeValue) {
#ifdef ADAFRUIT_NEOPIXEL_H
// NeoPixel
uint32_t oldColor;
uint8_t r, g, b;
int value;
oldColor = strip.getPixelColor(ledNo);
r = (oldColor & 0x00ff0000UL) >> 16;
g = (oldColor & 0x0000ff00UL) >> 8;
b = (oldColor & 0x000000ffUL);
r=(r<=10)? 0 : (int) r-(r*fadeValue/256);
g=(g<=10)? 0 : (int) g-(g*fadeValue/256);
b=(b<=10)? 0 : (int) b-(b*fadeValue/256);
strip.setPixelColor(ledNo, r,g,b);
#endif
#ifndef ADAFRUIT_NEOPIXEL_H
// FastLED
34
leds[ledNo].fadeToBlackBy( fadeValue );
#endif
}
void Fire(int Cooling, int Sparking, int SpeedDelay) {
static byte heat[NUM_LEDS];
int cooldown;
// Step 1. Cool down every cell a little
for( int i = 0; i < NUM_LEDS; i++) {
cooldown = random(0, ((Cooling * 10) / NUM_LEDS) + 2);
if(cooldown>heat[i]) {
heat[i]=0;
} else {
heat[i]=heat[i]-cooldown;
}
}
// Step 2. Heat from each cell drifts 'up' and diffuses a little
for( int k= NUM_LEDS - 1; k >= 2; k--) {
heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2]) / 3;
}
// Step 3. Randomly ignite new 'sparks' near the bottom
if( random(255) < Sparking ) {
int y = random(7);
heat[y] = heat[y] + random(160,255);
//heat[y] = random(160,255);
}
// Step 4. Convert heat to LED colors
for( int j = 0; j < NUM_LEDS; j++) {
setPixelHeatColor(j, heat[j] );
35
}
showStrip();
delay(SpeedDelay);
}
void setPixelHeatColor (int Pixel, byte temperature) {
// Scale 'heat' down from 0-255 to 0-191
byte t192 = round((temperature/255.0)*191);
// calculate ramp up from
byte heatramp = t192 & 0x3F; // 0..63
heatramp <<= 2; // scale up to 0..252
// figure out which third of the spectrum we're in:
if( t192 > 0x80) { // hottest
setPixel(Pixel, 255, 255, heatramp);
} else if( t192 > 0x40 ) { // middle
setPixel(Pixel, 255, heatramp, 0);
} else { // coolest
setPixel(Pixel, heatramp, 0, 0);
}
}
void FadeInOut(byte red, byte green, byte blue){
float r, g, b;
for(int k = 0; k < 256; k=k+1) {
r = (k/256.0)*red;
g = (k/256.0)*green;
b = (k/256.0)*blue;
setAll(r,g,b);
showStrip();
}
36
for(int k = 255; k >= 0; k=k-2) {
r = (k/256.0)*red;
g = (k/256.0)*green;
b = (k/256.0)*blue;
setAll(r,g,b);
showStrip();
}
}
void Strobe(byte red, byte green, byte blue, int StrobeCount, int FlashDelay, int EndPause){
for(int j = 0; j < StrobeCount; j++) {
setAll(red,green,blue);
showStrip();
delay(FlashDelay);
setAll(0,0,0);
showStrip();
delay(FlashDelay);
}
delay(EndPause);
}
void NewKITT(byte red, byte green, byte blue, int EyeSize, int SpeedDelay, int ReturnDelay)
{
RightToLeft(red, green, blue, EyeSize, SpeedDelay, ReturnDelay);
LeftToRight(red, green, blue, EyeSize, SpeedDelay, ReturnDelay);
OutsideToCenter(red, green, blue, EyeSize, SpeedDelay, ReturnDelay);
CenterToOutside(red, green, blue, EyeSize, SpeedDelay, ReturnDelay);
LeftToRight(red, green, blue, EyeSize, SpeedDelay, ReturnDelay);
37
RightToLeft(red, green, blue, EyeSize, SpeedDelay, ReturnDelay);
OutsideToCenter(red, green, blue, EyeSize, SpeedDelay, ReturnDelay);
CenterToOutside(red, green, blue, EyeSize, SpeedDelay, ReturnDelay);
}
void CenterToOutside(byte red, byte green, byte blue, int EyeSize, int SpeedDelay, int
ReturnDelay) {
for(int i =((NUM_LEDS-EyeSize)/2); i>=0; i--) {
setAll(0,0,0);
setPixel(i, red/10, green/10, blue/10);
for(int j = 1; j <= EyeSize; j++) {
setPixel(i+j, red, green, blue);
}
setPixel(i+EyeSize+1, red/10, green/10, blue/10);
setPixel(NUM_LEDS-i, red/10, green/10, blue/10);
for(int j = 1; j <= EyeSize; j++) {
setPixel(NUM_LEDS-i-j, red, green, blue);
}
setPixel(NUM_LEDS-i-EyeSize-1, red/10, green/10, blue/10);
showStrip();
delay(SpeedDelay);
}
delay(ReturnDelay);
}
void OutsideToCenter(byte red, byte green, byte blue, int EyeSize, int SpeedDelay, int
ReturnDelay) {
for(int i = 0; i<=((NUM_LEDS-EyeSize)/2); i++) {
setAll(0,0,0);
setPixel(i, red/10, green/10, blue/10);
38
for(int j = 1; j <= EyeSize; j++) {
setPixel(i+j, red, green, blue);
}
setPixel(i+EyeSize+1, red/10, green/10, blue/10);
setPixel(NUM_LEDS-i, red/10, green/10, blue/10);
for(int j = 1; j <= EyeSize; j++) {
setPixel(NUM_LEDS-i-j, red, green, blue);
}
setPixel(NUM_LEDS-i-EyeSize-1, red/10, green/10, blue/10);
showStrip();
delay(SpeedDelay);
}
delay(ReturnDelay);
}
void LeftToRight(byte red, byte green, byte blue, int EyeSize, int SpeedDelay, int
ReturnDelay) {
for(int i = 0; i < NUM_LEDS-EyeSize-2; i++) {
setAll(0,0,0);
setPixel(i, red/10, green/10, blue/10);
for(int j = 1; j <= EyeSize; j++) {
setPixel(i+j, red, green, blue);
}
setPixel(i+EyeSize+1, red/10, green/10, blue/10);
showStrip();
delay(SpeedDelay);
}
delay(ReturnDelay);
}
39
void RightToLeft(byte red, byte green, byte blue, int EyeSize, int SpeedDelay, int
ReturnDelay) {
for(int i = NUM_LEDS-EyeSize-2; i > 0; i--) {
setAll(0,0,0);
setPixel(i, red/10, green/10, blue/10);
for(int j = 1; j <= EyeSize; j++) {
setPixel(i+j, red, green, blue);
}
setPixel(i+EyeSize+1, red/10, green/10, blue/10);
showStrip();
delay(SpeedDelay);
}
delay(ReturnDelay);
}
void Sparkle(byte red, byte green, byte blue, int SpeedDelay) {
int Pixel = random(NUM_LEDS);
setPixel(Pixel,red,green,blue);
showStrip();
delay(SpeedDelay);
setPixel(Pixel,0,0,0);
}
void SnowSparkle(byte red, byte green, byte blue, int SparkleDelay, int SpeedDelay) {
setAll(red,green,blue);
int Pixel = random(NUM_LEDS);
setPixel(Pixel,0xff,0xff,0xff);
showStrip();
delay(SparkleDelay);
40
setPixel(Pixel,red,green,blue);
showStrip();
delay(SpeedDelay);
}
1.5 LedConfig.h
#ifndef LedConfig_h
#define LedConfig_h
#include <FastLED.h>
#define NUM_LEDS 30
#define DATA_PIN 6
#define COOLING 55
#define SPARKING 120
#define UPDATES_PER_SECOND 100
void initStrip();
void ledSet(int ledCnt, int red, int green, int blue);
void ledArraySet(int ledArr[], int arrSize);
void clearLeds(int nrOfLeds);
void Fire2012();
void fadeall();
void cylon();
CRGB randomColor();
CRGB Wheel(byte WheelPos);
void lightning(CRGB c, int simultaneous, int cycles, int speed);
void theaterChase(CRGB c, int cycles, int speed);
void theaterChaseRainbow(int cycles, int speed);
void rainbow(int cycles, int speed);
void five();
void flash(CRGB c, int count, int speed);
41
void fill_grad();
void TwinkleRandom(int Count, int SpeedDelay, boolean OnlyOne);
void RunningLights(byte red, byte green, byte blue, int WaveDelay);
void meteorRain(byte red, byte green, byte blue, byte meteorSize, byte meteorTrailDecay,
boolean meteorRandomDecay, int SpeedDelay);
void fadeToBlack(int ledNo, byte fadeValue);
void Fire(int Cooling, int Sparking, int SpeedDelay);
void setPixelHeatColor (int Pixel, byte temperature);
void FadeInOut(byte red, byte green, byte blue);
void Strobe(byte red, byte green, byte blue, int StrobeCount, int FlashDelay, int EndPause);
void NewKITT(byte red, byte green, byte blue, int EyeSize, int SpeedDelay, int
ReturnDelay);
void CenterToOutside(byte red, byte green, byte blue, int EyeSize, int SpeedDelay, int
ReturnDelay);
void OutsideToCenter(byte red, byte green, byte blue, int EyeSize, int SpeedDelay, int
ReturnDelay);
void LeftToRight(byte red, byte green, byte blue, int EyeSize, int SpeedDelay, int
ReturnDelay);
void RightToLeft(byte red, byte green, byte blue, int EyeSize, int SpeedDelay, int
ReturnDelay);
void Sparkle(byte red, byte green, byte blue, int SpeedDelay);
void SnowSparkle(byte red, byte green, byte blue, int SparkleDelay, int SpeedDelay);
#endif
42