I2C on the Raspberry Pi - HOW TO use I2C with Python

  Рет қаралды 33,372

pi3g

pi3g

Күн бұрын

If you want to know how to set up the I2C interface of your Raspberry Pi then this video is for you! We explain how to connect and program I2C devices with your Raspberry Pi.
If you want to know more about the I2C interface, check out our blog
picockpit.com/...
Here are the commands shown in the video
sudo raspi-config
i2cdetect -y 1
mkdir i2c-example && cd i2c-example
sudo python3 -m venv i2c
source i2c/bin/activate
sudo ~/i2c-example/i2c/bin/pip3 install Adafruit-Blinka
pip3 list
sudo nano i2c-example.py
python3 i2c-example.py
Check out our GitHub repository
github.com/pi3...
BME68X API GitHub Repository
github.com/Bos...
You can pick up the BME688 Breakout Board and your other Raspberry Pi needs at our store
buyzero.de/en
The easiest way to use your BME688 Breakout Board is to use PiCockpit, our Web-Interface for the Raspberry Pi
picockpit.com/

Пікірлер: 9
@Eddie.Mootsen
@Eddie.Mootsen Жыл бұрын
Thanks. Using virtual environment is good idea !
@KulaGGin
@KulaGGin 5 ай бұрын
It's not a good idea. It's just a necessity: it's forced by the Python community on Linux and if we don't, we get errors while installing any packages system-wide. Had to lose an hour or two on a project with a very close dead line and make sense of these virtual environments and I was forced to use it. But I've been using Python on Windows on many projects for many years without any problems and never used virtual environments. I used it to write programs for many different things: scripts to do stuff on the system, scripts to do stuff on web, extensions for different programs: Blender, IDA. And many other things.
@vaclavnemec5996
@vaclavnemec5996 Жыл бұрын
Hi, thank you for this tutorial. For some reason, i can detect the I2C slave (made from RP2040) with i2cdetect -y 1 on Raspberry pi 3 B V1.2 before i run the script. After this, the I2C gets probably blocked and when i try to run i2cdetect -y 1 again, it gets ultra slow and nothing is detected - the journalctl kernel says "i2ctransfer timed out". Do you have any idea what is going on? Thank you very much in advance, keep going and building the cahnnel. Best wishes and Happy New year to you! =)
@KulaGGin
@KulaGGin 5 ай бұрын
Thanks for showing how to enable I2C. I'm getting *No Hardware I2C on (scl,sda)=(3, 2)* error even considering I connected everything correctly and the tutorial doesn't explain that I have to enable I2C in the config of the device.
@devdass6465
@devdass6465 5 ай бұрын
I've been constantly getting this error again and again {ERROR: Could not find a version that satisfies the requirement Ada ERROR: No matching distribution found for Ada} What should I do??
@insylem
@insylem Жыл бұрын
At 2:43 Where is the adress "0x77" displayed? It shows a 77 at 7 horizontal and 70 vertical. It shows blanks on 0 - 7 horizontal at 00 vertial, and shows "--" for everything elase
@pi3g
@pi3g Жыл бұрын
Hi @insylem - this is a good question! What you're looking at is a I2C device output table in hexadecimal. When you see a "--", that means that it's not detecting any device. The "77" is reached by adding the "7" (vertical) to the "70" (horizontal). In I2C output tables, the 0x isn't included, so that's why you don't see 0x, even though the full address here is 0x77.
@insylem
@insylem Жыл бұрын
@@pi3g thanks
@shrishailctalukar
@shrishailctalukar 11 ай бұрын
How to control I2C device with sysfs?
Beginners Guide to I2C on the Raspberry Pi Pico (BNO055 IMU Example)
16:57
Learn Embedded Systems
Рет қаралды 76 М.
怎么能插队呢!#火影忍者 #佐助 #家庭
00:12
火影忍者一家
Рет қаралды 47 МЛН
Сюрприз для Златы на день рождения
00:10
Victoria Portfolio
Рет қаралды 2,4 МЛН
Smart Sigma Kid #funny #sigma
00:14
CRAZY GREAPA
Рет қаралды 52 МЛН
I2C with Arduino and Raspberry Pi - Two Methods
30:13
DroneBot Workshop
Рет қаралды 205 М.
465 Rutgers University Confirmed: Meshtastic and LoRa are dangerous
13:27
Using the second (I2C 0) port on a Raspberry Pi
4:11
Matthias random stuff
Рет қаралды 44 М.
Raspberry Pi: Using GPIO Inputs
18:41
ExplainingComputers
Рет қаралды 583 М.
How To Control A Standard Servo With Raspberry Pi
7:40
Core Electronics
Рет қаралды 85 М.
Hosting And Accessing Websites from the Raspberry Pi Pico W
6:36
Print 'N Play
Рет қаралды 32 М.
怎么能插队呢!#火影忍者 #佐助 #家庭
00:12
火影忍者一家
Рет қаралды 47 МЛН