Dynamic turn signals stop and parking lights - WS2812b

I can help you with the code because I like the project, but:

  • I'm not sure that FastLED can dynamically control the brightness, and set different brightness values in a single led strip
  • And you'll have to provide 5V or 3.3V input for the commands.

Here is a first version

#include <FastLED.h>

#define LED_PIN1     2
#define NUM_LEDS1    16

// buttons for commands
#define StopButton 3
#define ClignoButton 4
#define PosButton 5

CRGB leds[NUM_LEDS];

byte NCligno = 0;
bool Cligno = false;
bool Stop = false;
bool Position = true;
const byte BrightnessPos = 40; // %
const byte BrightnessCligno = 100;
const byte BrightnessStop = 100;

unsigned long ClignoDur = 100ul;
unsigned long Chrono = 0;

void ReadButtons () {
    Cligno = !digitalRead(ClignoButton);
    Stop = !digitalRead(StopButton);
    Position = !digitalRead(PosButton);
    delay(25);
}

void LightCligno (byte n) {
  int orange = 255*BrightnessCligno/100;
  for (int i=0;i<n;i++) leds[i] = CRGB(orange,orange,0);
}

void LightAll (byte b) {
  int red = 255*b/100;
  for (int i=0;i<NUM_LEDS1;i++) leds[i] = CRGB(red,0,0);
}

void setup() {
  FastLED.addLeds<WS2812B, LED_PIN1, GRB>(leds, NUM_LEDS1);
  pinMode (StopButton,INPUT_PULLUP);
  pinMode (ClignoButton,INPUT_PULLUP);
  pinMode (PosButton,INPUT_PULLUP);
  Serial.begin(115200);
  Chrono = millis();
}

void loop() {
  ReadButtons ();
    
  if (!Position) {
    FastLED.clear();
  } else LightAll (BrightnessPos);
  
  if (Stop) LightAll (BrightnessStop);
    
  else if (Cligno) {
    if (millis()-Chrono>ClignoDur) {
      Chrono = millis();
      NCligno = (NCligno+1)%NUM_LEDS1;
      LightCligno (NCligno);
    }
  }
  
  FastLED.show();
}

It only addresses one led strip of 16 leds, for only one side. When it works, we'll work on the version for two led strips.

It assumes 3 buttons, which are actually pushbuttons. One for the dim red lights (I called it position, as in French) connected between pin 5 and GND. One for the stop light, connected between pin 3 and GND. The last one for turn signal, between pin 4 and GND (called cligno for clignotant).

If no button is pushed, all the leds are off.
If the stop button is pushed, whatever the status of the other buttons, all the leds are on, red with high brightness.
If only the position button is pushed, all the leds are red but with lower brightness. Brightness values can be modified, from 0 to 100.
If the turn button is pushed, the leds lit one after the other, hopefully orange, with high brightness. If the position button is also pushed, the remaining leds are red with lower brightness.

Test it, and tell me what you see...

It is exactly as you wrote. Lights stop and position lights, work well. In turn direction lights, I changed the value of "unsigned long ClignoDur to value = 0ul, because at the value of 100ul LEDs was flashing. At this point in the code you need to add 1 because Arduino throws an error: CRGB leds[NUM_LEDS1]; Regarding the directions lights, it would be necessary to synchronize them with those that I have in a motorcycle. That they ignite and off at the same moment. The direction light function now works in the loop. It seems to me that this loop would have to be removed. Therefore, that after each time a mass pulse is given, the left or right direction would perform only one full cycle of the dynamic direction. Then it will be easier to synchronize with them the direction indicator that I have in the motorcycle. And the ability to adjust the "swimming" speed of the dynamic direction indicators for the right and left turn signals. I hope you know what I mean. You also have to divide them into the left and right side after 8 led. Regarding the control I will try to make a transistor-based circuit or use relays.
@lesept Thank you for your help :slight_smile:

Hi
I'm more comfortable with code than with electronics, so I can only help on the code part. I don't know how to synchronize the turn lights with what you call the impulse of the mass. Maybe someone else in this forum understands better than me what it is and how to wire the arduino to catch that signal.

I supposed in my code that you would be testing with pushbuttons but in the real implementation, I think that the commands will be from switches, except for the stop light. In this case, the delay line should be removed from the code, and you should use a capacitance to cancel the possible bounces at the stop button. You'll find lots of information about this on the internet.

