🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Driving dozens of sensors and relays on Core2 plus a temperature sensor

    Scheduled Pinned Locked Moved Core 2
    2 Posts 1 Posters 2.8k Views 1 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
      fly4fun
      last edited by

      I am creating an exciting application where I need to read many sensors and also drive many relays. Also I need a Temperature sensor. and all on Core2.
      Now I succeeded to run PAHUB together with ExtIO2 so I can read many sensors and drive many relays...which is great!
      However, when I want to include a DS18B20 temperature sensor, I need the OneWire library. But when I add this library it throws errors below.
      What do I need to do to make it work?

      ============================
      #include <M5Core2.h>
      #include "ClosedCube_TCA9548A.h"

      #include "UNIT_4RELAY.h"
      UNIT_4RELAY relay;

      #include "M5_EXTIO2.h"
      M5_EXTIO2 extio;
      #include <OneWire.h>

      ========================================================================
      errors after compiling:

      In file included from /home/pi/Arduino/PAHUB_4RELAY/PaHUB_4RELAY/PaHUB_4RELAY.ino:19:
      /home/pi/Arduino/libraries/UNIT_4RELAY/src/UNIT_4RELAY.h:6:14: error: expected ',' or '...' before numeric constant
      #define addr 0X26
      ^~~~
      /home/pi/Arduino/libraries/OneWire/OneWire.h:134:40: note: in expansion of macro 'addr'
      static uint8_t crc8(const uint8_t *addr, uint8_t len);
      ^~~~

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

        for benefit of community, I could solve myself: changed Onewire.h line 134 from addr to addr2. And it works 🙂

        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
        • First post
          Last post