code not cite

This commit is contained in:
Tyrel Souza 2022-11-01 01:31:49 -04:00
parent 5eadb15db3
commit 0910ed20a6

View File

@ -40,7 +40,7 @@ I found a youtube video on how to make a `SG90 run infinite in either direction
I then modified the front end code a little bit.
The new code on the back end was actually exactly the same, even though the effect was slightly different.
It would run on port 80, listen at `/` and `/angle`, but the angle here was more of direction and speed (a vector?).
It would run on port 80, listen at ``/`` and ``/angle``, but the angle here was more of direction and speed (a vector?).
The way the servo was built, 160° was "Stop", higher than that was rotate clockwise, lower was rotate counter clockwise.
I put three buttons on my page that would be "Lower" (150), "STOP" (160), and "Higher" (170).
@ -67,12 +67,12 @@ The green submit button sends the new desired temperature as a post.
Server side, I was using a library called `AccelStepper <https://www.airspayce.com/mikem/arduino/AccelStepper/>`_.
This I set some made up max speeds and steps per rotation, actual values TBD.
I added an endpoint called `/setTemperature` that takes in a temperature and sets a local temperature variable.
I added an endpoint called ``/setTemperature`` that takes in a temperature and sets a local temperature variable.
From there, I calculate the temperature less 95, to find out how many degrees I need to increase by, for now I'm considering this rotations.
I then apply a multiplier (TBD also... there's a lot of these as you can see!) and call `stepper.moveTo()` and it actually feels like it's pretty accurate.
I then apply a multiplier (TBD also... there's a lot of these as you can see!) and call ``stepper.moveTo()`` and it actually feels like it's pretty accurate.
The endpoint `/initialize` runs `stepper.moveTo` with ten rotations CCW, and then resets the "known location" back to zero (this also runs on power on for now).
The endpoint ``/initialize`` runs ``stepper.moveTo`` with ten rotations CCW, and then resets the "known location" back to zero (this also runs on power on for now).
In Action
~~~~~~~~~