Then, the value of ClignoDur should be set to a non zero value, and this value will help synchronize the wave and your existing turn light.
This will need to be set by trial and error, unless you can precisely measure the period of your existing turn signal.

I'll provide a new version with the 2 directions, you ll need another button or switch, one for turning left and one for turning right. I mean for testing purpose, but for the real implementation, you'll have to tell me how you get the control signals from your bike.

Do you also need a 'warning' signal, as we call it in French, ie both turn waves synchronized? If yes, this will require another button or switch to command it.

The direction light function now works in the loop. It seems to me that this loop would have to be removed. Therefore, that after each time a mass pulse is given, the left or right direction would perform only one full cycle of the dynamic direction. Then it will be easier to synchronize with them the direction indicator that I have in the motorcycle. And the ability to adjust the "swimming" speed of the dynamic direction indicators for the right and left turn signals. All signals from the motorcycle are controlled using 12v. Mass control for arduino can stay I will try to make a circuit using transistor or relays. Warning lights (emergency) you do not have to do this this can be done using the left and right turn signal.

What you call "mass signal" must be a parasitic signal that I would translate as "a call for current" from the light bulb when it's switched on (but my knowledge in electronics is quite low so there may be another explanation). I don't think it can be fed directly to a pin of the arduino. You should catch it with another circuit which will provide a 'correct" signal to the Arduino.

Now, for the code: do you have switches?

If yes, I can change the code accordingly. If you can put a switch for left / right direction, and add a pushbutton that would simulate that "mass signal", I can rewrite the code to manage that. There, we need to decide when to stop the wave, maybe with another push on this pushbutton for the moment.

Similarly, you can put ON/OFF switches for position and stop lights, although I don't think the code needs any change for those.

Here is the new version :

#include <FastLED.h>

#define LED_PIN1     2
#define NUM_LEDS1    16

// buttons for commands (all connected between pin and GND)
#define StopButton 3
#define ClignoSwitch 4
#define PosSwitch 5
#define MassSignal 6

CRGB leds[NUM_LEDS1]; // 0-7 left, 8-15 right

byte NCligno = 0;
bool Cligno = false; // received mass signal ?
bool ClignoState = false; // turn light on or off ?
bool ClignoDir = false; // true : right, false : left
bool Stop = false;
bool Position = true;
const byte BrightnessPos = 40; // %
const byte BrightnessCligno = 100;
const byte BrightnessStop = 100;

unsigned long ClignoDur = 10ul;
unsigned long Chrono = 0;

void ReadButtons () {
  ClignoDir = digitalRead(ClignoSwitch); // put a ! if not the correct direction
  Cligno = !digitalRead(MassSignal);
  Stop = !digitalRead(StopButton);
  Position = !digitalRead(PosSwitch);
  delay(20); // To be removed eventually
  if (Cligno) ClignoState = !ClignoState;
}

void LightCligno (byte n, bool Direction) {
  byte Offset = (Direction) ? 8 : 0;
  int orange = 255 * BrightnessCligno / 100;
  for (int i = 0; i < n; i++) leds[i + Offset] = CRGB(orange, orange, 0);
}

void LightAll (byte b) {
  int red = 255 * b / 100;
  for (int i = 0; i < NUM_LEDS1; i++) leds[i] = CRGB(red, 0, 0);
}

void setup() {
  FastLED.addLeds<WS2812B, LED_PIN1, GRB>(leds, NUM_LEDS1);
  pinMode (StopButton, INPUT_PULLUP);
  pinMode (ClignoSwitch, INPUT_PULLUP);
  pinMode (PosSwitch, INPUT_PULLUP);
  pinMode (MassSignal, INPUT_PULLUP);
  Serial.begin(115200);
  Chrono = millis();
}

void loop() {
  ReadButtons ();

  if (!Position) {
    FastLED.clear(); // Position light OFF
  } else LightAll (BrightnessPos); // Position light ON

  if (Stop) LightAll (BrightnessStop); // Stop light ON

  else if (ClignoState) {
    if (millis() - Chrono > ClignoDur) {
      Chrono = millis();
      NCligno = (NCligno + 1) % (NUM_LEDS1 / 2);
      LightCligno (NCligno, ClignoDir);
    }
  }

  FastLED.show();
}

So you need switches (or pushbuttons and you keep them pushed to simulate the switches) for turn and position lights, and pushbuttons for stop and mass signals. The strip is divided in 2 parts (left and right) and hopefully the lit part will depend on the direction switch... They begin to flash when the mass button is pushed and stop when it is pushed again.

