Navigation

    M5Stack Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. kazyam53
    K
    • Continue chat with kazyam53
    • Start new chat with kazyam53
    • Flag Profile
    • Profile
    • Following
    • Followers
    • Blocks
    • Topics
    • Posts
    • Best
    • Groups
    Save
    Saving

    kazyam53

    @kazyam53

    0
    Reputation
    2
    Posts
    512
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    kazyam53 Follow

    Posts made by kazyam53

    • RE: M5stack BASIC v2.6 GPIO16 input problem

      @felmue
      Then I need to change design... thank you so much for answer.

      posted in Bases
      K
      kazyam53
    • M5stack BASIC v2.6 GPIO16 input problem

      I want to use GPIO16 on M5stack basic v2.6 as digital input but it doesn't work.
      I have tried on the code below but it always return 1.
      ・It's work well on M5 stack gray (default 0, when input 3.3V it return 1).
      ・In case I use GPIO17,25,26, it can also work well.
      ・I have 2 of basic v2.6 but both of them have same issue.

      This is the code I have tested.

      #include "Wire.h"
      #include <M5Stack.h>
      
      #define DIN 16
      void setup() {
        //start serial connection
        M5.begin();
        M5.Power.begin();
        Wire.begin();
        Serial.begin(9600);
        pinMode(DIN, INPUT_PULLDOWN);
      }
      
      void loop() {
        int sensorVal = digitalRead(DIN);
        Serial.println(sensorVal);
      }
      

      Do you have any solution or find issue on my code?
      Thank you in advance for your help.

      posted in Bases
      K
      kazyam53