hi all,
my goal is to control bistable Relais by digital or analog Output (HIGH,LOW).
Above Code works well with default digital pins.
But all pins except 14-19 of Arduino mega 2560 are in use by LED or Servo
on this Project !
In the pinouts i find that pins 14-19 are rx/tx pins and digital pins both.
Tried to use them with digitalWrite and analogWrite
but seems not to work ...
here parts of code
#define ANZ_RELAIS_PINS 6
.
.
uint8_t relais_pins[ANZ_RELAIS_PINS] = {14,15,16,17,18,19};
.
.
//- Pins fuer Relais initialisieren
for(i=0;i < ANZ_RELAIS_PINS;i++)
{
pinMode( relais_pins[i],OUTPUT);
send_pulse(relais_pins[i]);
}
.
.
void send_pulse(int pin)
{
//- mer mache das jetzt einfach auf nen digitalen PIN..weil bei den bistab.Relais ein FlipFlop
//- benutzt wird, braucht man eine Negative Flanke !
//lcd.lineWrap();
//lcd.print(" #send_pulse pin : " + String(pin));
//- Impuls senden -----------------
//digitalWrite(pin, LOW);
analogWrite(pin, A_LOW);
delay(TRIGGER_DELAY);
//digitalWrite(pin, HIGH);
analogWrite(pin, A_HIGH_2);
}
any tip would be nice..
if it cant be soluted this way
i mention to use a port-expander like
Adafruit_PWMServoDriver PCA9685 PWM-Port-Expander,which i have aready in use
..guess, that switching LED,driving Servo with PWM
or something else is similar..