Try it and tell me how it works...

Works only the right-hand direction on pin 6, on pin 4 not works, the left-hand direction. This direction still works in the loop. The wave works on 7 diodes and should be on 8. The diodes from 8 to 14 are on. Diode 15 should also light up (diodes count from 0 like Arduino).
The left turn signal works when the right turn signal is on and gives the mass on pin 4. It also lights up in a wave of 7 LEDs, from: 0 to: 6, LED 7 should also light up and the wave should work the other way from diode: 7 to diode: 0. The mass impulse be given at the frequency with which the blinkers of the motorcycle flash. So it must work on the principle that after giving the mass the direction must perform one full cycle of the wave and after the next mass application it must again make a full wave cycle and so on over and over when the mass impulse is applied. If we used the mass to stop the wave then the direction would flash every other cycle.
Yes I have switches I do it on the contact board. Can the disappearance of the mass pulse cause the wave to stop? What I mean is that arduino gets a mass pulse from the motorcycle turn signal on the input, lights the wave (one cycle, no loop), the mass impulse from the motorcycle disappears and then the wave is stopped and so on and on? I know it is easier to do in the loop but then it will be harder to synchronize the direction indicators with each other.

Position lights and brake lights work well and you do not have to change anything in the code for them.

Works only the right-hand direction on pin 6, on pin 4 not works, the left-hand direction.

Actually, all the leds are connected to pin 2. Pin 6 is connected to the switch: please refer here to see how to connect the switch.

Here is a new version with turn signal going up and down.

#include <FastLED.h>

#define LED_PIN1     2
#define NUM_LEDS1    16

// buttons for commands (all connected between pin and GND)
#define StopButton 3
#define ClignoSwitch 4
#define PosSwitch 5
#define MassSignal 6

CRGB leds[NUM_LEDS1]; // 0-7 left, 8-15 right

byte NCligno = 0;
bool Cligno = false; // received mass signal ?
bool ClignoState = false; // turn light on or off ?
bool ClignoDir = false; // true : right, false : left
bool ClignoUp = true; // true : lights from 0 to 7, false : the other way
bool Stop = false;
bool Position = true;
const byte BrightnessPos = 40; // %
const byte BrightnessCligno = 100;
const byte BrightnessStop = 100;

unsigned long ClignoDur = 10ul;
unsigned long Chrono = 0;

void ReadButtons () {
  ClignoDir = digitalRead(ClignoSwitch); // put a ! if not the correct direction
  Cligno = !digitalRead(MassSignal);
  Stop = !digitalRead(StopButton);
  Position = !digitalRead(PosSwitch);
  delay(20); // To be removed eventually
  if (Cligno) ClignoState = !ClignoState;
}

void LightCligno (byte n, bool Direction) {
  byte Offset = (Direction) ? 8 : 0;
  int orange = 255 * BrightnessCligno / 100;
  for (int i = 0; i < n; i++) leds[i + Offset] = CRGB(orange, orange, 0);
  if (!ClignoUp && !Position) leds[n] = CRGB(0, 0, 0);
  if (!ClignoUp &&  Position) {
    int red = 255 * BrightnessPos / 100;
    leds[n] = CRGB(red, 0, 0);
  }
}

void LightAll (byte b) {
  int red = 255 * b / 100;
  fill_solid(leds, NUM_LEDS1, CRGB(red, 0, 0));
  //  for (int i = 0; i < NUM_LEDS1; i++) leds[i] = CRGB(red, 0, 0);
}

void setup() {
  FastLED.addLeds<WS2812B, LED_PIN1, GRB>(leds, NUM_LEDS1);
  pinMode (StopButton, INPUT_PULLUP);
  pinMode (ClignoSwitch, INPUT_PULLUP);
  pinMode (PosSwitch, INPUT_PULLUP);
  pinMode (MassSignal, INPUT_PULLUP);
  Serial.begin(115200);
  Chrono = millis();
}

void loop() {
  ReadButtons ();

  if (!Position) {
    FastLED.clear(); // Position light OFF
  } else LightAll (BrightnessPos); // Position light ON

  if (Stop) LightAll (BrightnessStop); // Stop light ON

  else if (ClignoState) {
    if (millis() - Chrono > ClignoDur) {
      Chrono = millis();
      LightCligno (NCligno, ClignoDir);
      if (ClignoUp) {
        NCligno += 1;
        if (NCligno == NUM_LEDS1 / 2) ClignoUp = !ClignoUp;
      }
      else {
        NCligno -= 1;
        if (NCligno == 0) ClignoUp = !ClignoUp;
      }
    }
  }

  FastLED.show();
}

I understand only pinn number 4, it is not possible to turn on the direction. Only with pin 6, and pin 4 switches to the other direction indicator. This must work independently that pin 6 can be used to turn the right turn signal on and off. By contrast, the pin 4 must also work independently to turn the left turn signal on and off. In this code, it is not possible to turn on the left blinker with pin 4. You must turn on the right turn signal with pin 6 and then hold the mass on pin 4 then the left direction works. Now the wave works after 8 LEDs per side as it should, but there is another wave effect. I sent you a movie on PM as there is now a wave effect and how it should be. Can you change the lighting order of the left turn signal wave? Now the wave of the left direction starts from diode 0 to diode 7, if you can change it on starts from diode 7 and ends with diode: 0. Thank you very much for your help, you helped me a lot and I'm sorry that I am still asking for help, but I can not do it myself.

No worries, I said I'd help you and I'm glad to do it. I'll watch the videos, which one does show the effect you want?

I don't understand what you mean here:

I understand only pin number 4, it is not possible to turn on the direction. Only with pin 6, and pin 4 switches to the other direction indicator. This must work independently that pin 6 can be used to turn the right turn signal on and off. By contrast, the pin 4 must also work independently to turn the left turn signal on and off. In this code, it is not possible to turn on the left blinker with pin 4. You must turn on the right turn signal with pin 6 and then hold the mass on pin 4 then the left direction works.

Pin 4 should be connected to a switch. This device provides either LOW or HIGH to pin 4, depending on the direction it points to. Did you read how to connect the switch in the URL I recommended? So depending on the value the pin receives, the left turn or the right turn signal is shown. At least, this is what I tried to code :slight_smile:

Then, pin 6 is connected to the so-called mass signal. For now, it launches the wave and another push stops it.

A movie called: "It must be so.mp4" shows the desired effect. At the same time, the diodes from the range from 0 to: 7 must light up in the reverse order, that is from the diode: 7 to the diode: 0. Exactly this code works as you wrote.
I sent you a movie in PM how the work looks like, see if it works correctly.

Thanks for the video, it's nice to see it working. I think you should slow it down by increasing the value of ClignoDur
So, is this ok for you as it is ?

I will manage the change in speed.

Ok, please explain again what you need, I didn't understand your answer #15...

Hi
I understood this morning that the 'mass signal' must be used for the synchronization of the turn signal (the wave, up and down), so I'll send you another version taking this into account. The mass signal will launch only one wave (up and down) on the side given by the direction switch.

I had an idea, tell me what you think. For now, if you have the sign turn on and if you brake, the sign turn disappears and you only see the brake lights as long as you push the stop button. But I can add a reminder of the turn sign while the stop lights are lit: instead of the wave, I can lit only one led, going up and down.

It's not a complex modification, what do you think about it?

New version, including the idea I told you about:

#include <FastLED.h>
#define LED_PIN1     2
#define NUM_LEDS1   16

// buttons / switches for commands
#define StopButton 3
#define TurnSwitch 4
#define PosSwitch  5
#define MassSignal 6

CRGB leds[NUM_LEDS1]; // 0-7 left, 8-15 right

byte NTurn = 0;
bool Mass      = false;  // received mass signal ?
bool MassOld   = false;  // previous value
bool TurnState = false;  // turn light on or off ?
bool TurnDir   = false;  // true : right, false : left
bool TurnUp    = true;   // true : lights from 0 to 7, false : the other way
bool Stop      = false;  // stop light on or off ?
bool Position  = true;   // position light on or off ?

const byte BrightnessPos  =  40; // percentage
const byte BrightnessTurn = 100;
const byte BrightnessStop = 100;

unsigned long TurnDur     = 30ul;
unsigned long Chrono      = 0;

void ReadButtons () {
  TurnDir  =  digitalRead(TurnSwitch); // put a ! if not the correct direction
  Stop     = !digitalRead(StopButton);
  Position = !digitalRead(PosSwitch);
  MassOld  = Mass;
  Mass     = true; //!digitalRead(MassSignal);
  delay(20); // for debouncing AND filtering mass signal

  // Detection of the rising edge of the mass signal
  if (Mass && !MassOld) TurnState = true;
}

