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 Наука
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!
Interesting glimpse into I2C. I never pondered how far back some of this technology goes. Thanks!
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.
Thanks JimmyFungus! Great analogy.
Very nicely done. Very helpful. Thank you Sir!
Thanks!
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).
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.
This saved me, thank you so much!!
Good news! Thanks
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();
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!
Hello, Sir. I'm glad you helped me solve this problem. Thank you for this interesting video.
Great topic. I learned more than I wanted to. LOL. Thanks.
It is very helpful, in fact this information is not easily available, this is also applicable for ESP32.
Thanks a lot.
Arijit
Oh I had not even thought about ESP32! Thanks.
Thanks for sharing information!
Sure! Thanks!
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?
You pose an interesting question. I followed what worked in that moment. What will you do? This is our constant challenge. Best wishes.
This looks fun, thanks for sharing
Yeah a lot of figuring things out in this one. Thanks Judy Plus!
Hey, just saw the video and was wondering if u cant change these pins in program-code like redefining them. anyone any idea?
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.
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.
I guess I would need an Orange Pi-5 to test that on. I am not sure if I will get one. Thanks.
Good afternoon I'm a Haitian I have a little wifi ellpsis I forget the bite helps me find it please
Perhaps your carrier has a help line?
I don't remember the rope please how can you help me
Wifi calls ellipsis jetpack
@@cherikervns9265 Rope may be the wrong word? I do not understand the question.
@@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.
Cпасибо! Помогло! долго мучился, но ваше видео спасло меня :)
отличные новости друг
Such an awesome post
This was interesting to find out Judy.
Thanks for sharing useful information with us
So nice of you! Thanks
@@ShotokuTech You are welcome, my kind friend