{"id":103912,"date":"2021-05-05T09:40:47","date_gmt":"2021-05-05T09:40:47","guid":{"rendered":"https:\/\/www.snapwhole.com\/index.php\/ham-radio-digital-mode-frequencies-2\/"},"modified":"2023-01-17T01:05:10","modified_gmt":"2023-01-17T01:05:10","slug":"scan-and-identify-your-arduino-i2c-port-addresses","status":"publish","type":"page","link":"https:\/\/www.snapwhole.com\/index.php\/scan-and-identify-your-arduino-i2c-port-addresses\/","title":{"rendered":"Scan and Identify your Arduino I2C Port Addresses"},"content":{"rendered":"\n<p class=\"has-text-align-center\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">Scan and Identify your Arduino I2C Port Addresses<\/mark><\/p>\n\n\n\n<center><d3><a style=\"color:Tomato;\" href=\"https:\/\/www.snapwhole.com\/index.php\/arduino-projects\/\">Return To Arduino Projects<\/a><\/d3><\/center><br><br>\n\n\n\n<p>The Arduino assigns a HEX address to all I2C devices it finds, you must have this HEX address to program your device via the I2C interface<\/p>\n\n\n\n<p>Fortunately, the hard work on this has already been done for you<\/p>\n\n\n\n<p>This Sketch will report all devices found to the IDE Serial Monitor<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ --------------------------------------\n\/\/ i2c_scanner\n\/\/\n\/\/ Version 1\n\/\/    This program (or code that looks like it)\n\/\/    can be found in many places.\n\/\/    For example on the Arduino.cc forum.\n\/\/    The original author is not know.\n\/\/ Version 2, Juni 2012, Using Arduino 1.0.1\n\/\/     Adapted to be as simple as possible by Arduino.cc user Krodal\n\/\/ Version 3, Feb 26  2013\n\/\/    V3 by louarnold\n\/\/ Version 4, March 3, 2013, Using Arduino 1.0.3\n\/\/    by Arduino.cc user Krodal.\n\/\/    Changes by louarnold removed.\n\/\/    Scanning addresses changed from 0...127 to 1...119,\n\/\/    according to the i2c scanner by Nick Gammon\n\/\/    \/\/www.gammon.com.au\/forum\/?id=10896\n\/\/ Version 5, March 28, 2013\n\/\/    As version 4, but address scans now to 127.\n\/\/    A sensor seems to use address 120.\n\/\/ Version 6, November 27, 2015.\n\/\/    Added waiting for the Leonardo serial communication.\n\/\/\n\/\/\n\/\/ This sketch tests the standard 7-bit addresses\n\/\/ Devices with higher bit address might not be seen properly.\n\/\/\n#include &lt;Wire.h&gt;\n\nvoid setup()\n{\nWire.begin();\n\nSerial.begin(9600);\nwhile (!Serial);             \/\/ Leonardo: wait for serial monitor\nSerial.println(\"\\nI2C Scanner\");\n}\n\nvoid loop()\n{\nbyte error, address;\nint nDevices;\n\nSerial.println(\"Scanning...\");\n\nnDevices = 0;\nfor(address = 1; address &lt; 127; address++ )\n{\n\/\/ The i2c_scanner uses the return value of\n\/\/ the Write.endTransmisstion to see if\n\/\/ a device did acknowledge to the address.\nWire.beginTransmission(address);\nerror = Wire.endTransmission();\n\nif (error == 0)\n{\nSerial.print(\"I2C device found at address 0x\");\nif (address&lt;16)\nSerial.print(\"0\");\nSerial.print(address,HEX);\nSerial.println(\"  !\");\n\nnDevices++;\n}\nelse if (error==4)\n{\nSerial.print(\"Unknown error at address 0x\");\nif (address&lt;16)\nSerial.print(\"0\");\nSerial.println(address,HEX);\n}\n}\nif (nDevices == 0)\nSerial.println(\"No I2C devices found\\n\");\nelse\nSerial.println(\"done\\n\");\n\ndelay(5000);           \/\/ wait 5 seconds for next scan\n\n<\/pre>\n\n\n\n<p><strong>To Connect the 1602 I2C to the UNO &#8211; Wiring Connections<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">LCD 1602 I2C Pin  UNO\/nano Header\nGND \t\t- GND\nVCC \t\t- 5V\nSDA \t\t- A4\nSCL \t\t- A5<\/pre>\n\n\n\n<p><strong>UNO to 1602 I2C Wiring<\/strong><\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-layout-1 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\"><\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\"><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.snapwhole.com\/wp-content\/uploads\/2021\/05\/ard1602wires2.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"435\" src=\"https:\/\/www.snapwhole.com\/wp-content\/uploads\/2021\/05\/ard1602wires2.jpg\" alt=\"1602 LCD with I2C Interface\" class=\"wp-image-103915\" srcset=\"https:\/\/www.snapwhole.com\/wp-content\/uploads\/2021\/05\/ard1602wires2.jpg 800w, https:\/\/www.snapwhole.com\/wp-content\/uploads\/2021\/05\/ard1602wires2-300x163.jpg 300w, https:\/\/www.snapwhole.com\/wp-content\/uploads\/2021\/05\/ard1602wires2-768x418.jpg 768w, https:\/\/www.snapwhole.com\/wp-content\/uploads\/2021\/05\/ard1602wires2-690x375.jpg 690w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><figcaption>1602 LCD with I2C Interface<\/figcaption><\/figure><\/div><\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\"><\/div>\n<\/div>\n\n\n\n<p class=\"has-text-align-center\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">Scan and Identify your Arduino I2C Port Addresses<\/mark><\/p>\n\n\n\n<center><d3><a style=\"color:Tomato;\" href=\"https:\/\/www.snapwhole.com\/index.php\/arduino-projects\/\">Return To Arduino Projects<\/a><\/d3><\/center><br><br>\n<div class=\"pvc_clear\"><\/div><p id=\"pvc_stats_103912\" class=\"pvc_stats all  \" data-element-id=\"103912\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/www.snapwhole.com\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p><div class=\"pvc_clear\"><\/div>","protected":false},"excerpt":{"rendered":"<p>Scan and Identify your Arduino I2C Port Addresses Return To Arduino Projects The Arduino assigns a HEX address to all I2C devices it finds, you must have this HEX address to program your device via the I2C interface Fortunately, the hard work on this has already been done for you This Sketch will report all [&hellip;]<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_103912\" class=\"pvc_stats all  \" data-element-id=\"103912\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/www.snapwhole.com\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"author":3,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"a3_pvc":{"activated":true,"total_views":323,"today_views":0},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Scan and Identify your Arduino I2C Port Addresses - SnapWhole.com<\/title>\n<meta name=\"description\" content=\"Scan and Identify your Arduino I2C Port Addresses\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.snapwhole.com\/index.php\/scan-and-identify-your-arduino-i2c-port-addresses\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Scan and Identify your Arduino I2C Port Addresses - SnapWhole.com\" \/>\n<meta property=\"og:description\" content=\"Scan and Identify your Arduino I2C Port Addresses\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.snapwhole.com\/index.php\/scan-and-identify-your-arduino-i2c-port-addresses\/\" \/>\n<meta property=\"og:site_name\" content=\"SnapWhole.com\" \/>\n<meta property=\"article:modified_time\" content=\"2023-01-17T01:05:10+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.snapwhole.com\/wp-content\/uploads\/2021\/05\/ard1602wires2.jpg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.snapwhole.com\/index.php\/scan-and-identify-your-arduino-i2c-port-addresses\/\",\"url\":\"https:\/\/www.snapwhole.com\/index.php\/scan-and-identify-your-arduino-i2c-port-addresses\/\",\"name\":\"Scan and Identify your Arduino I2C Port Addresses - SnapWhole.com\",\"isPartOf\":{\"@id\":\"https:\/\/www.snapwhole.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.snapwhole.com\/index.php\/scan-and-identify-your-arduino-i2c-port-addresses\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.snapwhole.com\/index.php\/scan-and-identify-your-arduino-i2c-port-addresses\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.snapwhole.com\/wp-content\/uploads\/2021\/05\/ard1602wires2.jpg\",\"datePublished\":\"2021-05-05T09:40:47+00:00\",\"dateModified\":\"2023-01-17T01:05:10+00:00\",\"description\":\"Scan and Identify your Arduino I2C Port Addresses\",\"breadcrumb\":{\"@id\":\"https:\/\/www.snapwhole.com\/index.php\/scan-and-identify-your-arduino-i2c-port-addresses\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.snapwhole.com\/index.php\/scan-and-identify-your-arduino-i2c-port-addresses\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.snapwhole.com\/index.php\/scan-and-identify-your-arduino-i2c-port-addresses\/#primaryimage\",\"url\":\"https:\/\/www.snapwhole.com\/wp-content\/uploads\/2021\/05\/ard1602wires2.jpg\",\"contentUrl\":\"https:\/\/www.snapwhole.com\/wp-content\/uploads\/2021\/05\/ard1602wires2.jpg\",\"width\":800,\"height\":435,\"caption\":\"1602 LCD with I2C Interface\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.snapwhole.com\/index.php\/scan-and-identify-your-arduino-i2c-port-addresses\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.snapwhole.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Scan and Identify your Arduino I2C Port Addresses\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.snapwhole.com\/#website\",\"url\":\"https:\/\/www.snapwhole.com\/\",\"name\":\"SnapWhole.com\",\"description\":\"Your Cool Refreshing Eclectic Destination\",\"publisher\":{\"@id\":\"https:\/\/www.snapwhole.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.snapwhole.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.snapwhole.com\/#organization\",\"name\":\"Snapwhole\",\"url\":\"https:\/\/www.snapwhole.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.snapwhole.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.snapwhole.com\/wp-content\/uploads\/2021\/04\/radioactive.jpg\",\"contentUrl\":\"https:\/\/www.snapwhole.com\/wp-content\/uploads\/2021\/04\/radioactive.jpg\",\"width\":282,\"height\":268,\"caption\":\"Snapwhole\"},\"image\":{\"@id\":\"https:\/\/www.snapwhole.com\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Scan and Identify your Arduino I2C Port Addresses - SnapWhole.com","description":"Scan and Identify your Arduino I2C Port Addresses","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.snapwhole.com\/index.php\/scan-and-identify-your-arduino-i2c-port-addresses\/","og_locale":"en_US","og_type":"article","og_title":"Scan and Identify your Arduino I2C Port Addresses - SnapWhole.com","og_description":"Scan and Identify your Arduino I2C Port Addresses","og_url":"https:\/\/www.snapwhole.com\/index.php\/scan-and-identify-your-arduino-i2c-port-addresses\/","og_site_name":"SnapWhole.com","article_modified_time":"2023-01-17T01:05:10+00:00","og_image":[{"url":"https:\/\/www.snapwhole.com\/wp-content\/uploads\/2021\/05\/ard1602wires2.jpg"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.snapwhole.com\/index.php\/scan-and-identify-your-arduino-i2c-port-addresses\/","url":"https:\/\/www.snapwhole.com\/index.php\/scan-and-identify-your-arduino-i2c-port-addresses\/","name":"Scan and Identify your Arduino I2C Port Addresses - SnapWhole.com","isPartOf":{"@id":"https:\/\/www.snapwhole.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.snapwhole.com\/index.php\/scan-and-identify-your-arduino-i2c-port-addresses\/#primaryimage"},"image":{"@id":"https:\/\/www.snapwhole.com\/index.php\/scan-and-identify-your-arduino-i2c-port-addresses\/#primaryimage"},"thumbnailUrl":"https:\/\/www.snapwhole.com\/wp-content\/uploads\/2021\/05\/ard1602wires2.jpg","datePublished":"2021-05-05T09:40:47+00:00","dateModified":"2023-01-17T01:05:10+00:00","description":"Scan and Identify your Arduino I2C Port Addresses","breadcrumb":{"@id":"https:\/\/www.snapwhole.com\/index.php\/scan-and-identify-your-arduino-i2c-port-addresses\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.snapwhole.com\/index.php\/scan-and-identify-your-arduino-i2c-port-addresses\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.snapwhole.com\/index.php\/scan-and-identify-your-arduino-i2c-port-addresses\/#primaryimage","url":"https:\/\/www.snapwhole.com\/wp-content\/uploads\/2021\/05\/ard1602wires2.jpg","contentUrl":"https:\/\/www.snapwhole.com\/wp-content\/uploads\/2021\/05\/ard1602wires2.jpg","width":800,"height":435,"caption":"1602 LCD with I2C Interface"},{"@type":"BreadcrumbList","@id":"https:\/\/www.snapwhole.com\/index.php\/scan-and-identify-your-arduino-i2c-port-addresses\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.snapwhole.com\/"},{"@type":"ListItem","position":2,"name":"Scan and Identify your Arduino I2C Port Addresses"}]},{"@type":"WebSite","@id":"https:\/\/www.snapwhole.com\/#website","url":"https:\/\/www.snapwhole.com\/","name":"SnapWhole.com","description":"Your Cool Refreshing Eclectic Destination","publisher":{"@id":"https:\/\/www.snapwhole.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.snapwhole.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.snapwhole.com\/#organization","name":"Snapwhole","url":"https:\/\/www.snapwhole.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.snapwhole.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.snapwhole.com\/wp-content\/uploads\/2021\/04\/radioactive.jpg","contentUrl":"https:\/\/www.snapwhole.com\/wp-content\/uploads\/2021\/04\/radioactive.jpg","width":282,"height":268,"caption":"Snapwhole"},"image":{"@id":"https:\/\/www.snapwhole.com\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/www.snapwhole.com\/index.php\/wp-json\/wp\/v2\/pages\/103912"}],"collection":[{"href":"https:\/\/www.snapwhole.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.snapwhole.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.snapwhole.com\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.snapwhole.com\/index.php\/wp-json\/wp\/v2\/comments?post=103912"}],"version-history":[{"count":2,"href":"https:\/\/www.snapwhole.com\/index.php\/wp-json\/wp\/v2\/pages\/103912\/revisions"}],"predecessor-version":[{"id":123503,"href":"https:\/\/www.snapwhole.com\/index.php\/wp-json\/wp\/v2\/pages\/103912\/revisions\/123503"}],"wp:attachment":[{"href":"https:\/\/www.snapwhole.com\/index.php\/wp-json\/wp\/v2\/media?parent=103912"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}