void LightTurn (byte n, bool Direction) {
  byte Offset = (Direction) ? 8 : 0;
  int orange  = 255 * BrightnessTurn / 100;
  int red     = 255 * BrightnessPos / 100;
  if (Stop) leds[n + Offset] = CRGB(orange, orange, 0);
  else {
    for (int i = 0; i < n; i++) leds[i + Offset] = CRGB(orange, orange, 0);
    if (!TurnUp) leds[n + Offset] = CRGB(red * Position, 0, 0);
  }
}

void TurnSignal () {
  if (millis() - Chrono > TurnDur) {
    Chrono = millis();
    Serial.println(NTurn);
    LightTurn (NTurn, TurnDir);
    if (TurnUp) {
      NTurn += 1;
      if (NTurn == NUM_LEDS1 / 2) TurnUp = !TurnUp;
    } else {
      NTurn -= 1;
      if (NTurn == 0) TurnState = false;
    }
  }
}

void LightAll (byte Bright) {
  int red = 255 * Bright / 100;
  fill_solid(leds, NUM_LEDS1, CRGB(red, 0, 0));
}

void setup() {
  FastLED.addLeds<WS2812B, LED_PIN1, GRB>(leds, NUM_LEDS1);
  pinMode (StopButton, INPUT_PULLUP);
  pinMode (TurnSwitch, INPUT_PULLUP);
  pinMode (PosSwitch,  INPUT_PULLUP);
  pinMode (MassSignal, INPUT_PULLUP);
  Serial.begin(115200);
  Serial.println("HELLO");
  Chrono = millis();
}

void loop() {
  ReadButtons ();

  if (!Position) {
    FastLED.clear(); // Position light OFF
  } else LightAll (BrightnessPos);     // Position light ON

  if (Stop) LightAll (BrightnessStop); // Stop light ON
  if (TurnState) TurnSignal ();        // Do the wave

  FastLED.show();
}

Now, if everything goes right, the turn signal is launched only when you hit the mass button

Code from post #12 shows the effect, wave on the movie: "this effect is.mp4" which I sent you. I want the effect for wave that is shown in the movie: "It must be so.mp4". The left wave starts working, from the diode: 0 to the diode: 7. It is the left direction so its work must start from the diode: 7 to the diode: 0 (change it, as you can). Otherwise, I have to cut the left led strip and turn it 180 degrees. The right wave is ok because it is the right direction indicator and the work starts from the diode: 8 to the diode: 15 and so it has to stay.
Is it possible that after each mass application on the pin that corresponds to the direction indicator control, the wave performed one full cycle and stopped? After re-applying the mass again will complete the full wave cycle and stop again? Yes over and over again when the mass is served. The point is that the wave frac after the mass application always must start starts with the first diode in the ruler for the left and right direction indicators. Now when I give the mass, the wave starts in a random place, it should always start work after giving the mass, from the first diode in the 8led strip (because the whole bar is divided into 2 parts of 8 LEDs). In practice, it has to work in this way (right turn signal). I give the mass and keep on pin 6 the wave performs one full cycle starting from the diode: 8 to: 15 and stops. I detach the mass from the pin 6 the wave goes out. Gives the mass again and I keep on pin 6, the wave performs one full cycle from the diode: 8 to the diode: 15. I detach the mass from the pin 6 the wave goes out. For the left turn signal the same way. I give the mass on pin 4 and I keep, the wave starts working now from the diode: 7 to the diode: 0 performs one full cycle and stops. I detach the mass from the pin 4 the wave goes out. Again I give the mass on the pin 4 wave starts working from the diode: 7 to diode: 0, performs one full cycle, stops. I detach the mass from the pin 4 the wave goes out. I hope you understood me. When giving the mass on pin 4, I need to be able to turn the wave on and off (now there is no such possibility). Now I have to turn on the mass wave on pin 6 and I can turn on the wave (left turn signal) by putting the mass on pin 4. You can make the turn signal lights work when the brake lights are on. The code from post # 20 does not work correctly. Gives the mass on the pin 6 wave will make one full cycle and go out. Later the braking and parking lights do not work anymore when I give the mass. It's still not the wave effect that I want. At the beginning of this post I wrote you which effect is to be. Thank you for your help and I'm sorry I'm still asking for it.

Here is another version:

#include <FastLED.h>
#define LED_PIN1     2
#define NUM_LEDS1   16

