I am unable to locate these APIs in the documentation. Please advise.
You asked the same question a couple of days ago IIRC, if using the VSCode extension intellisense should give you what you need, I’ll also post some info when I get into the office on Monday. You can also use standard Python open, read & write commands.
edit:
reread the question. There is no API for SD card file delete in either C++ or Python. Directory read has a minimal implementation in C, not sure we ever implemented anything in Python, I’ll check tomorrow.
Thank you very much, jpearman.
The question a few days ago was regarding the api’s described for C++ V5 Pro and their implementation in Python. I did finally realize that I could click on lines in your prior posts to expand the information and was able to find references to use of standard python libraries which I have used extensively over the weekend, but found that limitations in access to the os module file handling functionality like directory read and file delete made it difficult to implement a data logging facility that handles multiple datasets.
The difficulty in removing the transflash card from a constructed robot’s brain to put into a computer makes it valuable to be able to perform file operations remotely and transfer the data through the console.
I have never used VSCode, so I am not familiar with referenced extension intellisense, though I would appreciate a link or reference to any descriptive material that will help me understand the Vexcode python interface to the filesystem and os.
thank you again for your help.
Best regards,
Steve
neither API is available in Python. File delete was deliberately omitted from vexos so students do not accidentally delete files from an SD Card, that decision was taken several years ago. There is a minimal file directory API in C, but it has limited use and was never added to the C++ sdcard class for that reason.
The SD Card implementation on V5 was intended for very simple applications, reading/writing a few parameters that the user program may need to make non-volatile and data logging things like motor values for subsequent analysis outside of the V5.
The VSCode extension provides an alternative to use VEXcode for C++ and Python development on IQ Generation 2, EXP and V5 platforms. The Python APIs provided are identical to those in VEXcode, however, there’s more flexibility in using version control and intellisense.
If your problem is that removing the card is physically difficult due to how/where the brain is mounted, something like this might be an easy solution - you could put the card somewhere easy to reach and run the extension cable back to the brain:
(Not that I’d ever discourage anyone from starting a new software project, but there’s only so much time in the day )
Hi Holbrook, thank you very much.
I am having great difficulty getting the brain to work successfully with extension cables. I am only getting reliable reading/writing of the card when it is inserted directly into the brain. I have tried two different cables and the card access fails often when an extension cable is in use. If you know of a brand that is reliable, my preference would be for a female SD to male microSD cable. However, I have had problems with both microSD to microSD and microSD to SD devices.
What development environment and toolkits would be used to enhance the capabilities of the library. The documentation appears to be very scarce, but I may not be looking in the right places.
I am trying to provide the tools for our students to characterize the operation of the robot in different operational scenarios and also determine the effectiveness of the GPS system.
Thank you for your suggestion. Any further ideas you have would be appreciated.
Best regards,
Steve