Bagaimana Cara Mengetahui Alamat Pada LCD i2C?

Jika dilihat bentuk i2C memang terlihat sama. Padahal sebenarnya mereka memiliki alamat yang berbeda-beda, nah biasanya masalah datang dikarenakan kamu salah memasukan alamat i2C kamu pada sketch pemrograman.

Untuk itu cara mudahnya adalah dengan Memindai LCD i2C, dan mengetahui berapa alamat i2C kamu yang sebenarnya. Ok, berikut cara mudahnya…

Siapkan terlebih dahulu:

  1. Arduino BELI
  2. LCD 16×2 dan I2c BELI
  3. Kabel jumper Male-Female BELI
Kemudian silahkan rangkai seperti gambar dibawah ini:
CATATAN:
  1. Hubungkan pin VCC pada LCD i2C ke pin 5V Arduino
  2. Hubungkan pin GND pada LCD i2C ke pin GND Arduino
  3. Hubungkan pin SCL pada LCD i2C ke pin SCL (atau bisa pake pin A5) Arduino
  4. Hubungkan pin SDA pada LCD i2C ke pin SDA (atau bisa pake pin A4) Arduino

Lalu ketik ulang atau salin program dibawah ini:

#include <Wire.h>;
 
void setup(){
  Wire.begin();
  Serial.begin(9600);
  while (!Serial);
  Serial.println("\nI2C Scanner");
}
 
void loop(){
  byte error, address;
  int nDevices;
  Serial.println("Scanning...");
   
  nDevices = 0;
  for(address = 1; address < 127; address++ ){
    Wire.beginTransmission(address);
    error = Wire.endTransmission();
     
    if (error == 0){
      Serial.print("ditemukan Perangkat i2C pada alamat 0x");
      if (address<16)
      Serial.print("0");
      Serial.print(address,HEX);
      Serial.println(" !");
       
      nDevices++;
    }
    else if (error==4){
      Serial.print("tidak ditemukan alamat 0x");
      if (address<16)
      Serial.print("0");
      Serial.println(address,HEX);
    }
  }
  if (nDevices == 0)
    Serial.println("Tidak Ditemukan Alamat i2c\n");
    else
    Serial.println("selesai\n");
     
    delay(5000);
}
 

Jika sudah Done Uploading, kamu tinggal buka Serial Monitor, set Baud Rate ke 9600 maka akan muncul penampakan seperti dibawah ini:

Klik Untuk Memperjelas Gambar!
Nah alamatnya adalah 0x3F, punya setiap orang tentu saja akan berbeda-beda bukan. Baik, Selamat mencoba, dan harus berhasil. 😉

 

6 thoughts on “Bagaimana Cara Mengetahui Alamat Pada LCD i2C?

  • mas kalo alamatnya 0x3f yang 2,1,0,4,5,6,7,3, POSITIVE nya beda apa sama? kok saya ga muncul ya cuma kalo di tekan tombol restart di arduino cuma ngedip gitu

  • Cool website!

    My name’s Eric, and I just found your site – kelasrobot.com – while surfing the net. You showed up at the top of the search results, so I checked you out. Looks like what you’re doing is pretty cool.

    But if you don’t mind me asking – after someone like me stumbles across kelasrobot.com, what usually happens?

    Is your site generating leads for your business?

    I’m guessing some, but I also bet you’d like more… studies show that 7 out 10 who land on a site wind up leaving without a trace.

    Not good.

    Here’s a thought – what if there was an easy way for every visitor to “raise their hand” to get a phone call from you INSTANTLY… the second they hit your site and said, “call me now.”

    You can –

    Talk With Web Visitor is a software widget that’s works on your site, ready to capture any visitor’s Name, Email address and Phone Number. It lets you know IMMEDIATELY – so that you can talk to that lead while they’re literally looking over your site.

    CLICK HERE http://www.talkwithwebvisitors.com to try out a Live Demo with Talk With Web Visitor now to see exactly how it works.

    Time is money when it comes to connecting with leads – the difference between contacting someone within 5 minutes versus 30 minutes later can be huge – like 100 times better!

    That’s why we built out our new SMS Text With Lead feature… because once you’ve captured the visitor’s phone number, you can automatically start a text message (SMS) conversation.

    Think about the possibilities – even if you don’t close a deal then and there, you can follow up with text messages for new offers, content links, even just “how you doing?” notes to build a relationship.

    Wouldn’t that be cool?

    CLICK HERE http://www.talkwithwebvisitors.com to discover what Talk With Web Visitor can do for your business.

    You could be converting up to 100X more leads today!
    Eric

    PS: Talk With Web Visitor offers a FREE 14 days trial – and it even includes International Long Distance Calling.
    You have customers waiting to talk with you right now… don’t keep them waiting.
    CLICK HERE http://www.talkwithwebvisitors.com to try Talk With Web Visitor now.

    If you’d like to unsubscribe click here http://talkwithwebvisitors.com/unsubscribe.aspx?d=kelasrobot.com

  • New Multifunction Waterproof Backpack

    The best ever SUPER Backpack: Drop-proof/Scratch-resistant/USB Charging/Large capacity storage

    50% OFF for the next 24 Hours ONLY + FREE Worldwide Shipping for a LIMITED time

    Buy now: https://thebackpack.co

    Cheers,

    Ernest

Leave a Reply

Your email address will not be published. Required fields are marked *

You might also like