MakerWorld
Robotics
Zum Modell
AS5600 encoder stepper nema 17
149
Downloads
26
Likes
85
Makes
AS5600 encoder stepper nema 17, https://www.amazon.it/dp/B0CLNYGD4Z?ref=ppx_yo2ov_dt_b_fed_asin_title Codice Arduino per test: // AS5600 - SOLO ANALOGICO (OUT -> A0, DIR -> GND)const int PIN_OUT = A0;const int PIN_BTN_ZERO = 2; // opzionale: pulsante verso GND per zeroconst float ALPHA = 0.2f; // filtro EMA per stabilizzarefloat ema = 0.0f;float zeroDeg = 0.0f;int minRaw = 1023, maxRaw = 0;float wrap360(float d){ while(d<0)d+=360.0f; while(d>=360)d-=360.0f; return d; }void setup() { Serial.begin(115200); pinMode(PIN_OUT, INPUT); pinMode(PIN_BTN_ZERO, INPUT_PULLUP); int r = analogRead(PIN_OUT); ema = r; minRaw = r; maxRaw = r; Serial.println(F("== AS5600 Solo Analogico ==")); Serial.println(F("Comandi: 'z' = imposta zero | 'c' = reset calibrazione.")); Serial.println(F("Fai un giro completo dopo l'avvio per calibrare min/max."));}void loop() { // comandi seriali if (Serial.available()) { char c = Serial.read(); if (c=='z') { zeroDeg =
Andrea veröffentlicht auch auf
74 zusätzliche Modelle auf 3 weiteren Plattformen
Hast du dieses Modell gedruckt? Einloggen und dein Make teilen!
Melde dich an, um einen Kommentar zu hinterlassen
AnmeldenNoch keine Kommentare – sei der Erste!