// buttons / switches for commands
#define StopButton 3
#define TurnSwitch 4
#define PosSwitch  5
#define MassSignal 6

CRGB leds[NUM_LEDS1]; // 0-7 left, 8-15 right

byte NTurn = 0;
bool Mass      = false;  // received mass signal ?
bool MassOld   = false;  // previous value
bool TurnState = false;  // turn light on or off ?
bool TurnDir   = false;  // true : right, false : left
bool TurnUp    = true;   // true : lights from 0 to 7, false : the other way
bool Stop      = false;  // stop light on or off ?
bool Position  = true;   // position light on or off ?

const byte BrightnessPos  =  40; // percentage
const byte BrightnessTurn = 100;
const byte BrightnessStop = 100;

unsigned long TurnDur     = 30ul;
unsigned long Chrono      = 0;

void ReadButtons () {
  TurnDir  =  digitalRead(TurnSwitch); // put a ! if not the correct direction
  Stop     = !digitalRead(StopButton);
  Position = !digitalRead(PosSwitch);
  MassOld  = Mass;
  Mass     = !digitalRead(MassSignal);
  delay(20); // for debouncing AND filtering mass signal

  // Detection of the rising edge of the mass signal
  if (Mass && !MassOld) TurnState = true;
}

void LightTurn (byte n, bool Direction) {
  byte Offset = (Direction) ? 8 : 0;
  int orange  = 255 * BrightnessTurn / 100;
  int red     = 255 * BrightnessPos  / 100;
  byte kn = n * Direction + (7 - n) * (1 - Direction);
  if (Stop) leds[kn + Offset] = CRGB(orange, orange, 0);
  else {
    for (int i = 0; i < n; i++) {
      byte k = i * Direction + (7 - i) * (1 - Direction);
      leds[k + Offset] = CRGB(orange, orange, 0);
    }
    if (!TurnUp) leds[kn + Offset] = CRGB(red * Position, 0, 0);
  }
}

void TurnSignal () {
  if (millis() - Chrono > TurnDur) {
    Chrono = millis();
    LightTurn (NTurn, TurnDir);
    if (TurnUp) {
      NTurn += 1;
      if (NTurn == NUM_LEDS1 / 2) TurnUp = !TurnUp;
    } else {
      NTurn -= 1;
      if (NTurn == 0) TurnState = false;
    }
  }
}

void LightAll (byte Bright) {
  int red = 255 * Bright / 100;
  fill_solid(leds, NUM_LEDS1, CRGB(red, 0, 0));
}

void setup() {
  FastLED.addLeds<WS2812B, LED_PIN1, GRB>(leds, NUM_LEDS1);
  pinMode (StopButton, INPUT_PULLUP);
  pinMode (TurnSwitch, INPUT_PULLUP);
  pinMode (PosSwitch,  INPUT_PULLUP);
  pinMode (MassSignal, INPUT_PULLUP);
  Serial.begin(115200);
  Chrono = millis();
}

void loop() {
  ReadButtons ();

  if (!Position) {
    FastLED.clear(); // Position light OFF
  } else LightAll (BrightnessPos);     // Position light ON

  if (Stop) LightAll (BrightnessStop); // Stop light ON
  if (TurnState) TurnSignal ();        // Do the wave

  FastLED.show();
}

The only change is I try to have the wave go from 7 down to 0 and then up for the left sign.

Is it possible that after each mass application on the pin that corresponds to the direction indicator control, the wave performed one full cycle and stopped?

That's what I tried to do. The problem is that I can't test it here, so I'm "blind coding". You need to explain precisely what you see to help me understand what I have to change.

In practice, it has to work in this way (right turn signal). I give the mass and keep on pin 6 the wave performs one full cycle starting from the diode: 8 to: 15 and stops. I detach the mass from the pin 6 the wave goes out.

OK I see, it's not what I thought.

So what you want for the right turn signal is:

  • pin 6 rising from HIGH to LOW (or is it just pin 6 LOW?): launch the wave up from 8 to 15 and wait.

  • pin 6 falling from LOW to HIGH (or just pin 6 HIGH?): launch the wave from 15 down to 8 and wait.
    And the same for the left sign:

  • pin 4 from HIGH to LOW: launch the wave down from 7 to 0 and wait.

  • pin 4 from LOW to HIGH: launch the wave from 0 up to 7 and wait.
    Is this correct ?

I'll work on that shortly.