Open ApanLoon opened 6 years ago
Thanks for this, but I don't have time to test it right now, we'd also need to make the same edits to slave02 which uses different data set names and different physical pin numbers. I've also made further changes to the code because I'm working on the next episode right now.
Ideally I'd like to get the bulk of the work done and get the robot functional before accepting contributions - there will be plenty of clean up to do then ;-)
Right. I will keep making some changes to my forked repo. If you want to and have time, you can always check my commits, incorporate them manually, ask me for merge requests or ignore them completely. ;-)
The latest makes it easier to edit for Slave02 - using #defines at the top for all the pin numbers.
I made a big change that removed a lot of the copy/paste code. A separate function for finding the end stop of one actuator. This is then called from the various states. However, some things were done differently for the undercarriage actuators and some of those differences are now gone. I am not 100% certain that I understand exactly what is going on there, and I fear that I need the full robot to actually understand it completely. Even if my latest commit isn't altogether correct, maybe the idea can be adopted to the original code.
This looks huge but only the top few lines of "loop" are actually changed - the rest is just indentation.
P.S. I can not test this code as I don't have the hardware, but it compiles and should be correct. Make sure you test before merging - if you even want to merge.