roundly update
+ fact 1: we cannot use D1-D4 set. (D2 for LED, D4 for TXD1) + fact 2: using D5-D8 set again. (N.B. but to get proper stepping sequence w/ accelstepper lib. u need to CROSS D6 and D7 wiring, otherwise very poor torque & uni-directional not sane movements.)
This commit is contained in:
parent
cd05b27dbb
commit
47a05f3ac5
2 changed files with 36 additions and 16 deletions
|
|
@ -1,3 +1,13 @@
|
||||||
|
; PlatformIO Project Configuration File
|
||||||
|
;
|
||||||
|
; Build options: build flags, source filter
|
||||||
|
; Upload options: custom upload port, speed and extra flags
|
||||||
|
; Library options: dependencies, extra library storages
|
||||||
|
; Advanced options: extra scripting
|
||||||
|
;
|
||||||
|
; Please visit documentation for the other options and examples
|
||||||
|
; https://docs.platformio.org/page/projectconf.html
|
||||||
|
|
||||||
[platformio]
|
[platformio]
|
||||||
default_envs = d1_mini_pro
|
default_envs = d1_mini_pro
|
||||||
|
|
||||||
|
|
@ -10,9 +20,9 @@ upload_port =
|
||||||
lib_deps =
|
lib_deps =
|
||||||
SPI
|
SPI
|
||||||
Wire
|
Wire
|
||||||
64 ; ArduinoJson
|
64
|
||||||
1269 ; Painless Mesh
|
1269
|
||||||
265 ; AccelStepper
|
265
|
||||||
|
|
||||||
[env:nodemcuv2]
|
[env:nodemcuv2]
|
||||||
platform = espressif8266
|
platform = espressif8266
|
||||||
|
|
@ -28,4 +38,10 @@ lib_deps =
|
||||||
${env.lib_deps}
|
${env.lib_deps}
|
||||||
ESP8266WiFi
|
ESP8266WiFi
|
||||||
upload_speed = 460800
|
upload_speed = 460800
|
||||||
; 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600
|
|
||||||
|
[env:nanoatmega328_TEST]
|
||||||
|
platform = atmelavr
|
||||||
|
board = nanoatmega328
|
||||||
|
lib_deps =
|
||||||
|
265
|
||||||
|
upload_speed = 57600
|
||||||
|
|
|
||||||
|
|
@ -199,6 +199,10 @@ void stepping() {
|
||||||
float velocity = steps / dur * 1000; // unit conv.: (steps/msec) --> (steps/sec)
|
float velocity = steps / dur * 1000; // unit conv.: (steps/msec) --> (steps/sec)
|
||||||
float speed = fabs(velocity);
|
float speed = fabs(velocity);
|
||||||
//
|
//
|
||||||
|
Serial.print("target_step --> "); Serial.println(target_step);
|
||||||
|
Serial.print("dur --> "); Serial.println(dur);
|
||||||
|
Serial.print("cur_step --> "); Serial.println(cur_step);
|
||||||
|
//
|
||||||
if (speed > STEPS_PER_SEC_MAX) {
|
if (speed > STEPS_PER_SEC_MAX) {
|
||||||
Serial.println("oh.. it might be TOO FAST for me..");
|
Serial.println("oh.. it might be TOO FAST for me..");
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -411,10 +415,10 @@ void setup() {
|
||||||
randomSeed(analogRead(0));
|
randomSeed(analogRead(0));
|
||||||
|
|
||||||
//stepper
|
//stepper
|
||||||
pinMode(D5, OUTPUT);
|
// pinMode(D1, OUTPUT);
|
||||||
pinMode(D6, OUTPUT);
|
// pinMode(D2, OUTPUT);
|
||||||
pinMode(D7, OUTPUT);
|
// pinMode(D3, OUTPUT);
|
||||||
pinMode(D8, OUTPUT);
|
// pinMode(D4, OUTPUT);
|
||||||
/// "
|
/// "
|
||||||
/// The fastest motor speed that can be reliably supported is about 4000 steps per
|
/// The fastest motor speed that can be reliably supported is about 4000 steps per
|
||||||
/// second at a clock frequency of 16 MHz on Arduino such as Uno etc.
|
/// second at a clock frequency of 16 MHz on Arduino such as Uno etc.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue