Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Expansion Board i2c and Pin 10

    Scheduled Pinned Locked Moved Expansion Board
    6 Posts 3 Posters 40 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • F Offline
      Flo Gritsch
      last edited by

      Hi,

      i have a expansion board 3 and a lopy4. I want to connect a BME280 to it. I have the libary and it works. But only for a few minutes, then i get a I2C Bus error. This is the libary: https://github.com/robert-hh/BME280

      And this my code:

      
      from machine import I2C
      
      from bme280 import *
      
      from utime import sleep
      
       
      
      i2c=I2C(I2C.MASTER,pins=('P8','P9'))
      
      print(i2c.scan())
      
       
      
      bme280 = BME280(i2c=i2c)
      
      while True:
      
          print(bme280.values)
      
          sleep(10)
      

      Where is Pin 10? Because it is said to be default for i2c but i can find it. Is it the user button?How do you connect it? Do you know where the I2C Bus error comes from?

      image001.jpg

      Thanks

      F 1 Reply Last reply Reply Quote 0
      • F Offline
        Flo Gritsch @Flo Gritsch
        last edited by

        @Flo-Gritsch
        here is the i2c bus error
        Screenshot 2022-03-15 203415.jpg

        L 1 Reply Last reply Reply Quote 0
        • L Offline
          livius @Flo Gritsch
          last edited by

          @Flo-Gritsch

          Where is Pin 10?

          https://docs.pycom.io/datasheets/development/lopy4/#datasheet

          where the I2C Bus error comes fro

          look at wires, as breadboard is many times not good.

          think about people first, then computers

          1 Reply Last reply Reply Quote 0
          • F Offline
            Flo Gritsch
            last edited by

            thanks! found pin 10. But still get the error:

            Screenshot 2022-03-16 110524.jpg

            connected the sensor directly to the pycom without the breadboard. Any other ideas?

            robert-hhR 1 Reply Last reply Reply Quote 0
            • robert-hhR Offline
              robert-hh @Flo Gritsch
              last edited by

              @Flo-Gritsch I uswed that sensor with Pycom boards pretty reliable. So it may be a wiring problem. It that permanent?
              so if you put that sensor reading into a try/except clause and ignore the error, does the next read attempt work?

              P.S.: In the picture you wired the sensor already to P9 and P10. So the code and the picture to not match. P8 is used by the SD card as well. And you use a pretty old version of the LoPy4 firmware. An update may help.

              F 1 Reply Last reply Reply Quote 0
              • F Offline
                Flo Gritsch @robert-hh
                last edited by

                @robert-hh hi, thanks very much, i think updating did the thing. Works now fine.

                1 Reply Last reply Reply Quote 0

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                • 1 / 1
                • First post
                  Last post

                Pycom on Twitter

                Pycom