Laporan Akhir M3 P3K1




1. Prosedur [Kembali]

1. Rangkai semua komponen sesuai kondisi yang dipilih
2. Buat program di aplikasi arduino IDE
3. Setelah selesai masukkan program ke arduino (Verify and Upload)
4. Jalankan program pada simulasi dan cobakan sesuai dengan modul dan kondisi
5. Selesai
 
2. Hardware dan Diagram Blok [Kembali]
2.1 Hardware


2.1.1 Alat
1. BreadBoard

2.1.2 Bahan
1. Arduino
2. LCD
3. Keypad
4. Jumper

B. Diagram Blok




 

3. Rangkaian Simulasi dan Prinsip Kerja [Kembali]
3.1 Gambar Rangkaian


3.2 Prinsip Kerja
  Pada rangkaian tersebut, dipswitch berperan sebagai input yang dihubungkan ke kaki analog arduino. outputnya yaitu 7-segment common cathode. 
Rangkaian dapat disimulasikan setelah kodingan arduino dari arduino IDE dimasukkan ke arduino pada proteus. Dimana kodingan arduino diatur untuk key 1 - 9 menampilkan karaktaer nomor 1 - 9 secara berurut di kolom pertama LCD
 
4. FlowChart [Kembali]
4.1 Listing Program 

//Master Arduino #include #include const byte ROWS = 4; const byte COLS = 3; char keys[ROWS][COLS] = { {'1', '2', '3'}, {'4', '5', '6'}, {'7', '8', '9'}, {'*', '0', '#'}, }; char rowPins[ROWS] = {9, 8, 7, 6}; char colPins[COLS] = {5, 4, 3}; Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS); void setup() { Wire.begin(); // join i2c bus (address optional for master) } //byte x = 0; void loop(){ char key = keypad.getKey(); if (key) { Wire.beginTransmission(4); // transmit to device #4 Wire.write(key); Wire.endTransmission(); // stop transmitting } }
//Slave Arduino #include #include LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // Sesuaikan pin sesuai dengan koneksi LCD void setup() { lcd.begin(16, 2); Wire.begin(4); // join i2c bus with address #4 Wire.onReceive(receiveEvent); // register event Serial.begin(9600); // start serial for output }
void loop() { delay(100); } // function that executes whenever data is received from master // this function is registered as an event, see setup() void receiveEvent(int howMany) { char c = Wire.read(); // receive byte as a character Serial.println(c); // print the character lcd.clear(); lcd.setCursor(0, 0); lcd.print(c); delay(100); }

4.2 Flowchart
MASTER

SLAVE






5. Video Demo [Kembali]




6. Kondisi [Kembali]
Percobaan 3 sesuai dengan modul 3

7. Link Download [Kembali]
Download HMTL klik di sini
Download Video Demo Klik di sini
Download Datasheet ARDUINO UNO klik di sini
Download Datasheet LCD klik di sini
Datasheet keypad klik di sini

No comments:

Post a Comment