Modify I2C Pins on Raspberry Pi Pico in Arduino IDE

Поделиться
HTML-код
  • Опубликовано: 28 авг 2022
  • Modify I2C Pins on Raspberry Pi Pico in Arduino IDE.
    A friend of the channel asks "How can I change the SCL and SDA pins, the I2C pins on the Raspberry Pi Pico RP2040 in Arduino IDE. I find interesting issues when using Arduino IDE on one PC then another. So I have to figure out what is happening. After that, I can simply edit the pins_arduino.h file in the correct path and choose from any of the pins mapped for potential use for I2C. It turns out, at least for Windows, Arduino IDE has two differing paths to the program data.
    If Arduino IDE is installed via Windows Store the path to pins_arduino.h is:
    C:\Users\username\OneDrive\Documents\ArduinoData\packages\arduino\hardware\mbed_rp2040\version\variants\RASPBERRY_PI_PICO\
    If the Arduino IDE is installed via downloaded installer, the path to pins_arduino.h is:
    C:\Users\username\AppData\Local\Arduino15\packages\arduino\hardware\mbed_rp2040\version\variants\RASPBERRY_PI_PICO\
    As an Amazon associate I earn from qualifying purchases at no additional cost to you.
    Raspberry Pi Pico RP2040 microcontroller
    amzn.to/3Vswmn9
    New Raspberry Pi Pico in Arduino IDE - Arduino Mbed Core for RP2040 boards
    • New Raspberry Pi Pico ...
    Arduino Nano RP2040 Connect OLED Challenge
    • Arduino Nano RP2040 Co...
    ShotokuTech / Nano_RP2040_Connect_with_OLED
    github.com/ShotokuTech/Nano_R...
    5 Pieces 0.96 Inch OLED Module 12864 128x64 Driver IIC I2C
    www.amazon.com/gp/product/B09...
    Raspberry Pi Pico Pinout
    datasheets.raspberrypi.com/pi...
    Raspberry Pi Playlist
    • Raspberry Pi Playlist
  • НаукаНаука

Комментарии • 42

  • @evoprox1
    @evoprox1 Год назад +3

    Thanks for the input, much appreciated and subbed. (The first time I've used I2C professionally was back in the late 90s; the whole mess coded from scratch in Assembler, lol.) Anyway, I'm glad I2C is still around and thriving with way more hard- and software to choose from. Keep it up!

    • @ShotokuTech
      @ShotokuTech  Год назад +1

      Interesting glimpse into I2C. I never pondered how far back some of this technology goes. Thanks!

  • @JimmyFungus
    @JimmyFungus Год назад +2

    This is great you are answering these technical questions free of charge. Imagine if lawyers gave out free legal advice like that, Amber Heard would not be $10 million in debt now.

    • @ShotokuTech
      @ShotokuTech  Год назад +2

      Thanks JimmyFungus! Great analogy.

  • @dpratte
    @dpratte Год назад +3

    Very nicely done. Very helpful. Thank you Sir!

  • @VitalyBrusentsev
    @VitalyBrusentsev Год назад +1

    Appreciate you sharing this.
    Not sure about Arduino IDE, but some IDEs, like PlatformIO in VSCode, have good C++ navigation features. So you can perform the Go To Definition command on "Wire.h" in your include statement, and it will open the file at the target location (and the tab will show the full path, when highlighted).

    • @ShotokuTech
      @ShotokuTech  Год назад

      Thanks. I'm no expert. Just sharing my practical experience along the way. Best I can find is "Help/Find in Reference". This doesn't seem to do anything, not matter what I highlight concerning 'Wire' or 'wire.h'. But "Help/Reference" takes me to Arduino docs page.
      This is v1.8.x. Maybe v2.x.x does more. Basically, the include files do not load into the IDE when I open the sketch, so the IDE just refers to a hard coded path depending on how it was installed. I'll look at 2.x.x and the web IDE to see if it gets easier to find.
      Best wishes.

  • @turinturambar1338
    @turinturambar1338 4 месяца назад +1

    This saved me, thank you so much!!

  • @willwhite8531
    @willwhite8531 9 месяцев назад +1

    Hi Your video helped me out it got me up and running Thank you for that.
    However I have since found out that you can set the pins for I2C in your sketch. If your board definitions update you could loose the pin definitions you set in hardware.
    In void setup before wire.begin set the pins with Wire.setSDA(12); and Wire.setSCL(13); or Wire.setSDA(0); and Wire.setSCL(1);
    If you want to use the other I2C port use Wire1.setSDA(2); and Wire1.setSCL(3); Which ever pins are most appropiate for you build.
    void setup() {
    Wire.setSDA(12);
    Wire.setSCL(13);
    Wire.begin();
    or
    void setup() {
    Wire1.setSDA(2);
    Wire1.setSCL(3);
    Wire1.begin();

    • @ShotokuTech
      @ShotokuTech  9 месяцев назад

      Yeah I found similar while making this video: ruclips.net/video/sBYHlvLupxw/видео.html
      #include
      const int SCLpin = 42;
      const int SDApin = 41;
      void setup()
      {
      Wire.begin(SDApin, SCLpin);
      }
      Thanks!

  • @_Khayyam_987_
    @_Khayyam_987_ Год назад +1

    Hello, Sir. I'm glad you helped me solve this problem. Thank you for this interesting video.

    • @ShotokuTech
      @ShotokuTech  Год назад +1

      Great topic. I learned more than I wanted to. LOL. Thanks.

  • @arijitbanerjee9200
    @arijitbanerjee9200 Год назад +1

    It is very helpful, in fact this information is not easily available, this is also applicable for ESP32.
    Thanks a lot.
    Arijit

    • @ShotokuTech
      @ShotokuTech  Год назад

      Oh I had not even thought about ESP32! Thanks.

  • @PhilippeSEGOVIA
    @PhilippeSEGOVIA Год назад +1

    Thanks for sharing information!

  • @seanocansey5673
    @seanocansey5673 7 месяцев назад +1

    How do you do this without having to delve deep into the Arduino files? Is there a way to undefine and redefine the pins just in the code you write, so it will work in any computer?

    • @ShotokuTech
      @ShotokuTech  7 месяцев назад

      You pose an interesting question. I followed what worked in that moment. What will you do? This is our constant challenge. Best wishes.

  • @JudyPlus
    @JudyPlus Год назад +2

    This looks fun, thanks for sharing

    • @ShotokuTech
      @ShotokuTech  Год назад +1

      Yeah a lot of figuring things out in this one. Thanks Judy Plus!

  • @_nLz_
    @_nLz_ Год назад +1

    Hey, just saw the video and was wondering if u cant change these pins in program-code like redefining them. anyone any idea?

    • @ShotokuTech
      @ShotokuTech  Год назад +1

      They are defined in the include file that determines the pins. No code is going to get around that unless there is some supporting library developed that assigns pins a different way.

  • @qzorn4440
    @qzorn4440 Год назад +1

    Hello, a most interesting GPIO video. Do you have an Orange Pi-5 GPIO PWM video? I just want to make 2 servos Pan/Tilt to move using OPi.GPIO in Python3 or something that works.
    I cannot program the Channel, Pin, Duty cycle , Frequency without errors It is suppose to be a RPi.GPIO drop-in?? One PWM example would be a big help. Thank you.

    • @ShotokuTech
      @ShotokuTech  Год назад +1

      I guess I would need an Orange Pi-5 to test that on. I am not sure if I will get one. Thanks.

  • @cherikervns9265
    @cherikervns9265 Год назад +1

    Good afternoon I'm a Haitian I have a little wifi ellpsis I forget the bite helps me find it please

    • @ShotokuTech
      @ShotokuTech  Год назад +1

      Perhaps your carrier has a help line?

    • @cherikervns9265
      @cherikervns9265 Год назад +1

      I don't remember the rope please how can you help me

    • @cherikervns9265
      @cherikervns9265 Год назад +1

      Wifi calls ellipsis jetpack

    • @ShotokuTech
      @ShotokuTech  Год назад

      @@cherikervns9265 Rope may be the wrong word? I do not understand the question.

    • @ShotokuTech
      @ShotokuTech  Год назад +1

      @@cherikervns9265 WiFi calling is more of a phone feature. This is just a WiFi hotspot. It is probably best to contact your cellular carrier for more support with this device.

  • @Uncle_Aleks_70
    @Uncle_Aleks_70 Год назад +2

    Cпасибо! Помогло! долго мучился, но ваше видео спасло меня :)

    • @ShotokuTech
      @ShotokuTech  Год назад

      отличные новости друг

  • @JudyFayLondon
    @JudyFayLondon 6 месяцев назад +1

    Such an awesome post

    • @ShotokuTech
      @ShotokuTech  6 месяцев назад +1

      This was interesting to find out Judy.

  • @JudyFayLondon
    @JudyFayLondon Год назад +2

    Thanks for sharing useful information with us

    • @ShotokuTech
      @ShotokuTech  Год назад +1

      So nice of you! Thanks

    • @JudyFayLondon
      @JudyFayLondon Год назад

      @@ShotokuTech You are welcome, my kind friend