Navigation

    M5Stack Community

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

    BM22

    @BM22

    0
    Reputation
    1
    Posts
    106
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    BM22 Follow

    Posts made by BM22

    • M5 CORE INK

      Hello Everyone,

      Hope my question is in the right section, if not please let me know, thanks!

      I got a M5 CORE INK and i want connect it with an encoder (360PPR). The goal is to be able to read the value of an angle (in degree)
      Here an example of what i want to do: https://www.youtube.com/watch?v=jN9B3y1iPeA&ab_channel=JpbBricole-
      I'm a real beginer in code, i use Arduino IDE.

      My problem is about how to put the value of the angle on the Core Ink screen's

      Currently, my code work with a visualization on the serial monitorbut i don't know how to push it on the Core Ink screen's

      Here my code:
      '''

      /* Encoder Library - Basic Example

      • http://www.pjrc.com/teensy/td_libs_Encoder.html
      • This example code is in the public domain.
        */

      #include <Encoder.h>

      // Change these two numbers to the pins connected to your encoder.
      // Best Performance: both pins have interrupt capability
      // Good Performance: only the first pin has interrupt capability
      // Low Performance: neither pin has interrupt capability
      Encoder myEnc(25, 26);
      // avoid using pins with LEDs attached
      int newPosition;
      float angle;

      void setup() {
      Serial.begin(9600);
      Serial.println("Basic Encoder Test:");

      }
      long oldPosition = -999;

      void loop() {
      long newPosition = myEnc.read();
      if (newPosition != oldPosition) {
      oldPosition = newPosition;
      angle = newPosition * 0.005;
      Serial.println(angle);
      }

      }
      '''
      I want also put a reset function.

      Thanks

      BM22

      posted in PROJECTS
      B
      BM22