@zander Yes, I am also picky about format. For me colouring of keywords is also very important but that is lost when posting here. I am surprised that 2.0.0 does not have a print option. Previous option did but only black and white. I hoped 2.0.0 would have fixed it. Maybe later.
@barrie Agreed, you would think the option of copy for forum would produce a listing exactly as in the IDE. The old HTML version probably did, I just don't remember for sure. I think the emphasis for this IDE was the Arduino cloud integration. I don't see how they make a profit on it and it is a very weak API with no additions to speak of since I started playing with it a few months ago. I don't see me needing the cloud much if at all so I will be cancelling my account soon (at least it's cheap).
Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting
It is working but not yet suitable for a video. It is too jerky and I need to get the hang of changing stepper speed on the fly. When it works to spec I will try to remember to post a video.
Please do... I'm always looking for ideas for my Maker's Group projects or just seeing what people do with electronics and software. All very cool! 😎
If you have any examples using AccelStepper changing speeds please let me know.
Sorry, I've never used it and I felt the need to write my own stepper driver for my projects - https://forum.dronebotworkshop.com/user-robot-projects/inqling-junior-robot-mapping-vision-autonomy/paged/13/#post-33630
3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, Access Point Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide
I looked at both your sketches and I'd like to recommend some things.
1) move the call to changDirection to the first line inside the loop() right before you calculate distance
2) add the stepper1.run(); and stepper1.run(); commands inside changDirection after the distanceToGo testing
3) change speedFacter data type to float.
Experience is what you get when you don't get what you want.