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
substitutions: | |
device_name: edit-name | |
pulley_diameter_mm: "15" # 1 turn about 47 mm | |
gear_ratio: "1" # not used yet for simplicity | |
distance_mm: "500" # about 10 turns | |
acceleration: 12800 steps/s^2 | |
velocity: 12800 steps/s # 1 turn per second | |
open_current: 500ma | |
open_stall_threshold: "20" | |
close_current: 600ma |
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
#define USE_CUSTOM_BOARD // See "Custom board configuration" in Settings.h | |
#define APP_DEBUG // Comment this out to disable debug prints | |
#define MOVE_DISTANCE preferences.getFloat("move_distance", 0) | |
#define MOVE_PERCENT preferences.getFloat("move_percent", 389911.13) | |
#define BLYNK_PRINT Serial | |
#include "driver/ledc.h" | |
#include "BlynkProvisioning.h" | |
#include <PubSubClient.h> | |
#include <SPI.h> |
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
/* The MorningRod uses an ESP32 and TMC5130 motor driver | |
The datasheet for the TMC can be found here: | |
https://www.trinamic.com/fileadmin/assets/Products/ICs_Documents/TMC5130_datasheet_Rev1.15.pdf | |
The TMC works by having the ESP manipulate bits in the motor driver. | |
The TMC is not an ordinary driver, it is a ver smart Motion Controller. | |
It can function completely on its own. All the ESP does is set bits to change the properties of the ESP. | |
It is very simple to do, here is how: |
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
const http = require('http'); | |
exports.handler = async (event, context, callback) => { | |
console.log(event.request.intent) | |
if (event.request.intent.slots.OnOff.value == "on") { | |
var responseJson = { | |
version: "1.0", | |
response: { | |
outputSpeech: |
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
{ | |
"interactionModel": { | |
"languageModel": { | |
"invocationName": "morning rod", | |
"intents": [ | |
{ | |
"name": "AMAZON.FallbackIntent", | |
"samples": [] | |
}, | |
{ |
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
/* Comment this out to disable prints and save space */ | |
#define BLYNK_PRINT Serial | |
#include <WiFi.h> | |
#include <WiFiClient.h> | |
#include <BlynkSimpleEsp32.h> | |
int LED = 5; | |
// You should get Auth Token in the Blynk App. |