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