Blink three time in row

Thing #4 mores code using red blue and green LEDs

Where I started I noted mores code uses a max of four signals to represent a letter. So I created four arrays 26 element long. I lined all four up and put pin value vertically
12,
2,
3,
3,
would product red blue green green

Next I created four arrays to hold number of millisecond the pin was on
1000,
1000,
0,
0,
which should have done red on for a second off a second blue on for a second off for a second the third and fourth times set of zero would prevent the LEDs from lighting up.

Then a green LED would automatically turn on to show the character was finished

Two things that went very wrong: first the array started counting at element zero so it didn't match up with the array index in my for loop. I tried starting the for loop at 1 but for some reason it returned the second element value instead of element first in the zero position. In the end I just put a dummy value in the first element of all four arrays.

The next thing that was a surprise a delay of zero still caused the green LEDs to flash once. Not good.
So I change the digitalwrite (LEDpin, HIGH) to digitalwrite(red, HIGH) and digitalwrite(blue, HIGH) and load the variable to: red =2 or blue=12 to change where the signal where being sent. This cause the LED to glow at a quarter brightness and still flash once. Not Good!

I took care of the single flash and dimming by pass a pin value with a #define red 2 and a #define blue 12 and #define green 10 (a pin not connected). I have no idea if this is proper coding, but it seem to work
Personally it feel like a hack. It would have been nice to make a function call and just pass three arguments. So far I have not found anything at the arduino sight about function , of course it might have merely failed to located that information.

As the started to change my perspective of LED pins I started to question how they should be labeled in the digitalwrite function. What started as a physical mapping to pin location became more of a logical reference to a color swamping container, so I changed the variable name of all three pinModes to blinker1 blinker2 and blinker3 so each LED had a output set red blue green respectively, but could be reassigned with a #define command.

I loaded the arrays first[] second[] third[] four[] with values of 12 for red, values of 2 for blue and values of 3 for green. I loaded arrays kron2[] kron3[] kron4[] with values of 1000 and values of O. There is no array kron1[] because there is always at least on dot or dash in mores code 1000 on 1000 off.

I have eight digitalwrite statements all set to blinker1 to turn on a LED and one to turn it off

I have four #define blinker1 commands that get the pin value from my first four arrays.

I also have four variables called one, two, tri, qud that get pin numbers
I have four variables called time1 time2 timer3 timer4 that get delay in milliseconds or zero delays
There are three variables: length, i, x one for the length of the for loop, one to index counter and one for indexes for the first[x] second[x] third[x] fourth[x]

One last adjustment needed to be put in place to reduce the ASCII code value to the numeric position of each letter, take for example the ASCII code for 'a' is 97 but it is the first code in the mores code list. So I just subtracted 96 and all the alphabet followed along rather nicely.

Ok so how does this thing work. The array letters[] ={'a','b','c'} has three elements and we set the loop to length =3 The for loop uses a variable name “i” to count up to three. The first time “i” is equal to the number 1 so the follow happen x = letters –96 so x = letter[1] –96 Which is: x = 97 – 96 . The next array is: one = first[x] which is: one = first[1] thus one = 12 ( the location of the red LED) Next the define blinker1 one became #define blinker1 12 this passed on to digitalwrite(blinker1, HIGH) which could be seen as digitalwrite(12, HIGH) pinMode(12., output)
two = second[1] loads up two = 2 then #define blinker 2 finally digitalwrite(2, HIGH)
tri = third[1] loads up tri = 10 then #define blinker 10 finally digitalwrite(10, HIGH) a nonconnected pin
qud = four[1] loads up qud = 10 then #define blinker 10 finally digitalwrite(10, HIGH) a nonconnected pin
digitalWrite(blinker3, HIGH); delay(1000); is the last statement before the loop goes to i=2
one = first[2] will become one = 2
two = second[2] will become one = 12
tri = third[2] will become one = 10
qud = fourth[2] will become one = 10
one = first[3] will become one = 2
two = second[3] will become one = 12
tri = third[3] will become one = 2
qud = fourth[3] will become one = 12 blue red blue red dash dot dash dot “b”