3dprint:strobo-tumbling-cubes
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| 3dprint:strobo-tumbling-cubes [2026/01/08 18:29] – [Code] ivo | 3dprint:strobo-tumbling-cubes [2026/01/09 07:13] (current) – [Code] ivo | ||
|---|---|---|---|
| Line 4: | Line 4: | ||
| - | A hall sensor measures the passing of four magnets to compute the angle. | + | A hall sensor |
| ===== Files ===== | ===== Files ===== | ||
| ==== 3D ==== | ==== 3D ==== | ||
| - | * {{ : | + | * {{ : |
| - | * {{ : | + | * {{ : |
| - | * {{ : | + | * {{ : |
| - | * {{ : | + | * {{ : |
| + | * {{ : | ||
| ==== Code ==== | ==== Code ==== | ||
| + | Used an ESP32 (Doit DevBoard), with Platformio | ||
| <code cpp main.cpp> | <code cpp main.cpp> | ||
| #include < | #include < | ||
| Line 56: | Line 58: | ||
| double dt = ts[tsi]-ts[(tsi+3)& | double dt = ts[tsi]-ts[(tsi+3)& | ||
| dts[tsi] = 0.8*dts[tsi]+0.2*dt; | dts[tsi] = 0.8*dts[tsi]+0.2*dt; | ||
| - | | + | unsigned int w = dts[(tsi+1)& |
| - | for (int i=0; i<4; i++) { | + | |
| - | sum += dts[tsi]; | + | |
| - | } | + | |
| - | //double realStep = dts[(tsi+1)& | + | |
| - | | + | |
| if (w< | if (w< | ||
| delayMicroseconds(w); | delayMicroseconds(w); | ||
| Line 81: | Line 78: | ||
| ==== Circuit ==== | ==== Circuit ==== | ||
| + | Circuit for driving the 12V LED strip. Not very efficient and inverted logic, so it light up until the microcontroller has booted. But you do with what you have lying around... | ||
| + | {{ : | ||
3dprint/strobo-tumbling-cubes.1767896995.txt.gz · Last modified: by ivo
