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

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 พ.ย. 2024

ความคิดเห็น • 9

  • @Eddie.Mootsen
    @Eddie.Mootsen ปีที่แล้ว +2

    Thanks. Using virtual environment is good idea !

    • @KulaGGin
      @KulaGGin 6 หลายเดือนก่อน

      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.

  • @KulaGGin
    @KulaGGin 6 หลายเดือนก่อน

    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.

  • @vaclavnemec5996
    @vaclavnemec5996 ปีที่แล้ว +1

    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! =)

  • @insylem
    @insylem ปีที่แล้ว +1

    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  ปีที่แล้ว +2

      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

  • @devdass6465
    @devdass6465 6 หลายเดือนก่อน

    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??

  • @shrishailctalukar
    @shrishailctalukar ปีที่แล้ว

    How to control I2C device with sysfs?