Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Pin connected to latch of Digital Tube Module
- int latchPin = A3;
- //Pin connected to clock of Digital Tube Module
- int clockPin = A4;
- //Pin connected to data of Digital Tube Module
- int dataPin = A5;
- //Pin connected to 595_OE of Digital Tube Module
- int OE_595 = A2;
- const int K1 = 12;
- const int K2 = 10;
- const int K3 = 8;
- const int K4 = A0;
- const int INPUT1 = 2;
- const int INPUT2 = 3;
- const int INPUT3 = 4;
- const int INPUT4 = 5;
- const int INPUT5 = 6;
- const int INPUT6 = 7;
- const int INPUT7 = 9;
- const int INPUT8 = 11;
- const int RS485_RD = A1;
- void setup() {
- // put your setup code here, to run once:
- //set pins to output because they are addressed in the main loop
- // pinMode(RS485_RD, OUTPUT);
- pinMode(K1, INPUT_PULLUP);
- pinMode(K2, INPUT_PULLUP);
- pinMode(K3, INPUT_PULLUP);
- pinMode(K4, INPUT_PULLUP);
- pinMode(LED_BUILTIN, OUTPUT);
- pinMode(INPUT1, INPUT);
- pinMode(INPUT2, INPUT);
- pinMode(INPUT3, INPUT);
- pinMode(INPUT4, INPUT);
- pinMode(INPUT5, INPUT);
- pinMode(INPUT6, INPUT);
- pinMode(INPUT7, INPUT);
- pinMode(INPUT8, INPUT);
- Serial.begin(9600);
- }
- void loop() {
- // put your main code here, to run repeatedly:
- if (!digitalRead(K1)) {
- Serial.println("tombol k1 ditekan");
- }
- if (!digitalRead(K2)) {
- Serial.println("tombol k2 ditekan");
- }
- if (!digitalRead(K3)) {
- Serial.println("tombol k3 ditekan");
- }
- if (!digitalRead(K4)) {
- Serial.println("tombol k4 ditekan");
- }
- if (!digitalRead(INPUT1)) {
- Serial.println("INPUT1");
- }
- if (!digitalRead(INPUT2)) {
- Serial.println("INPUT2");
- }
- if (!digitalRead(INPUT3)) {
- Serial.println("INPUT3");
- }
- if (!digitalRead(INPUT4)) {
- Serial.println("INPUT4");
- }
- if (!digitalRead(INPUT5)) {
- Serial.println("INPUT5");
- }
- if (!digitalRead(INPUT6)) {
- Serial.println("INPUT6");
- }
- if (!digitalRead(INPUT7)) {
- Serial.println("INPUT7");
- }
- if (!digitalRead(INPUT8)) {
- Serial.println("INPUT8");
- }
- }
Advertisement