{"id":1207,"date":"2021-11-23T19:23:31","date_gmt":"2021-11-23T19:23:31","guid":{"rendered":"https:\/\/picockpit.com\/raspberry-pi\/?p=1207"},"modified":"2023-09-19T14:37:58","modified_gmt":"2023-09-19T14:37:58","slug":"circuitpython-adafruit-feather-rp2040-and-i2c","status":"publish","type":"post","link":"https:\/\/picockpit.com\/raspberry-pi\/es\/circuitpython-adafruit-feather-rp2040-y-i2c\/","title":{"rendered":"CircuitPython, Adafruit Feather RP2040 e I2C"},"content":{"rendered":"\n<p>As you probably guessed by the title, this article discusses CircuitPython, the Adafruit Feather RP2040, and the I2C communication protocol.<\/p>\n\n\n\n<p>The RP2040 has two I2C controllers &#8211; good for example, when you want to run two I2C devices with the same I2C address. <\/p>\n\n\n\n<p>In my test setup, I have an Adafruit Feather RP2040 microcontroller board, and have attached two of our <a href=\"https:\/\/pi3g.com\/products\/bme688-breakout-board\/\">BME688 breakout boards<\/a> &#8211; one using the pins SCL + SDA and one using A1 (for SCL) + A0 (for SDA).<\/p>\n\n\n\n<p>I am using CircuitPython in version 7.0.0, <a href=\"https:\/\/circuitpython.org\/board\/adafruit_feather_rp2040\/\">which you can download from here<\/a>.<\/p>\n\n\n\n<p>Furthermore, I&#8217;ve installed all of Adafruit&#8217;s libraries to the <strong>lib <\/strong>folder on the Feather RP2040. (The Feather RP2040 has enough space on it&#8217;s Flash to enable this)<\/p>\n\n\n\n<p>You can download these libraries in the <a href=\"https:\/\/github.com\/adafruit\/Adafruit_CircuitPython_Bundle\/releases\">Adafruit CircuitPython Bundle here<\/a>. (I downloaded <a href=\"https:\/\/github.com\/adafruit\/Adafruit_CircuitPython_Bundle\/releases\/download\/20211123\/adafruit-circuitpython-bundle-7.x-mpy-20211123.zip\">adafruit-circuitpython-bundle-7.x-mpy-20211123.zip<\/a>)<\/p>\n\n\n\n<p> <\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2021\/11\/image-17.png\" alt=\"\" class=\"wp-image-1208\" style=\"width:602px;height:596px\" width=\"602\" height=\"596\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2021\/11\/image-17.png 845w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2021\/11\/image-17-300x297.png 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2021\/11\/image-17-150x150.png 150w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2021\/11\/image-17-768x761.png 768w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><\/figure>\n<\/div>\n\n\n<p><strong>Note<\/strong>: to install these libraries simply copy them to the lib folder on the CIRCUITPY &#8220;drive&#8221; which is mounted on your computer. You will of course have to copy only the libraries, not the examples and other stuff.<\/p>\n\n\n\n<p>The big advantage in using Adafruit&#8217;s stuff is that you get a ton of examples which cover many popular chips, and you can very easily start with it. There are things like driving a microSD card using SPI, reading an RTC, and reading from the BME680 sensor. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Testing I2C in CircuitPython<\/h2>\n\n\n\n<p>I&#8217;ve got the following setup, as I want to drive two devices independently of each other (which happen to have the same addresses in this case):<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2021\/11\/image-18.png\" alt=\"\" class=\"wp-image-1209\" style=\"width:518px;height:587px\" width=\"518\" height=\"587\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2021\/11\/image-18.png 638w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2021\/11\/image-18-265x300.png 265w\" sizes=\"auto, (max-width: 518px) 100vw, 518px\" \/><figcaption class=\"wp-element-caption\">Feather RP2040 and two <a href=\"https:\/\/pi3g.com\/products\/bme688-breakout-board\/\">BME688 breakout boards<\/a><\/figcaption><\/figure>\n<\/div>\n\n\n<p>Note that our BME688 breakout boards already include Pullups for SDA and SCL. (You need pullups on SDA and SCL).<\/p>\n\n\n\n<p>Note 2: Our BME688 breakout board has the option to change the address, so this scenario is meant for demonstration purposes. <\/p>\n\n\n\n<p>In order to drive through both pin sets sequentially (to discover the devices), I&#8217;m using the following code:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"print(&quot;Scanning SCL \/ SDA&quot;)\ni2c = busio.I2C(board.SCL, board.SDA)\n# a scan\ni2c.try_lock()\nprint(i2c.scan())\ni2c.unlock()\ni2c.deinit()\n\nprint(&quot;Scanning A0 \/ A1&quot;)\nsi2c = busio.I2C(board.A1, board.A0)\n# a scan\nsi2c.try_lock()\nprint(si2c.scan())\nsi2c.unlock()\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #88C0D0\">print<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">Scanning SCL \/ SDA<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">i2c<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">busio<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">I2C<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">board<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #D8DEE9\">SCL<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">board<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #D8DEE9\">SDA<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #D8DEE9\">a<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">scan<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">i2c<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">try_lock<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #88C0D0\">print<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">i2c<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">scan<\/span><span style=\"color: #D8DEE9FF\">())<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">i2c<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">unlock<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">i2c<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">deinit<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #88C0D0\">print<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">Scanning A0 \/ A1<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">si2c<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">busio<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">I2C<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">board<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #D8DEE9\">A1<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">board<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #D8DEE9\">A0<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #D8DEE9\">a<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">scan<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">si2c<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">try_lock<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #88C0D0\">print<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">si2c<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">scan<\/span><span style=\"color: #D8DEE9FF\">())<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">si2c<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">unlock<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>Note: the <strong>i2c.deinit()<\/strong> is key to this particular example working! (because SCL \/ SDA and A0 \/ A1 have both the same hardware I2C peripheral &#8211; see below).<\/p>\n\n\n\n<p>This should output the following:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"Scanning SCL \/ SDA\n[119]\nScanning A0 \/ A1\n[119]\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9\">Scanning<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">SCL<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">\/<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">SDA<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">[<\/span><span style=\"color: #B48EAD\">119<\/span><span style=\"color: #D8DEE9FF\">]<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">Scanning<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">A0<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">\/<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">A1<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">[<\/span><span style=\"color: #B48EAD\">119<\/span><span style=\"color: #D8DEE9FF\">]<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>Here, 119 is <a href=\"https:\/\/www.rapidtables.com\/convert\/number\/decimal-to-hex.html\">decimal for hex 0x77<\/a> &#8211; which is the address of our BME688 breakout board in the default state. <\/p>\n\n\n\n<p>Both boards are seen, sequentially in the individual scans. <\/p>\n\n\n\n<p>The problem is that we want to use them simultaneously.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Running two I2C buses simultaneously on the Adafruit Feather RP2040<\/h2>\n\n\n\n<p>CircuitPython supports <strong>both <\/strong>hardware controllers (SDA0\/SCL0 and SDA1\/SCL1). You do not need to set any configuration (which controller you want to use, or how to mux the pins) &#8211; this is taken care of by <strong>busio <\/strong>for you.<\/p>\n\n\n\n<p>You need to pay attention, though, which pins you use, as the pins will provide only <strong>one <\/strong>of these buses in each case, and if you happen to choose conflicting pins, you will get  <em>ValueError: I2C peripheral in use <\/em>.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2021\/11\/adafruit_products_RP2040Pinout300DPI-1000.png\" alt=\"\" class=\"wp-image-1255\" style=\"width:640px;height:494px\" width=\"640\" height=\"494\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2021\/11\/adafruit_products_RP2040Pinout300DPI-1000.png 1024w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2021\/11\/adafruit_products_RP2040Pinout300DPI-1000-300x232.png 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2021\/11\/adafruit_products_RP2040Pinout300DPI-1000-768x593.png 768w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><figcaption class=\"wp-element-caption\"><a href=\"https:\/\/learn.adafruit.com\/adafruit-feather-rp2040-pico\">Adafruit Feather RP2040 Pinout<\/a><\/figcaption><\/figure>\n<\/div>\n\n\n<p>If you want to use &#8220;conflicting&#8221; pins, fo rexample SCL \/ SDA (which have SCL1 and SDA1) and A0 \/ A1 (which also have SCL1 and SDA1), you will need to bitbang one of the ports: <\/p>\n\n\n\n<p>Here&#8217;s how to scan this pin configuration without calling deinit():<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"import board\nimport busio\nimport bitbangio\n# https:\/\/circuitpython.readthedocs.io\/en\/latest\/shared-bindings\/bitbangio\/index.html\n\nprint(&quot;Scanning SCL \/ SDA - main I2C&quot;)\ni2c = busio.I2C(board.SCL, board.SDA)\n# a scan\ni2c.try_lock()\nprint(i2c.scan())\ni2c.unlock()\n# no need to call deinit here!\n#i2c.deinit()\n\nprint(&quot;Scanning A0 \/ A1 - secondary I2C [bitbang!]&quot;)\nsi2c = bitbangio.I2C(board.A1, board.A0)\n# a scan\nsi2c.try_lock()\nprint(si2c.scan())\nsi2c.unlock()\n\n# we also do not need to call deinit here\n#i2c.deinit()\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">board<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">busio<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">bitbangio<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #8FBCBB\">https<\/span><span style=\"color: #D8DEE9FF\">:<\/span><span style=\"color: #616E88\">\/\/circuitpython.readthedocs.io\/en\/latest\/shared-bindings\/bitbangio\/index.html<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">print<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">Scanning SCL \/ SDA - main I2C<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">i2c<\/span><span style=\"color: #D8DEE9FF\"> = <\/span><span style=\"color: #8FBCBB\">busio<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">I2C<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">board<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">SCL<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">board<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">SDA<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #8FBCBB\">a<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">scan<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">i2c<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">try_lock<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">print<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">i2c<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">scan<\/span><span style=\"color: #D8DEE9FF\">())<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">i2c<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">unlock<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #8FBCBB\">no<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">need<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">to<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">call<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">deinit<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">here<\/span><span style=\"color: #D8DEE9FF\">!<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">#<\/span><span style=\"color: #8FBCBB\">i2c<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">deinit<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">print<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">Scanning A0 \/ A1 - secondary I2C [bitbang!]<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">si2c<\/span><span style=\"color: #D8DEE9FF\"> = <\/span><span style=\"color: #8FBCBB\">bitbangio<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">I2C<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">board<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">A1<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">board<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">A0<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #8FBCBB\">a<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">scan<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">si2c<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">try_lock<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">print<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">si2c<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">scan<\/span><span style=\"color: #D8DEE9FF\">())<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">si2c<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">unlock<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #8FBCBB\">we<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">also<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">do<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">not<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">need<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">to<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">call<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">deinit<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">here<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">#<\/span><span style=\"color: #8FBCBB\">i2c<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">deinit<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>We are using <strong>bitbangio <\/strong>to drive a secondary I2C. In my case the secondary I2C is used for an internal purpose (for a port expander), and quite likely can do with a lower interface speed. <\/p>\n\n\n\n<p>Note: you are not able to choose the I2C peripheral which is routed to the pins in software &#8211; if you need a different peripheral, you need to use different pins. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Troubleshooting I2C errors<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">ValueError: I2C peripheral in use<\/h3>\n\n\n\n<p>If you are using busio.I2C for both ports: Check if you are already using the same hardware I2C peripheral &#8211; and whether you need to reassign your pins.<\/p>\n\n\n\n<p>For example, both SCL and SDA , and A0 and A1 share the same hardware I2C peripheral (SCL1 \/ SDA1 &#8211; see the Adafruit Feather RP2040 pinout picture in this article). <\/p>\n\n\n\n<p>In case you do want to use the same pin setup, you can use bitbangio to &#8220;create&#8221; an additional software-controlled I2C port. The downside of this is lower speed for this software-I2C port, and a higher CPU load. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">RuntimeError: No pull up found on SDA or SCL; check your wiring<\/h3>\n\n\n\n<p>If you get the following error<\/p>\n\n\n\n<p><em>RuntimeError: No pull up found on SDA or SCL; check your wiring <\/em><\/p>\n\n\n\n<p>then you should put pullup resistors between 3V3 on the board (the 3.3V pin) and respectively your SDA and SCL pins. These are required for normal I2C operation (the devices pull down the I2C pins to communicate, the default \/ idle state on the bus is high) &#8211; and are not included on the Adafruit Feather RP2040. They are included on many Adafruit peripherals, and on peripherals of other companies (like, again our own <a href=\"https:\/\/pi3g.com\/products\/bme688-breakout-board\/\">BME688 breakout board<\/a>). <\/p>\n\n\n\n<p>If you don&#8217;t know what a pullup is: this is essentially a resistor between the pin in question (e.g. SDA) and the 3.3 V supply pin. It does not need to be terribly precise. You should start out with 10 kOhm resistors, if that doesn&#8217;t work, possibly try a 1 kOhm resistor for a &#8220;stiffer&#8221; pullup. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">TimeoutError: Clock stretch too long<\/h3>\n\n\n\n<p>Check if the chip you want to talk to is powered properly. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Misc. notes<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The Adafruit Feather RP2040 has a NeoPixel LED on it. Neo<a href=\"https:\/\/learn.adafruit.com\/adafruit-neopixel-uberguide\/arduino-library-use\">Pixels use a proprietary protocol<\/a>, they do not use I2C.<\/li>\n\n\n\n<li>The <a href=\"https:\/\/github.com\/adafruit\/CircuitPython_Community_Bundle\/releases\">Adafruit CircuitPython Community Bundle<\/a> has a couple additional drivers<\/li>\n\n\n\n<li>There is a <strong><a href=\"https:\/\/github.com\/adafruit\/Adafruit_CircuitPython_Debug_I2C\/tree\/ad54aa8f944bb644cb38f74b1bb98c5d5b354663\">DebugI2C Helper<\/a><\/strong> <\/li>\n\n\n\n<li>The <a href=\"https:\/\/circuitpython.readthedocs.io\/en\/latest\/shared-bindings\/support_matrix.html\">support matrix <\/a>will show you which modules are supported on your board (e.g. the Adafruit Feather RP2040)<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">References \/ Resources \/ Links \/ Further reading<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/github.com\/adafruit\/Adafruit_CircuitPython_Bundle\/releases\">Adafruit CircuitPython Bundle<\/a> (libraries for CircuitPython)<\/li>\n\n\n\n<li><a href=\"https:\/\/circuitpython.readthedocs.io\/en\/latest\/shared-bindings\/busio\/\">CircuitPython Busio documentation<\/a> <\/li>\n\n\n\n<li><a href=\"https:\/\/circuitpython.readthedocs.io\/en\/latest\/shared-bindings\/board\/\">CircuitPython Board documentation<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/circuitpython.readthedocs.io\/en\/latest\/ports\/raspberrypi\/README.html\">CircuitPython on the RP2040 documentation<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/learn.adafruit.com\/circuitpython-essentials\/circuitpython-i2c\">CircuitPython I2C Essentials<\/a><\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Want to learn more about I2C? Check out <a href=\"https:\/\/picockpit.com\/raspberry-pi\/i2c-the-inter-integrated-circuit-bus\/\">our article on it here<\/a>.<\/p>\n<div class=\"shariff shariff-align-center shariff-widget-align-left shariff-buttonstretch\"><ul class=\"shariff-buttons theme-white orientation-horizontal buttonsize-medium\"><li class=\"shariff-button twitter shariff-nocustomcolor\" style=\"background-color:#595959\"><a href=\"https:\/\/twitter.com\/share?url=https%3A%2F%2Fpicockpit.com%2Fraspberry-pi%2Fes%2Fcircuitpython-adafruit-feather-rp2040-y-i2c%2F&text=CircuitPython%2C%20Adafruit%20Feather%20RP2040%2C%20and%20I2C\" title=\"Compartir en X\" aria-label=\"Compartir en X\" role=\"button\" rel=\"noopener nofollow\" class=\"shariff-link\" style=\"; background-color:#000; color:#000\" target=\"_blank\"><span class=\"shariff-icon\" style=\"fill:#000\"><svg width=\"32px\" height=\"20px\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 24 24\"><path fill=\"#000\" d=\"M14.258 10.152L23.176 0h-2.113l-7.747 8.813L7.133 0H0l9.352 13.328L0 23.973h2.113l8.176-9.309 6.531 9.309h7.133zm-2.895 3.293l-.949-1.328L2.875 1.56h3.246l6.086 8.523.945 1.328 7.91 11.078h-3.246zm0 0\"\/><\/svg><\/span><span class=\"shariff-text\" style=\"color:#000\">compartir<\/span>&nbsp;<\/a><\/li><li class=\"shariff-button facebook shariff-nocustomcolor\" style=\"background-color:#4273c8\"><a href=\"https:\/\/www.facebook.com\/sharer\/sharer.php?u=https%3A%2F%2Fpicockpit.com%2Fraspberry-pi%2Fes%2Fcircuitpython-adafruit-feather-rp2040-y-i2c%2F\" title=\"Compartir en Facebook\" aria-label=\"Compartir en Facebook\" role=\"button\" rel=\"nofollow\" class=\"shariff-link\" style=\"; background-color:#3b5998; color:#3b5998\" target=\"_blank\"><span class=\"shariff-icon\" style=\"fill:#3b5998\"><svg width=\"32px\" height=\"20px\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 18 32\"><path fill=\"#3b5998\" d=\"M17.1 0.2v4.7h-2.8q-1.5 0-2.1 0.6t-0.5 1.9v3.4h5.2l-0.7 5.3h-4.5v13.6h-5.5v-13.6h-4.5v-5.3h4.5v-3.9q0-3.3 1.9-5.2t5-1.8q2.6 0 4.1 0.2z\"\/><\/svg><\/span><span class=\"shariff-text\" style=\"color:#3b5998\">compartir<\/span>&nbsp;<\/a><\/li><li class=\"shariff-button telegram shariff-nocustomcolor\" style=\"background-color:#4084A6\"><a href=\"https:\/\/telegram.me\/share\/url?url=https%3A%2F%2Fpicockpit.com%2Fraspberry-pi%2Fes%2Fcircuitpython-adafruit-feather-rp2040-y-i2c%2F&text=CircuitPython%2C%20Adafruit%20Feather%20RP2040%2C%20and%20I2C\" title=\"Compartir en Telegram\" aria-label=\"Compartir en Telegram\" role=\"button\" rel=\"noopener nofollow\" class=\"shariff-link\" style=\"; background-color:#0088cc; color:#0088cc\" target=\"_blank\"><span class=\"shariff-icon\" style=\"fill:#0088cc\"><svg width=\"32px\" height=\"20px\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 32 32\"><path fill=\"#0088cc\" d=\"M30.8 6.5l-4.5 21.4c-.3 1.5-1.2 1.9-2.5 1.2L16.9 24l-3.3 3.2c-.4.4-.7.7-1.4.7l.5-7L25.5 9.2c.6-.5-.1-.8-.9-.3l-15.8 10L2 16.7c-1.5-.5-1.5-1.5.3-2.2L28.9 4.3c1.3-.5 2.3.3 1.9 2.2z\"\/><\/svg><\/span><span class=\"shariff-text\" style=\"color:#0088cc\">compartir<\/span>&nbsp;<\/a><\/li><li class=\"shariff-button reddit shariff-nocustomcolor\" style=\"background-color:#ff5700\"><a href=\"https:\/\/www.reddit.com\/submit?url=https%3A%2F%2Fpicockpit.com%2Fraspberry-pi%2Fes%2Fcircuitpython-adafruit-feather-rp2040-y-i2c%2F\" title=\"Compartir en Reddit\" aria-label=\"Compartir en Reddit\" role=\"button\" rel=\"noopener nofollow\" class=\"shariff-link\" style=\"; background-color:#ff4500; color:#ff4500\" target=\"_blank\"><span class=\"shariff-icon\" style=\"fill:#ff4500\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\"><path fill=\"#ff4500\" d=\"M440.3 203.5c-15 0-28.2 6.2-37.9 15.9-35.7-24.7-83.8-40.6-137.1-42.3L293 52.3l88.2 19.8c0 21.6 17.6 39.2 39.2 39.2 22 0 39.7-18.1 39.7-39.7s-17.6-39.7-39.7-39.7c-15.4 0-28.7 9.3-35.3 22l-97.4-21.6c-4.9-1.3-9.7 2.2-11 7.1L246.3 177c-52.9 2.2-100.5 18.1-136.3 42.8-9.7-10.1-23.4-16.3-38.4-16.3-55.6 0-73.8 74.6-22.9 100.1-1.8 7.9-2.6 16.3-2.6 24.7 0 83.8 94.4 151.7 210.3 151.7 116.4 0 210.8-67.9 210.8-151.7 0-8.4-.9-17.2-3.1-25.1 49.9-25.6 31.5-99.7-23.8-99.7zM129.4 308.9c0-22 17.6-39.7 39.7-39.7 21.6 0 39.2 17.6 39.2 39.7 0 21.6-17.6 39.2-39.2 39.2-22 .1-39.7-17.6-39.7-39.2zm214.3 93.5c-36.4 36.4-139.1 36.4-175.5 0-4-3.5-4-9.7 0-13.7 3.5-3.5 9.7-3.5 13.2 0 27.8 28.5 120 29 149 0 3.5-3.5 9.7-3.5 13.2 0 4.1 4 4.1 10.2.1 13.7zm-.8-54.2c-21.6 0-39.2-17.6-39.2-39.2 0-22 17.6-39.7 39.2-39.7 22 0 39.7 17.6 39.7 39.7-.1 21.5-17.7 39.2-39.7 39.2z\"\/><\/svg><\/span><span class=\"shariff-text\" style=\"color:#ff4500\">compartir<\/span>&nbsp;<\/a><\/li><\/ul><\/div>","protected":false},"excerpt":{"rendered":"<p>Como probablemente adivinaste por el t\u00edtulo, este art\u00edculo trata sobre CircuitPython, el Adafruit Feather RP2040, y el protocolo de comunicaci\u00f3n I2C. El RP2040 tiene dos controladores I2C - bueno, por ejemplo, cuando se desea ejecutar dos dispositivos I2C con la misma direcci\u00f3n I2C. En mi configuraci\u00f3n de prueba, tengo una placa microcontroladora Adafruit Feather RP2040,...<\/p>","protected":false},"author":2,"featured_media":1209,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[196,1193],"tags":[517,1943,1942,910,477,1940,205,597,189,11,221,187,909,1941,168],"class_list":["post-1207","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-interfaces","category-python","tag-adafruit","tag-bit-banging","tag-bitbangio","tag-breakout","tag-circuitpython","tag-feather","tag-i2c","tag-microcontroller","tag-pi","tag-pico","tag-pico-w","tag-raspberry-pi","tag-rp2040","tag-scl","tag-sda"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>CircuitPython, Adafruit Feather RP2040, and I2C | PiCockpit<\/title>\n<meta name=\"description\" content=\"This article covers CircuitPython, the Adafruit Feather RP2040, and I2C.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/picockpit.com\/raspberry-pi\/es\/circuitpython-adafruit-feather-rp2040-y-i2c\/\" \/>\n<meta property=\"og:locale\" content=\"es_ES\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"CircuitPython, Adafruit Feather RP2040, and I2C | PiCockpit\" \/>\n<meta property=\"og:description\" content=\"This article covers CircuitPython, the Adafruit Feather RP2040, and I2C.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/picockpit.com\/raspberry-pi\/es\/circuitpython-adafruit-feather-rp2040-y-i2c\/\" \/>\n<meta property=\"og:site_name\" content=\"PiCockpit\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/pi3gshop\" \/>\n<meta property=\"article:published_time\" content=\"2021-11-23T19:23:31+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-09-19T14:37:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2021\/11\/image-18.png\" \/>\n\t<meta property=\"og:image:width\" content=\"638\" \/>\n\t<meta property=\"og:image:height\" content=\"723\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"raspi berry\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@pi3g\" \/>\n<meta name=\"twitter:site\" content=\"@pi3g\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"raspi berry\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tiempo de lectura\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/circuitpython-adafruit-feather-rp2040-and-i2c\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/circuitpython-adafruit-feather-rp2040-and-i2c\\\/\"},\"author\":{\"name\":\"raspi berry\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#\\\/schema\\\/person\\\/7af3a7a8c999bc722029ef9ca9d78eee\"},\"headline\":\"CircuitPython, Adafruit Feather RP2040, and I2C\",\"datePublished\":\"2021-11-23T19:23:31+00:00\",\"dateModified\":\"2023-09-19T14:37:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/circuitpython-adafruit-feather-rp2040-and-i2c\\\/\"},\"wordCount\":1005,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/circuitpython-adafruit-feather-rp2040-and-i2c\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/wp-content\\\/uploads\\\/2021\\\/11\\\/image-18.png\",\"keywords\":[\"Adafruit\",\"bit-banging\",\"bitbangio\",\"breakout\",\"circuitpython\",\"Feather\",\"I2C\",\"microcontroller\",\"Pi\",\"Pico\",\"Pico W\",\"Raspberry Pi\",\"RP2040\",\"SCL\",\"SDA\"],\"articleSection\":[\"Interfaces\",\"Python\"],\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/circuitpython-adafruit-feather-rp2040-and-i2c\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/circuitpython-adafruit-feather-rp2040-and-i2c\\\/\",\"url\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/circuitpython-adafruit-feather-rp2040-and-i2c\\\/\",\"name\":\"CircuitPython, Adafruit Feather RP2040, and I2C | PiCockpit\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/circuitpython-adafruit-feather-rp2040-and-i2c\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/circuitpython-adafruit-feather-rp2040-and-i2c\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/wp-content\\\/uploads\\\/2021\\\/11\\\/image-18.png\",\"datePublished\":\"2021-11-23T19:23:31+00:00\",\"dateModified\":\"2023-09-19T14:37:58+00:00\",\"description\":\"This article covers CircuitPython, the Adafruit Feather RP2040, and I2C.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/circuitpython-adafruit-feather-rp2040-and-i2c\\\/#breadcrumb\"},\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/circuitpython-adafruit-feather-rp2040-and-i2c\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/circuitpython-adafruit-feather-rp2040-and-i2c\\\/#primaryimage\",\"url\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/wp-content\\\/uploads\\\/2021\\\/11\\\/image-18.png\",\"contentUrl\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/wp-content\\\/uploads\\\/2021\\\/11\\\/image-18.png\",\"width\":638,\"height\":723},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/circuitpython-adafruit-feather-rp2040-and-i2c\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python\",\"item\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/category\\\/python\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"CircuitPython, Adafruit Feather RP2040, and I2C\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#website\",\"url\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/\",\"name\":\"PiCockpit\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"es\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#organization\",\"name\":\"PiCockpit.com\",\"url\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/Screenshot-from-2023-07-24-15-01-24.png\",\"contentUrl\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/Screenshot-from-2023-07-24-15-01-24.png\",\"width\":1165,\"height\":283,\"caption\":\"PiCockpit.com\"},\"image\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/pi3gshop\",\"https:\\\/\\\/x.com\\\/pi3g\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#\\\/schema\\\/person\\\/7af3a7a8c999bc722029ef9ca9d78eee\",\"name\":\"raspi berry\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c10c423ceeff34163dd54a5472d6da17d71c0e360e0cf8cdb8847006372f216b?s=96&d=blank&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c10c423ceeff34163dd54a5472d6da17d71c0e360e0cf8cdb8847006372f216b?s=96&d=blank&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c10c423ceeff34163dd54a5472d6da17d71c0e360e0cf8cdb8847006372f216b?s=96&d=blank&r=g\",\"caption\":\"raspi berry\"},\"description\":\"I'm here to help you with all your Raspberry Pi related questions &amp; love to share about new project ideas for the Raspberry Pi, and give quick tips. Of course I'll also help you with PiCockpit and how to make your Raspberry Pi even easier to use with this raspberry pi monitoring solution :-)\",\"sameAs\":[\"https:\\\/\\\/picockpit.com\"],\"url\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/es\\\/author\\\/raspi-berry\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"CircuitPython, Adafruit Feather RP2040, e I2C | PiCockpit","description":"Este art\u00edculo cubre CircuitPython, el Adafruit Feather RP2040, e I2C.","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:\/\/picockpit.com\/raspberry-pi\/es\/circuitpython-adafruit-feather-rp2040-y-i2c\/","og_locale":"es_ES","og_type":"article","og_title":"CircuitPython, Adafruit Feather RP2040, and I2C | PiCockpit","og_description":"This article covers CircuitPython, the Adafruit Feather RP2040, and I2C.","og_url":"https:\/\/picockpit.com\/raspberry-pi\/es\/circuitpython-adafruit-feather-rp2040-y-i2c\/","og_site_name":"PiCockpit","article_publisher":"https:\/\/www.facebook.com\/pi3gshop","article_published_time":"2021-11-23T19:23:31+00:00","article_modified_time":"2023-09-19T14:37:58+00:00","og_image":[{"width":638,"height":723,"url":"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2021\/11\/image-18.png","type":"image\/png"}],"author":"raspi berry","twitter_card":"summary_large_image","twitter_creator":"@pi3g","twitter_site":"@pi3g","twitter_misc":{"Escrito por":"raspi berry","Tiempo de lectura":"5 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/picockpit.com\/raspberry-pi\/circuitpython-adafruit-feather-rp2040-and-i2c\/#article","isPartOf":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/circuitpython-adafruit-feather-rp2040-and-i2c\/"},"author":{"name":"raspi berry","@id":"https:\/\/picockpit.com\/raspberry-pi\/#\/schema\/person\/7af3a7a8c999bc722029ef9ca9d78eee"},"headline":"CircuitPython, Adafruit Feather RP2040, and I2C","datePublished":"2021-11-23T19:23:31+00:00","dateModified":"2023-09-19T14:37:58+00:00","mainEntityOfPage":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/circuitpython-adafruit-feather-rp2040-and-i2c\/"},"wordCount":1005,"commentCount":3,"publisher":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/#organization"},"image":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/circuitpython-adafruit-feather-rp2040-and-i2c\/#primaryimage"},"thumbnailUrl":"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2021\/11\/image-18.png","keywords":["Adafruit","bit-banging","bitbangio","breakout","circuitpython","Feather","I2C","microcontroller","Pi","Pico","Pico W","Raspberry Pi","RP2040","SCL","SDA"],"articleSection":["Interfaces","Python"],"inLanguage":"es","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/picockpit.com\/raspberry-pi\/circuitpython-adafruit-feather-rp2040-and-i2c\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/picockpit.com\/raspberry-pi\/circuitpython-adafruit-feather-rp2040-and-i2c\/","url":"https:\/\/picockpit.com\/raspberry-pi\/circuitpython-adafruit-feather-rp2040-and-i2c\/","name":"CircuitPython, Adafruit Feather RP2040, e I2C | PiCockpit","isPartOf":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/#website"},"primaryImageOfPage":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/circuitpython-adafruit-feather-rp2040-and-i2c\/#primaryimage"},"image":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/circuitpython-adafruit-feather-rp2040-and-i2c\/#primaryimage"},"thumbnailUrl":"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2021\/11\/image-18.png","datePublished":"2021-11-23T19:23:31+00:00","dateModified":"2023-09-19T14:37:58+00:00","description":"Este art\u00edculo cubre CircuitPython, el Adafruit Feather RP2040, e I2C.","breadcrumb":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/circuitpython-adafruit-feather-rp2040-and-i2c\/#breadcrumb"},"inLanguage":"es","potentialAction":[{"@type":"ReadAction","target":["https:\/\/picockpit.com\/raspberry-pi\/circuitpython-adafruit-feather-rp2040-and-i2c\/"]}]},{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/picockpit.com\/raspberry-pi\/circuitpython-adafruit-feather-rp2040-and-i2c\/#primaryimage","url":"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2021\/11\/image-18.png","contentUrl":"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2021\/11\/image-18.png","width":638,"height":723},{"@type":"BreadcrumbList","@id":"https:\/\/picockpit.com\/raspberry-pi\/circuitpython-adafruit-feather-rp2040-and-i2c\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/picockpit.com\/raspberry-pi\/"},{"@type":"ListItem","position":2,"name":"Python","item":"https:\/\/picockpit.com\/raspberry-pi\/category\/python\/"},{"@type":"ListItem","position":3,"name":"CircuitPython, Adafruit Feather RP2040, and I2C"}]},{"@type":"WebSite","@id":"https:\/\/picockpit.com\/raspberry-pi\/#website","url":"https:\/\/picockpit.com\/raspberry-pi\/","name":"PiCockpit","description":"","publisher":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/picockpit.com\/raspberry-pi\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"es"},{"@type":"Organization","@id":"https:\/\/picockpit.com\/raspberry-pi\/#organization","name":"PiCockpit.com","url":"https:\/\/picockpit.com\/raspberry-pi\/","logo":{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/picockpit.com\/raspberry-pi\/#\/schema\/logo\/image\/","url":"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2023\/07\/Screenshot-from-2023-07-24-15-01-24.png","contentUrl":"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2023\/07\/Screenshot-from-2023-07-24-15-01-24.png","width":1165,"height":283,"caption":"PiCockpit.com"},"image":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/pi3gshop","https:\/\/x.com\/pi3g"]},{"@type":"Person","@id":"https:\/\/picockpit.com\/raspberry-pi\/#\/schema\/person\/7af3a7a8c999bc722029ef9ca9d78eee","name":"baya raspada","image":{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/secure.gravatar.com\/avatar\/c10c423ceeff34163dd54a5472d6da17d71c0e360e0cf8cdb8847006372f216b?s=96&d=blank&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c10c423ceeff34163dd54a5472d6da17d71c0e360e0cf8cdb8847006372f216b?s=96&d=blank&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c10c423ceeff34163dd54a5472d6da17d71c0e360e0cf8cdb8847006372f216b?s=96&d=blank&r=g","caption":"raspi berry"},"description":"Estoy aqu\u00ed para ayudarte con todas tus preguntas relacionadas con la Raspberry Pi y me encanta compartir sobre nuevas ideas de proyectos para la Raspberry Pi, y dar consejos r\u00e1pidos. Por supuesto, tambi\u00e9n te ayudar\u00e9 con PiCockpit y c\u00f3mo hacer que tu Raspberry Pi sea a\u00fan m\u00e1s f\u00e1cil de usar con esta soluci\u00f3n de monitoreo de la frambuesa Pi :-)","sameAs":["https:\/\/picockpit.com"],"url":"https:\/\/picockpit.com\/raspberry-pi\/es\/author\/raspi-berry\/"}]}},"_links":{"self":[{"href":"https:\/\/picockpit.com\/raspberry-pi\/es\/wp-json\/wp\/v2\/posts\/1207","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/picockpit.com\/raspberry-pi\/es\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/picockpit.com\/raspberry-pi\/es\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/picockpit.com\/raspberry-pi\/es\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/picockpit.com\/raspberry-pi\/es\/wp-json\/wp\/v2\/comments?post=1207"}],"version-history":[{"count":15,"href":"https:\/\/picockpit.com\/raspberry-pi\/es\/wp-json\/wp\/v2\/posts\/1207\/revisions"}],"predecessor-version":[{"id":5362,"href":"https:\/\/picockpit.com\/raspberry-pi\/es\/wp-json\/wp\/v2\/posts\/1207\/revisions\/5362"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/picockpit.com\/raspberry-pi\/es\/wp-json\/wp\/v2\/media\/1209"}],"wp:attachment":[{"href":"https:\/\/picockpit.com\/raspberry-pi\/es\/wp-json\/wp\/v2\/media?parent=1207"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/picockpit.com\/raspberry-pi\/es\/wp-json\/wp\/v2\/categories?post=1207"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/picockpit.com\/raspberry-pi\/es\/wp-json\/wp\/v2\/tags?post=1207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}