Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ####################################
- Motorola GM Remote Channel Steering
- by Angga S Arly
- anggafunkadelic@gmail.com
- www.ngoprekradio.com
- 2014
- ####################################
- */
- #include <EEPROM.h> // loding librari eeprom
- const int BCDPin1 = 4;
- const int BCDPin2 = 3;
- const int BCDPin3 = 2;
- const int BCDPin4 = 1;
- const int BCDPinX = 0;
- // state BCD dari MT8870
- int BCDState1 = 0;
- int BCDState2 = 0;
- int BCDState3 = 0;
- int BCDState4 = 0;
- int BCDStateX = 0;
- // state hasil decode ke desimal
- int S0 = 0;
- int S1 = 0;
- int S2 = 0;
- int S3 = 0;
- int S4 = 0;
- int S5 = 0;
- int S6 = 0;
- int S7 = 0;
- int S8 = 0;
- int S9 = 0;
- int SB0 = 0; // bintang
- int SP0 = 0; // pager
- // konci kombinasi
- int D1 = 0;
- int D2 = 0;
- int D3 = 0;
- int D4 = 0;
- int D5 = 0;
- int D6 = 0;
- int D7 = 0;
- int U1 = 0;
- int V1 = 0;
- int W1 = 0;
- int X1 = 0;
- int Y1 = 0;
- int Z1 = 0;
- // alokasi pin output / relay
- const int LedPin1 = 5;
- const int LedPin2 = 6;
- const int LedPin3 = 7;
- const int LedPin4 = 8;
- const int LedPin5 = 9;
- const int LedPin6 = 10;
- const int LedPin7 = 11;
- const int LedPin8 = 12;
- const int LedPin9 = 13;
- // loding eeprom
- int baca = 0;
- int bacaR1 = 0;
- int bacaR2 = 0;
- void setup() {
- //alokasi pin input ( BCD )
- pinMode(BCDPin1, INPUT);
- pinMode(BCDPin2, INPUT);
- pinMode(BCDPin3, INPUT);
- pinMode(BCDPin4, INPUT);
- pinMode(BCDPinX, INPUT);
- // alokasi pin output ( Relay )
- pinMode(LedPin1, OUTPUT);
- pinMode(LedPin2, OUTPUT);
- pinMode(LedPin3, OUTPUT);
- pinMode(LedPin4, OUTPUT);
- pinMode(LedPin5, OUTPUT);
- pinMode(LedPin6, OUTPUT);
- pinMode(LedPin7, OUTPUT);
- pinMode(LedPin8, OUTPUT);
- pinMode(LedPin9, OUTPUT);
- bacaeeprom();
- }
- void bacaeeprom() {
- baca = EEPROM.read(100);
- if ( baca == 1 ) {
- ch01();
- }
- if ( baca == 2 ) {
- ch02();
- }
- if ( baca == 3 ) {
- ch03();
- }
- if ( baca == 4 ) {
- ch04();
- }
- if ( baca == 5 ) {
- ch05();
- }
- if ( baca == 6 ) {
- ch06();
- }
- if ( baca == 7 ) {
- ch07();
- }
- if ( baca == 8 ) {
- ch08();
- }
- if ( baca == 9 ) {
- ch09();
- }
- if ( baca == 10 ) {
- ch10();
- }
- if ( baca == 11 ) {
- ch11();
- }
- if ( baca == 12 ) {
- ch12();
- }
- if ( baca == 13 ) {
- ch13();
- }
- if ( baca == 14 ) {
- ch14();
- }
- if ( baca == 15 ) {
- ch15();
- }
- if ( baca == 16 ) {
- ch16();
- }
- if ( baca == 17 ) {
- ch17();
- }
- if ( baca == 18 ) {
- ch18();
- }
- if ( baca == 19 ) {
- ch19();
- }
- if ( baca == 20 ) {
- ch20();
- }
- if ( baca == 21 ) {
- ch21();
- }
- if ( baca == 22 ) {
- ch22();
- }
- if ( baca == 23 ) {
- ch23();
- }
- if ( baca == 24 ) {
- ch24();
- }
- if ( baca == 25 ) {
- ch25();
- }
- if ( baca == 26 ) {
- ch26();
- }
- if ( baca == 27 ) {
- ch27();
- }
- if ( baca == 28 ) {
- ch28();
- }
- if ( baca == 29 ) {
- ch29();
- }
- if ( baca == 30 ) {
- ch30();
- }
- if ( baca == 31 ) {
- ch31();
- }
- bacaR1 = EEPROM.read(41);
- bacaR2 = EEPROM.read(51);
- if ( bacaR1 == 1 ) { R1on(); }
- if ( bacaR1 == 0 ) { R1off(); }
- if ( bacaR2 == 1 ) { R2on(); }
- if ( bacaR2 == 0 ) { R2off(); }
- } // END baca eeprom
- void cekinput() {
- BCDState1 = digitalRead(BCDPin1);
- BCDState2 = digitalRead(BCDPin2);
- BCDState3 = digitalRead(BCDPin3);
- BCDState4 = digitalRead(BCDPin4);
- BCDStateX = digitalRead(BCDPinX);
- if (BCDStateX == HIGH) {
- // detek 0
- if (BCDState1 == LOW) {
- if (BCDState2 == HIGH) {
- if (BCDState3 == LOW) {
- if (BCDState4 == HIGH) {
- S0 = 1;
- }
- }
- }
- }
- // detek 1
- if (BCDState1 == HIGH) {
- if (BCDState2 == LOW) {
- if (BCDState3 == LOW) {
- if (BCDState4 == LOW) {
- S1 = 1;
- }
- }
- }
- }
- // detek 2
- if (BCDState1 == LOW) {
- if (BCDState2 == HIGH) {
- if (BCDState3 == LOW) {
- if (BCDState4 == LOW) {
- S2 = 1;
- }
- }
- }
- }
- // detek 3
- if (BCDState1 == HIGH) {
- if (BCDState2 == HIGH) {
- if (BCDState3 == LOW) {
- if (BCDState4 == LOW) {
- S3 = 1;
- }
- }
- }
- }
- // detek 4
- if (BCDState1 == LOW) {
- if (BCDState2 == LOW) {
- if (BCDState3 == HIGH) {
- if (BCDState4 == LOW) {
- S4 = 1;
- }
- }
- }
- }
- // detek 5
- if (BCDState1 == HIGH) {
- if (BCDState2 == LOW) {
- if (BCDState3 == HIGH) {
- if (BCDState4 == LOW) {
- S5 = 1;
- }
- }
- }
- }
- // detek 6
- if (BCDState1 == LOW) {
- if (BCDState2 == HIGH) {
- if (BCDState3 == HIGH) {
- if (BCDState4 == LOW) {
- S6 = 1;
- }
- }
- }
- }
- // detek 7
- if (BCDState1 == HIGH) {
- if (BCDState2 == HIGH) {
- if (BCDState3 == HIGH) {
- if (BCDState4 == LOW) {
- S7 = 1;
- }
- }
- }
- }
- // detek 8
- if (BCDState1 == LOW) {
- if (BCDState2 == LOW) {
- if (BCDState3 == LOW) {
- if (BCDState4 == HIGH) {
- S8 = 1;
- }
- }
- }
- }
- // detek 9
- if (BCDState1 == HIGH) {
- if (BCDState2 == LOW) {
- if (BCDState3 == LOW) {
- if (BCDState4 == HIGH) {
- S9 = 1;
- }
- }
- }
- }
- // detek *
- if (BCDState1 == HIGH) {
- if (BCDState2 == HIGH) {
- if (BCDState3 == LOW) {
- if (BCDState4 == HIGH) {
- SB0 = 1;
- }
- }
- }
- }
- // detek #
- if (BCDState1 == LOW) {
- if (BCDState2 == LOW) {
- if (BCDState3 == HIGH) {
- if (BCDState4 == HIGH) {
- SP0 = 1;
- }
- }
- }
- }
- }
- } // END cekinput
- // password 347
- void cekkombinasi() {
- if ( S3 == 1 ) {
- D1 = 1;
- }
- if ( D1 == 1 ) {
- if ( S4 == 1 ) {
- D2 = 1;
- }
- }
- if ( D2 == 1 ) {
- if ( S7 == 1 ) {
- D3 = 1;
- }
- }
- // selain angka password reset aja cong
- if ( S4 == 1 ) {
- if ( D1 == 0 ) {
- resetkombinasi();
- }
- }
- if ( S7 == 1 ) {
- if ( D2 == 0 ) {
- resetkombinasi();
- }
- }
- // lanjuutt
- if ( SP0 == 1 ) {
- if ( D3 == 0 ) {
- resetkombinasi();
- }
- }
- if ( SB0 == 1 ) {
- if ( D3 == 0 ) {
- resetkombinasi();
- }
- }
- if ( S0 == 1 ) {
- if ( D3 == 0 ) {
- resetkombinasi();
- }
- }
- if ( S1 == 1 ) {
- if ( D3 == 0 ) {
- resetkombinasi();
- }
- }
- if ( S2 == 1 ) {
- if ( D3 == 0 ) {
- resetkombinasi();
- }
- }
- // yang mengandung angka password disable ajah yaksz
- //if ( S3 == 1 ) {
- // if ( D3 == 0 ) {
- // resetkombinasi();
- // }
- //}
- //if ( S4 == 1 ) {
- // if ( D3 == 0 ) {
- // resetkombinasi();
- // }
- //}
- if ( S5 == 1 ) {
- if ( D3 == 0 ) {
- resetkombinasi();
- }
- }
- if ( S6 == 1 ) {
- if ( D3 == 0 ) {
- resetkombinasi();
- }
- }
- //if ( S7 == 1 ) {
- // if ( D3 == 0 ) {
- // resetkombinasi();
- // }
- //}
- if ( S8 == 1 ) {
- if ( D3 == 0 ) {
- resetkombinasi();
- }
- }
- if ( S9 == 1 ) {
- if ( D3 == 0 ) {
- resetkombinasi();
- }
- }
- } //END cekkombinasi
- void cek6digit() {
- if ( D3 == 1 ) {
- if ( S0 == 1 ) {
- U1 = 1;
- //resetinput();
- delay(300);
- }
- }
- if ( D3 == 1 ) {
- if ( S1 == 1 ) {
- V1 = 1;
- //resetinput();
- delay(300);
- }
- }
- if ( D3 == 1 ) {
- if ( S2 == 1 ) {
- W1 = 1;
- //resetinput();
- delay(300);
- }
- }
- if ( D3 == 1 ) {
- if ( S3 == 1 ) {
- X1 = 1;
- //resetinput();
- delay(300);
- }
- }
- if ( D3 == 1 ) {
- if ( S4 == 1 ) {
- Y1 = 1;
- //resetinput();
- delay(300);
- }
- }
- if ( D3 == 1 ) {
- if ( S5 == 1 ) {
- Z1 = 1;
- //resetinput();
- delay(300);
- }
- }
- resetinput();
- } // END cek 3 digit
- void channelselect() {
- // kepala 0
- if ( U1 == 1 ) {
- if ( S1 == 1 ) { klir(); ch01(); EEPROM.write(100,1); resetsemuah(); }
- else if ( S2 == 1 ) { klir(); ch02(); EEPROM.write(100,2); resetsemuah(); }
- else if ( S3 == 1 ) { klir(); ch03(); EEPROM.write(100,3); resetsemuah(); }
- else if ( S4 == 1 ) { klir(); ch04(); EEPROM.write(100,4); resetsemuah(); }
- else if ( S5 == 1 ) { klir(); ch05(); EEPROM.write(100,5); resetsemuah(); }
- else if ( S6 == 1 ) { klir(); ch06(); EEPROM.write(100,6); resetsemuah(); }
- else if ( S7 == 1 ) { klir(); ch07(); EEPROM.write(100,7); resetsemuah(); }
- else if ( S8 == 1 ) { klir(); ch08(); EEPROM.write(100,8); resetsemuah(); }
- else if ( S9 == 1 ) { klir(); ch09(); EEPROM.write(100,9); resetsemuah(); }
- } // END kepala 0
- // kepala 1
- if ( V1 == 1 ) {
- if ( S0 == 1 ) { klir(); ch10(); EEPROM.write(100,10); resetsemuah(); }
- else if ( S1 == 1 ) { klir(); ch11(); EEPROM.write(100,11); resetsemuah(); }
- else if ( S2 == 1 ) { klir(); ch12(); EEPROM.write(100,12); resetsemuah(); }
- else if ( S3 == 1 ) { klir(); ch13(); EEPROM.write(100,13); resetsemuah(); }
- else if ( S4 == 1 ) { klir(); ch14(); EEPROM.write(100,14); resetsemuah(); }
- else if ( S5 == 1 ) { klir(); ch15(); EEPROM.write(100,15); resetsemuah(); }
- else if ( S6 == 1 ) { klir(); ch16(); EEPROM.write(100,16); resetsemuah(); }
- else if ( S7 == 1 ) { klir(); ch17(); EEPROM.write(100,17); resetsemuah(); }
- else if ( S8 == 1 ) { klir(); ch18(); EEPROM.write(100,18); resetsemuah(); }
- else if ( S9 == 1 ) { klir(); ch19(); EEPROM.write(100,19); resetsemuah(); }
- } // END kepala 1
- // kepala 2
- if ( W1 == 1 ) {
- if ( S0 == 1 ) { klir(); ch20(); EEPROM.write(100,20); resetsemuah(); }
- else if ( S1 == 1 ) { klir(); ch21(); EEPROM.write(100,21); resetsemuah(); }
- else if ( S2 == 1 ) { klir(); ch22(); EEPROM.write(100,22); resetsemuah(); }
- else if ( S3 == 1 ) { klir(); ch23(); EEPROM.write(100,23); resetsemuah(); }
- else if ( S4 == 1 ) { klir(); ch24(); EEPROM.write(100,24); resetsemuah(); }
- else if ( S5 == 1 ) { klir(); ch25(); EEPROM.write(100,25); resetsemuah(); }
- else if ( S6 == 1 ) { klir(); ch26(); EEPROM.write(100,26); resetsemuah(); }
- else if ( S7 == 1 ) { klir(); ch27(); EEPROM.write(100,27); resetsemuah(); }
- else if ( S8 == 1 ) { klir(); ch28(); EEPROM.write(100,28); resetsemuah(); }
- else if ( S9 == 1 ) { klir(); ch29(); EEPROM.write(100,29); resetsemuah(); }
- } // END kepala 2
- // kepala 3
- if ( X1 == 1 ) {
- if ( S0 == 1 ) { klir(); ch30(); EEPROM.write(100,30); resetsemuah(); }
- else if ( S1 == 1 ) { klir(); ch31(); EEPROM.write(100,31); resetsemuah(); }
- } // END kepala 3
- // kepala 4
- if ( Y1 == 1 ) {
- if ( S0 == 1 ) { R1off(); EEPROM.write(41,0); resetsemuah(); }
- else if ( S1 == 1 ) { R1on(); EEPROM.write(41,1); resetsemuah(); }
- } // END kepala 4
- // kepala 5
- if ( Z1 == 1 ) {
- if ( S0 == 1 ) { R2off(); EEPROM.write(51,0); resetsemuah(); }
- else if ( S1 == 1 ) { R2on(); EEPROM.write(51,1); resetsemuah(); }
- } // END kepala 4
- } // END channel select
- // Relay 1 & 2
- void R1on() { digitalWrite(LedPin7, HIGH); }
- void R1off() { digitalWrite(LedPin7, LOW); }
- void R2on() { digitalWrite(LedPin8, HIGH); }
- void R2off() { digitalWrite(LedPin8, LOW); }
- void ch01() {
- digitalWrite(LedPin1, HIGH);
- digitalWrite(LedPin2, LOW);
- digitalWrite(LedPin3, LOW);
- digitalWrite(LedPin4, LOW);
- digitalWrite(LedPin5, LOW);
- }
- void ch02() {
- digitalWrite(LedPin1, LOW);
- digitalWrite(LedPin2, HIGH);
- digitalWrite(LedPin3, LOW);
- digitalWrite(LedPin4, LOW);
- digitalWrite(LedPin5, LOW);
- }
- void ch03() {
- digitalWrite(LedPin1, HIGH);
- digitalWrite(LedPin2, HIGH);
- digitalWrite(LedPin3, LOW);
- digitalWrite(LedPin4, LOW);
- digitalWrite(LedPin5, LOW);
- }
- void ch04() {
- digitalWrite(LedPin1, LOW);
- digitalWrite(LedPin2, LOW);
- digitalWrite(LedPin3, HIGH);
- digitalWrite(LedPin4, LOW);
- digitalWrite(LedPin5, LOW);
- }
- void ch05() {
- digitalWrite(LedPin1, HIGH);
- digitalWrite(LedPin2, LOW);
- digitalWrite(LedPin3, HIGH);
- digitalWrite(LedPin4, LOW);
- digitalWrite(LedPin5, LOW);
- }
- void ch06() {
- digitalWrite(LedPin1, LOW);
- digitalWrite(LedPin2, HIGH);
- digitalWrite(LedPin3, HIGH);
- digitalWrite(LedPin4, LOW);
- digitalWrite(LedPin5, LOW);
- }
- void ch07() {
- digitalWrite(LedPin1, HIGH);
- digitalWrite(LedPin2, HIGH);
- digitalWrite(LedPin3, HIGH);
- digitalWrite(LedPin4, LOW);
- digitalWrite(LedPin5, LOW);
- }
- void ch08() {
- digitalWrite(LedPin1, LOW);
- digitalWrite(LedPin2, LOW);
- digitalWrite(LedPin3, LOW);
- digitalWrite(LedPin4, HIGH);
- digitalWrite(LedPin5, LOW);
- }
- void ch09() {
- digitalWrite(LedPin1, HIGH);
- digitalWrite(LedPin2, LOW);
- digitalWrite(LedPin3, LOW);
- digitalWrite(LedPin4, HIGH);
- digitalWrite(LedPin5, LOW);
- }
- void ch10() {
- digitalWrite(LedPin1, LOW);
- digitalWrite(LedPin2, HIGH);
- digitalWrite(LedPin3, LOW);
- digitalWrite(LedPin4, HIGH);
- digitalWrite(LedPin5, LOW);
- }
- void ch11() {
- digitalWrite(LedPin1, HIGH);
- digitalWrite(LedPin2, HIGH);
- digitalWrite(LedPin3, LOW);
- digitalWrite(LedPin4, HIGH);
- digitalWrite(LedPin5, LOW);
- }
- void ch12() {
- digitalWrite(LedPin1, LOW);
- digitalWrite(LedPin2, LOW);
- digitalWrite(LedPin3, HIGH);
- digitalWrite(LedPin4, HIGH);
- digitalWrite(LedPin5, LOW);
- }
- void ch13() {
- digitalWrite(LedPin1, HIGH);
- digitalWrite(LedPin2, LOW);
- digitalWrite(LedPin3, HIGH);
- digitalWrite(LedPin4, HIGH);
- digitalWrite(LedPin5, LOW);
- }
- void ch14() {
- digitalWrite(LedPin1, LOW);
- digitalWrite(LedPin2, HIGH);
- digitalWrite(LedPin3, HIGH);
- digitalWrite(LedPin4, HIGH);
- digitalWrite(LedPin5, LOW);
- }
- void ch15() {
- digitalWrite(LedPin1, HIGH);
- digitalWrite(LedPin2, HIGH);
- digitalWrite(LedPin3, HIGH);
- digitalWrite(LedPin4, HIGH);
- digitalWrite(LedPin5, LOW);
- }
- void ch16() {
- digitalWrite(LedPin1, LOW);
- digitalWrite(LedPin2, LOW);
- digitalWrite(LedPin3, LOW);
- digitalWrite(LedPin4, LOW);
- digitalWrite(LedPin5, HIGH);
- }
- void ch17() {
- digitalWrite(LedPin1, HIGH);
- digitalWrite(LedPin2, LOW);
- digitalWrite(LedPin3, LOW);
- digitalWrite(LedPin4, LOW);
- digitalWrite(LedPin5, HIGH);
- }
- void ch18() {
- digitalWrite(LedPin1, LOW);
- digitalWrite(LedPin2, HIGH);
- digitalWrite(LedPin3, LOW);
- digitalWrite(LedPin4, LOW);
- digitalWrite(LedPin5, HIGH);
- }
- void ch19() {
- digitalWrite(LedPin1, HIGH);
- digitalWrite(LedPin2, HIGH);
- digitalWrite(LedPin3, LOW);
- digitalWrite(LedPin4, LOW);
- digitalWrite(LedPin5, HIGH);
- }
- void ch20() {
- digitalWrite(LedPin1, LOW);
- digitalWrite(LedPin2, LOW);
- digitalWrite(LedPin3, HIGH);
- digitalWrite(LedPin4, LOW);
- digitalWrite(LedPin5, HIGH);
- }
- void ch21() {
- digitalWrite(LedPin1, HIGH);
- digitalWrite(LedPin2, LOW);
- digitalWrite(LedPin3, HIGH);
- digitalWrite(LedPin4, LOW);
- digitalWrite(LedPin5, HIGH);
- }
- void ch22() {
- digitalWrite(LedPin1, LOW);
- digitalWrite(LedPin2, HIGH);
- digitalWrite(LedPin3, HIGH);
- digitalWrite(LedPin4, LOW);
- digitalWrite(LedPin5, HIGH);
- }
- void ch23() {
- digitalWrite(LedPin1, HIGH);
- digitalWrite(LedPin2, HIGH);
- digitalWrite(LedPin3, HIGH);
- digitalWrite(LedPin4, LOW);
- digitalWrite(LedPin5, HIGH);
- }
- void ch24() {
- digitalWrite(LedPin1, LOW);
- digitalWrite(LedPin2, LOW);
- digitalWrite(LedPin3, LOW);
- digitalWrite(LedPin4, HIGH);
- digitalWrite(LedPin5, HIGH);
- }
- void ch25() {
- digitalWrite(LedPin1, HIGH);
- digitalWrite(LedPin2, LOW);
- digitalWrite(LedPin3, LOW);
- digitalWrite(LedPin4, HIGH);
- digitalWrite(LedPin5, HIGH);
- }
- void ch26() {
- digitalWrite(LedPin1, LOW);
- digitalWrite(LedPin2, HIGH);
- digitalWrite(LedPin3, LOW);
- digitalWrite(LedPin4, HIGH);
- digitalWrite(LedPin5, HIGH);
- }
- void ch27() {
- digitalWrite(LedPin1, HIGH);
- digitalWrite(LedPin2, HIGH);
- digitalWrite(LedPin3, LOW);
- digitalWrite(LedPin4, HIGH);
- digitalWrite(LedPin5, HIGH);
- }
- void ch28() {
- digitalWrite(LedPin1, LOW);
- digitalWrite(LedPin2, LOW);
- digitalWrite(LedPin3, HIGH);
- digitalWrite(LedPin4, HIGH);
- digitalWrite(LedPin5, HIGH);
- }
- void ch29() {
- digitalWrite(LedPin1, HIGH);
- digitalWrite(LedPin2, LOW);
- digitalWrite(LedPin3, HIGH);
- digitalWrite(LedPin4, HIGH);
- digitalWrite(LedPin5, HIGH);
- }
- void ch30() {
- digitalWrite(LedPin1, LOW);
- digitalWrite(LedPin2, HIGH);
- digitalWrite(LedPin3, HIGH);
- digitalWrite(LedPin4, HIGH);
- digitalWrite(LedPin5, HIGH);
- }
- void ch31() {
- digitalWrite(LedPin1, HIGH);
- digitalWrite(LedPin2, HIGH);
- digitalWrite(LedPin3, HIGH);
- digitalWrite(LedPin4, HIGH);
- digitalWrite(LedPin5, HIGH);
- }
- void klir() {
- digitalWrite(LedPin1, LOW);
- digitalWrite(LedPin2, LOW);
- digitalWrite(LedPin3, LOW);
- digitalWrite(LedPin4, LOW);
- digitalWrite(LedPin5, LOW);
- }
- void resetinput() {
- S1 = 0;
- S2 = 0;
- S3 = 0;
- S4 = 0;
- S5 = 0;
- S6 = 0;
- S7 = 0;
- S8 = 0;
- S9 = 0;
- SB0 = 0;
- S0 = 0;
- SP0 = 0;
- } // END resetinput
- void resetkombinasi() {
- D1 = 0;
- D2 = 0;
- D3 = 0;
- D4 = 0;
- D5 = 0;
- D6 = 0;
- D7 = 0;
- } // END resetkombinasi
- void resetkombinasi2() {
- U1 = 0;
- V1 = 0;
- W1 = 0;
- X1 = 0;
- Y1 = 0;
- Z1 = 0;
- }
- void remotedetect() {
- if ( D1 == 1 ) {digitalWrite(LedPin6, HIGH);}
- else if ( D1 == 0 ) {digitalWrite(LedPin6, LOW);}
- } // END remote detect
- void resetsemuah() {
- resetkombinasi();
- resetkombinasi2();
- resetinput();
- }
- void loop(){
- // cek masukan angka dari DTMF
- cekinput();
- if ( SB0 || SP0 == 1 ) { resetsemuah(); }
- // cek dulu D3 kalo on jangan cek lagi
- if ( D3 == 1 ) {}
- else {cekkombinasi();}
- // cek dulu 6 digit kalo on jangan cek lagi
- if ( U1 == 1 ) {}
- else if ( V1 == 1 ) {}
- else if ( W1 == 1 ) {}
- else if ( X1 == 1 ) {}
- else if ( Y1 == 1 ) {}
- else if ( Z1 == 1 ) {}
- else {cek6digit();}
- // lanjut pilih channel
- channelselect();
- // reset variable inputan angka2
- resetinput();
- // running led logging sementaun
- remotedetect();
- delay(10);
- } // END loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement