Wenn das deine Meinung ist dann lassen wir das. Ich schließe das hier jetzt ich kann das auch mit 2 Boards laufen lassen.
Das hier wird ja wieder ein 100 Beiträge Ding bis sich was bewegt
Mir war langweilig und ich bin dumm...
Ergebnis
Sketch uses 2422 bytes (7%) of program storage space. Maximum is 32256 bytes.
Global variables use 196 bytes (9%) of dynamic memory, leaving 1852 bytes for local variables. Maximum is 2048 bytes.
Code
// https://forum.arduino.cc/t/hallo-kann-man-beide-funktionen-auf-einem-board-laufen-lassen-oder-muss-ich-2-board-haben/1389975
//---AAAAAAAAA------------------------------------------
const byte inputPin_A{ 2 };
const byte outputPin_A[]{ 2, 3, 4, 5, 6, 7, };
const byte anzahlPin_A = sizeof(outputPin_A) / sizeof(outputPin_A[0]);
bool gedrueckt_A = false;
bool lastState_A = !gedrueckt_A;
byte step_A = 0;
//---BBBBBBBBB------------------------------------------
const byte inputPin{ 8 };
const byte outputPin[]{ 11, 12, };
const byte anzahlPin = sizeof(outputPin) / sizeof(outputPin[2]);
bool gedrueckt = false;
bool lastState = !gedrueckt;
byte step = 0;
void setup()
{
//---AAAAAAAAA------------------------------------------
Serial.begin(115200);
pinMode(inputPin_A, INPUT_PULLUP);
for (byte b = 0; b < anzahlPin_A; b++)
{
pinMode(outputPin_A[b], OUTPUT);
digitalWrite(outputPin_A[b], HIGH);
}
digitalWrite(outputPin_A[0], LOW);
//---BBBBBBBBB------------------------------------------
/// Zweifelhaft: Serial.begin(10);
pinMode(inputPin, INPUT_PULLUP);
for (byte b = 0; b < anzahlPin; b++)
{
pinMode(outputPin[b], OUTPUT);
digitalWrite(outputPin[b], HIGH);
}
digitalWrite(outputPin[0], LOW);
}
void loop()
{
//---AAAAAAAAA------------------------------------------
if (!digitalRead(inputPin_A))
{
if (lastState_A == !gedrueckt_A)
{
lastState_A = gedrueckt_A;
for (byte b = 1; b < anzahlPin_A; b++) // kann evtl. entfallen
{
digitalWrite(outputPin_A[b], HIGH);
}
step_A++; // nächste Stufe auswählen
if (step_A >= anzahlPin_A)
{
step_A = 1;
}
digitalWrite(outputPin_A[step_A], LOW);
}
}
else if (lastState_A == gedrueckt_A)
{
lastState_A = !gedrueckt_A;
}
delay(100);
for (byte b = 0; b < anzahlPin_A; b++) // alles aus machen
{
digitalWrite(outputPin_A[b], HIGH);
}
//---BBBBBBBBB------------------------------------------
if (!digitalRead(inputPin))
{
if (lastState == !gedrueckt)
{
lastState = gedrueckt;
for (byte b = 1; b < anzahlPin; b++) // kann evtl. entfallen
{
digitalWrite(outputPin[b], HIGH);
}
step++; // nächste Stufe auswählen
if (step >= anzahlPin)
{
step = 1;
}
digitalWrite(outputPin[step], LOW);
}
}
else if (lastState == gedrueckt)
{
lastState = !gedrueckt;
}
delay(500);
for (byte b = 0; b < anzahlPin; b++) // alles aus machen
{
digitalWrite(outputPin[b], HIGH);
}
}
Du...
Ich habe sogar noch mehr Meinungen/Ansichten, bin mir aber auch sehr sicher, dass du diese nicht hören/lesen möchtest.
Habe sogar eine (oder auch mehrere) vorgefertigte Lösungsstrategie für seine Sorgen.
z.B: [Projekt] Multitasking
Und warum nimmst Du die Hilfe nicht an?
Ich las das da oben stehen.
Es war Deine Anforderung, die ist umgesetzt.
Da Du hier nicht mehr mitmachen willst, bin ich dann auch raus.
Genau so wollte ich das , so funktioniert alles auf einem Board. Danke dir vielmals