[code]
#include "FastLED.h"
//Aantal Leds
#define NUM_LEDS 30
//Pin gebruikt voor de data
#define DATA_PIN 2
//Array of Leds
CRGB leds[NUM_LEDS];
//Codes voor getallenreeks A
long AA[] =
{
0x000000, 0x008000, 0x000000,
0x000000, 0x008000, 0x000000,
0x000000, 0x008000, 0x000000,
0x000000, 0x008000, 0x000000,
0x000000, 0x008000, 0x000000
};
long AB[] =
{
0x008000, 0x008000, 0x008000,
0x008000, 0x000000, 0x000000,
0x008000, 0x008000, 0x008000,
0x000000, 0x000000, 0x008000,
0x008000, 0x008000, 0x008000
};
long AC[] =
{
0x008000, 0x008000, 0x008000,
0x008000, 0x000000, 0x000000,
0x008000, 0x008000, 0x008000,
0x008000, 0x000000, 0x000000,
0x008000, 0x008000, 0x008000
};
long AD[] =
{
0x008000, 0x000000, 0x008000,
0x008000, 0x000000, 0x008000,
0x008000, 0x008000, 0x008000,
0x008000, 0x000000, 0x000000,
0x000000, 0x000000, 0x008000
};
long AE[] =
{
0x008000, 0x008000, 0x008000,
0x000000, 0x000000, 0x008000,
0x008000, 0x008000, 0x008000,
0x008000, 0x000000, 0x000000,
0x008000, 0x008000, 0x008000
};
long AF[] =
{
0x008000, 0x008000, 0x008000,
0x000000, 0x000000, 0x008000,
0x008000, 0x008000, 0x008000,
0x008000, 0x000000, 0x008000,
0x008000, 0x008000, 0x008000
};
long AG[] =
{
0x008000, 0x008000, 0x008000,
0x008000, 0x000000, 0x000000,
0x000000, 0x000000, 0x008000,
0x008000, 0x000000, 0x000000,
0x000000, 0x000000, 0x008000
};
long AH[] =
{
0x008000, 0x008000, 0x008000,
0x008000, 0x000000, 0x008000,
0x008000, 0x008000, 0x008000,
0x008000, 0x000000, 0x008000,
0x008000, 0x008000, 0x008000
};
long AI[] =
{
0x008000, 0x008000, 0x008000,
0x008000, 0x000000, 0x008000,
0x008000, 0x008000, 0x008000,
0x008000, 0x000000, 0x000000,
0x008000, 0x008000, 0x008000
};
long AZ[] =
{
0x008000, 0x008000, 0x008000,
0x008000, 0x000000, 0x008000,
0x008000, 0x000000, 0x008000,
0x008000, 0x000000, 0x008000,
0x008000, 0x008000, 0x008000
};
//Codes voor getallenreeks B
long BA[] =
{
0x000000, 0x008000, 0x000000,
0x000000, 0x008000, 0x000000,
0x000000, 0x008000, 0x000000,
0x000000, 0x008000, 0x000000,
0x000000, 0x008000, 0x000000
};
long BB[] =
{
0x008000, 0x008000, 0x008000,
0x008000, 0x000000, 0x000000,
0x008000, 0x008000, 0x008000,
0x000000, 0x000000, 0x008000,
0x008000, 0x008000, 0x008000
};
long BC[] =
{
0x008000, 0x008000, 0x008000,
0x008000, 0x000000, 0x000000,
0x008000, 0x008000, 0x008000,
0x008000, 0x000000, 0x000000,
0x008000, 0x008000, 0x008000
};
long BD[] =
{
0x008000, 0x000000, 0x008000,
0x008000, 0x000000, 0x008000,
0x008000, 0x008000, 0x008000,
0x008000, 0x000000, 0x000000,
0x000000, 0x000000, 0x008000
};
long BE[] =
{
0x008000, 0x008000, 0x008000,
0x000000, 0x000000, 0x008000,
0x008000, 0x008000, 0x008000,
0x008000, 0x000000, 0x000000,
0x008000, 0x008000, 0x008000
};
long BF[] =
{
0x008000, 0x008000, 0x008000,
0x000000, 0x000000, 0x008000,
0x008000, 0x008000, 0x008000,
0x008000, 0x000000, 0x008000,
0x008000, 0x008000, 0x008000
};
long BG[] =
{
0x008000, 0x008000, 0x008000,
0x008000, 0x000000, 0x000000,
0x000000, 0x000000, 0x008000,
0x008000, 0x000000, 0x000000,
0x000000, 0x000000, 0x008000
};
long BH[] =
{
0x008000, 0x008000, 0x008000,
0x008000, 0x000000, 0x008000,
0x008000, 0x008000, 0x008000,
0x008000, 0x000000, 0x008000,
0x008000, 0x008000, 0x008000
};
long BI[] =
{
0x008000, 0x008000, 0x008000,
0x008000, 0x000000, 0x008000,
0x008000, 0x008000, 0x008000,
0x008000, 0x000000, 0x000000,
0x008000, 0x008000, 0x008000
};
long BZ[] =
{
0x008000, 0x008000, 0x008000,
0x008000, 0x000000, 0x008000,
0x008000, 0x000000, 0x008000,
0x008000, 0x000000, 0x008000,
0x008000, 0x008000, 0x008000
};
//B1 = A1+15;
//B2 = A2+15;
void setup() {
FastLED.addLeds<NEOPIXEL,DATA_PIN>(leds, NUM_LEDS);
}
void loop() {
///////////////getallen in A////////////////
FastLED.clear();
for(int i = 0; i < 15; i++) {
leds[i] = AA[i];
}
FastLED.setBrightness (75);
FastLED.show();
delay(1000);
for(int i = 0; i < 15; i++) {
leds[i] = AB[i];
}
FastLED.setBrightness (75);
FastLED.show();
delay(1000);
for(int i = 0; i < 15; i++) {
leds[i] = AC[i];
}
FastLED.setBrightness (75);
FastLED.show();
delay(1000);
for(int i = 0; i < 15; i++) {
leds[i] = AD[i];
}
FastLED.setBrightness (75);
FastLED.show();
delay(1000);
for(int i = 0; i < 15; i++) {
leds[i] = AE[i];
}
for(int i = 15; i < NUM_LEDS; i++) {
leds[i] = BA[i];
}
FastLED.setBrightness (75);
FastLED.show();
delay(1000);
for(int i = 0; i < 15; i++) {
leds[i] = AF[i];
}
FastLED.setBrightness (75);
FastLED.show();
delay(1000);
for(int i = 0; i < 15; i++) {
leds[i] = AG[i];
}
FastLED.setBrightness (75);
FastLED.show();
delay(1000);
for(int i = 0; i < 15; i++) {
leds[i] = AH[i];
}
FastLED.setBrightness (75);
FastLED.show();
delay(1000);
for(int i = 0; i < 15; i++) {
leds[i] = AI[i];
}
FastLED.setBrightness (75);
FastLED.show();
delay(1000);
for(int i = 0; i < 15; i++) {
leds[i] = AZ[i];
}
FastLED.setBrightness (75);
FastLED.show();
delay(1000);
///////////////Getallen in B////////////
FastLED.clear();
for(int i = 15; i < NUM_LEDS; i++) {
leds[i] = BA[i];
}
FastLED.setBrightness (75);
FastLED.show();
delay(1000);
for(int i = 15; i < NUM_LEDS; i++) {
leds[i] = BB[i];
}
FastLED.setBrightness (75);
FastLED.show();
delay(1000);
for(int i = 15; i < NUM_LEDS; i++) {
leds[i] = BC[i];
}
FastLED.setBrightness (75);
FastLED.show();
delay(1000);
for(int i = 15; i < NUM_LEDS; i++) {
leds[i] = BD[i];
}
FastLED.setBrightness (75);
FastLED.show();
delay(1000);
for(int i = 15; i < NUM_LEDS; i++) {
leds[i] = BE[i];
}
FastLED.setBrightness (75);
FastLED.show();
delay(1000);
for(int i = 15; i < NUM_LEDS; i++) {
leds[i] = BF[i];
}
FastLED.setBrightness (75);
FastLED.show();
delay(1000);
for(int i = 15; i < NUM_LEDS; i++) {
leds[i] = BG[i];
}
FastLED.setBrightness (75);
FastLED.show();
delay(1000);
for(int i = 15; i < NUM_LEDS; i++) {
leds[i] = BH[i];
}
FastLED.setBrightness (75);
FastLED.show();
delay(1000);
for(int i = 15; i < NUM_LEDS; i++) {
leds[i] = BI[i];
}
FastLED.setBrightness (75);
FastLED.show();
delay(1000);
for(int i = 15; i < NUM_LEDS; i++) {
leds[i] = BZ[i];
}
FastLED.setBrightness (75);
FastLED.show();
delay(1000);
}
// Aangeven 501 = AE and BZ and CA
// Aangeven 500 = AE and BA and CA
// Aangeven 499 = AI and BZ and CZ
// Etc.
// Code schrijven 501 = start minus invoer = Getal reeksen
[/code]
Link to image:
The red line is the way the leds are inserted,
So the coding of the leds is what i said im my first post.
I can control my leds, and even the first 15 / second 15 and so on.
But my question:
It will be a scoreboard,
How can i code it to say first number is first 15 leds,
second nummer second 15 leds.
And then how can is say when the score is 450 i Need AD / BD
Where A is the first and B the second.