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:
Dooho Yi 2021-02-06 00:53:14 +09:00
parent cd05b27dbb
commit 47a05f3ac5
2 changed files with 36 additions and 16 deletions

View file

@ -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]
default_envs = d1_mini_pro
@ -5,27 +15,33 @@ default_envs = d1_mini_pro
framework = arduino
upload_speed = 921600
upload_port =
/dev/ttyUSB0
/dev/tty.SLAB_USBtoUART
/dev/ttyUSB0
/dev/tty.SLAB_USBtoUART
lib_deps =
SPI
Wire
64 ; ArduinoJson
1269 ; Painless Mesh
265 ; AccelStepper
SPI
Wire
64
1269
265
[env:nodemcuv2]
platform = espressif8266
board = nodemcuv2
lib_deps =
${env.lib_deps}
ESP8266WiFi
${env.lib_deps}
ESP8266WiFi
[env:d1_mini_pro]
platform = espressif8266
board = d1_mini_pro
lib_deps =
${env.lib_deps}
ESP8266WiFi
${env.lib_deps}
ESP8266WiFi
upload_speed = 460800
; 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600
[env:nanoatmega328_TEST]
platform = atmelavr
board = nanoatmega328
lib_deps =
265
upload_speed = 57600

View file

@ -199,6 +199,10 @@ void stepping() {
float velocity = steps / dur * 1000; // unit conv.: (steps/msec) --> (steps/sec)
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) {
Serial.println("oh.. it might be TOO FAST for me..");
} else {
@ -411,10 +415,10 @@ void setup() {
randomSeed(analogRead(0));
//stepper
pinMode(D5, OUTPUT);
pinMode(D6, OUTPUT);
pinMode(D7, OUTPUT);
pinMode(D8, OUTPUT);
// pinMode(D1, OUTPUT);
// pinMode(D2, OUTPUT);
// pinMode(D3, OUTPUT);
// pinMode(D4, OUTPUT);
/// "
/// 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.