wie kann ich zwei programme (sketes) zusammenführen Arduino?

ich will zwei programme zusamen führen wie kann ich das ?(beide programme fonktioniren einzeln) Hier sind die programme: 1. #include #include

Servo ServoMotor; char* password = "123"; // change the password here, just pick any 3 numbers char* password1 = "456"; char* password2 = "789"; int position = 0; const byte ROWS = 4; const byte COLS = 4; char keys[ROWS][COLS] = { {'1','2','3','A'}, {'4','5','6','B'}, {'7','8','9','C'}, {'*','0','#','D'} };

byte rowPins[ROWS] = { 8, 7, 6, 9 }; byte colPins[COLS] = { 5, 4, 3, 2 }; Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS ); int RedpinLock = 12; int GreenpinUnlock = 13;

void setup() { pinMode(RedpinLock, OUTPUT); pinMode(GreenpinUnlock, OUTPUT); ServoMotor.attach(11); LockedPosition(true); }

void loop() { char key = keypad.getKey(); if (key == '*' || key == '#') { position = 0; LockedPosition(true); } if (key == password[position]) { position ++; } if (key == password1[position]) { } if (key == password2[position]) { position ++; } if (position == 3) { LockedPosition(false); } delay(100); } void LockedPosition(int locked) { if (locked) { digitalWrite(RedpinLock, HIGH); digitalWrite(GreenpinUnlock, LOW); ServoMotor.write(11); } else { digitalWrite(RedpinLock, LOW); digitalWrite(GreenpinUnlock, HIGH); ServoMotor.write(90); } }

2.

int licht;

void setup() { Serial.begin(9600); pinMode(13,OUTPUT);

}

void loop() { // put your main code here, to run repeatedly: licht = analogRead(0); Serial.print (licht),delay;

if (licht < 940) { digitalWrite(13,HIGH); } else { digitalWrite(13, LOW); }}

...zum Beitrag

geht das mit Interrupts?

...zur Antwort
wie kann ich zwei programme (sketes) zusammenführen Arduino?

ich will zwei programme zusamen führen wie kann ich das ?(beide programme fonktioniren einzeln) Hier sind die programme: 1. #include #include

Servo ServoMotor; char* password = "123"; // change the password here, just pick any 3 numbers char* password1 = "456"; char* password2 = "789"; int position = 0; const byte ROWS = 4; const byte COLS = 4; char keys[ROWS][COLS] = { {'1','2','3','A'}, {'4','5','6','B'}, {'7','8','9','C'}, {'*','0','#','D'} };

byte rowPins[ROWS] = { 8, 7, 6, 9 }; byte colPins[COLS] = { 5, 4, 3, 2 }; Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS ); int RedpinLock = 12; int GreenpinUnlock = 13;

void setup() { pinMode(RedpinLock, OUTPUT); pinMode(GreenpinUnlock, OUTPUT); ServoMotor.attach(11); LockedPosition(true); }

void loop() { char key = keypad.getKey(); if (key == '*' || key == '#') { position = 0; LockedPosition(true); } if (key == password[position]) { position ++; } if (key == password1[position]) { } if (key == password2[position]) { position ++; } if (position == 3) { LockedPosition(false); } delay(100); } void LockedPosition(int locked) { if (locked) { digitalWrite(RedpinLock, HIGH); digitalWrite(GreenpinUnlock, LOW); ServoMotor.write(11); } else { digitalWrite(RedpinLock, LOW); digitalWrite(GreenpinUnlock, HIGH); ServoMotor.write(90); } }

2.

int licht;

void setup() { Serial.begin(9600); pinMode(13,OUTPUT);

}

void loop() { // put your main code here, to run repeatedly: licht = analogRead(0); Serial.print (licht),delay;

if (licht < 940) { digitalWrite(13,HIGH); } else { digitalWrite(13, LOW); }}

...zum Beitrag

mit  zusammenführen meinte ich die beide codes auf ein arduino board laden

...zur Antwort
wie kann ich zwei programme (sketes) zusammenführen Arduino?

ich will zwei programme zusamen führen wie kann ich das ?(beide programme fonktioniren einzeln) Hier sind die programme: 1. #include #include

Servo ServoMotor; char* password = "123"; // change the password here, just pick any 3 numbers char* password1 = "456"; char* password2 = "789"; int position = 0; const byte ROWS = 4; const byte COLS = 4; char keys[ROWS][COLS] = { {'1','2','3','A'}, {'4','5','6','B'}, {'7','8','9','C'}, {'*','0','#','D'} };

byte rowPins[ROWS] = { 8, 7, 6, 9 }; byte colPins[COLS] = { 5, 4, 3, 2 }; Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS ); int RedpinLock = 12; int GreenpinUnlock = 13;

void setup() { pinMode(RedpinLock, OUTPUT); pinMode(GreenpinUnlock, OUTPUT); ServoMotor.attach(11); LockedPosition(true); }

void loop() { char key = keypad.getKey(); if (key == '*' || key == '#') { position = 0; LockedPosition(true); } if (key == password[position]) { position ++; } if (key == password1[position]) { } if (key == password2[position]) { position ++; } if (position == 3) { LockedPosition(false); } delay(100); } void LockedPosition(int locked) { if (locked) { digitalWrite(RedpinLock, HIGH); digitalWrite(GreenpinUnlock, LOW); ServoMotor.write(11); } else { digitalWrite(RedpinLock, LOW); digitalWrite(GreenpinUnlock, HIGH); ServoMotor.write(90); } }

2.

int licht;

void setup() { Serial.begin(9600); pinMode(13,OUTPUT);

}

void loop() { // put your main code here, to run repeatedly: licht = analogRead(0); Serial.print (licht),delay;

if (licht < 940) { digitalWrite(13,HIGH); } else { digitalWrite(13, LOW); }}

...zum Beitrag

der code 1 ist ein code für ein keypad

der code 2 für ein fotowiderstand lichtschranke

danke für die schnelle antwort

...zur Antwort
wie kann ich zwei programme zusammenführen Arduino?

ich will zwei programme zusamen führen wie kann ich das ?(beide programme fonktioniren einzeln) Hier sind die programme (arduino UNO ) :#include #include

Servo ServoMotor; char* password = "123"; // change the password here, just pick any 3 numbers char* password1 = "456"; char* password2 = "789"; int position = 0; const byte ROWS = 4; const byte COLS = 4; char keys[ROWS][COLS] = { {'1','2','3','A'}, {'4','5','6','B'}, {'7','8','9','C'}, {'*','0','#','D'} };

byte rowPins[ROWS] = { 8, 7, 6, 9 }; byte colPins[COLS] = { 5, 4, 3, 2 }; Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS ); int RedpinLock = 12; int GreenpinUnlock = 13; int licht;

void setup() { pinMode(RedpinLock, OUTPUT); pinMode(GreenpinUnlock, OUTPUT); ServoMotor.attach(11); LockedPosition(true); Serial.begin(9600); pinMode(13,OUTPUT); }

void loop() { char key = keypad.getKey(); if (key == '*' || key == '#') { position = 0; LockedPosition(true); } if (key == password[position]) { position ++; } if (key == password1[position]) { position ++; } if (key == password2[position]) { position ++; } if (position == 3) { LockedPosition(false); } delay(100); } void LockedPosition(int locked) { if (locked) { digitalWrite(RedpinLock, HIGH); digitalWrite(GreenpinUnlock, LOW); ServoMotor.write(11); } else { digitalWrite(RedpinLock, LOW); digitalWrite(GreenpinUnlock, HIGH); ServoMotor.write(90); } { licht = analogRead(0); Serial.print (licht);

if (licht < 940) { digitalWrite(13,HIGH); } else { digitalWrite(13, LOW); }

}}

int licht;

void setup() { Serial.begin(9600); pinMode(13,OUTPUT);

}

void loop() { // put your main code here, to run repeatedly: licht = analogRead(0); Serial.print (licht),delay;

if (licht < 940) { digitalWrite(13,HIGH); } else { digitalWrite(13, LOW); }}

vielen Dank

...zum Beitrag

hallo propaganja

diese frage ist falsch es gibt eine neue die heist :wie kann ich zwei programme (sketes) zusammen führen Arduino?

ich poste in da

heist :arduino programm.

...zur Antwort