-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- add **resetCumulativePosition(int32_t position)** - add parameter position to **resetPosition(int32_t position)** - add example - update readme.md
- Loading branch information
1 parent
2fdb294
commit 8b62620
Showing
9 changed files
with
117 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
platforms: | ||
rpipico: | ||
board: rp2040:rp2040:rpipico | ||
package: rp2040:rp2040 | ||
gcc: | ||
features: | ||
defines: | ||
- ARDUINO_ARCH_RP2040 | ||
warnings: | ||
flags: | ||
|
||
packages: | ||
rp2040:rp2040: | ||
url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json | ||
|
||
compile: | ||
# Choosing to run compilation tests on 2 different Arduino platforms | ||
platforms: | ||
# - uno | ||
# - due | ||
# - zero | ||
# - leonardo | ||
# - m4 | ||
- esp32 | ||
# - esp8266 | ||
# - mega2560 | ||
# - rpipico | ||
|
42 changes: 42 additions & 0 deletions
42
examples/AS5600_resetCumulativeCounter/AS5600_resetCumulativeCounter.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// | ||
// FILE: AS5600_resetCumulativeCounter.ino | ||
// AUTHOR: Daniel-Frenkel, (slightly by Rob Tillaart) | ||
// PURPOSE: demo - see issue #30 | ||
|
||
|
||
#include "AS5600.h" | ||
#include "Wire.h" | ||
|
||
AS5600L as5600; // use default Wire | ||
|
||
|
||
void setup() | ||
{ | ||
Serial.begin(115200); | ||
as5600.begin(14, 15); // ESP32 | ||
as5600.setAddress(0x40); // AS5600L has address | ||
|
||
as5600.setDirection(AS5600_CLOCK_WISE); // default, just be explicit. | ||
delay(1000); | ||
as5600.resetCumulativePosition(777); | ||
} | ||
|
||
|
||
void loop() | ||
{ | ||
static uint32_t lastTime = 0; | ||
|
||
// set initial position | ||
as5600.getCumulativePosition(); | ||
|
||
// update every 100 ms | ||
if (millis() - lastTime >= 100) | ||
{ | ||
lastTime = millis(); | ||
Serial.println(as5600.getCumulativePosition()); | ||
} | ||
} | ||
|
||
|
||
// -- END OF FILE -- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters