Closed happyherp closed 7 months ago
I see there already is a branch https://github.com/n3roGit/DPVControl/tree/test-visual-studio-code
i am looking at this tutorial... https://colddsam.medium.com/exploring-the-world-of-arduino-programming-in-visual-studio-code-bbcb4af982e7
What seems to work ok-ish.
VSCode with Arduido plugin from microsoft.
then install gcc compiler. https://nuwen.net/mingw.html
select the compiler in vscode.
then install the libraries that we use from inside vscode using the arduino library manager. If some are missing they need to be put in C:\Users\
with that I can currently run verify and also upload to the board. But there are MANY compilation errors. Most probably because of the .ino files. To fix this we would need to make them all .h/.cpp
Yes, I also had these errors. I think it is due to the INO files. that is simply not intended for VSC.
i converted almost all code to cpp.
Still my configuration shows wrong errors:
I think he is missing some default librarys. I search for this problem
i got only this message with vscode branch
check this https://github.com/n3roGit/DPVControl/commit/f5c7687e6f8adc7d1396db4811dcc097611e2076
with this its building bot not 100%
ö
HA, Now its working!!!!!!!!
I can flash!
Ah you need one thing:
https://downloads.arduino.cc/arduino-cli/arduino-cli_latest_Windows_64bit.msi
And set the CLI as compiler
C:\Program Files\Arduino CLI\
After the changeover, communication with the vesc no longer works. we should take another look at this.
tried:
if (getVescUart().getVescValues()) { Serial.println("Connected to VESC."); } else { Serial.println("Failed to connect to VESC."); hasMotor = true; }
and got this;
Failed to get VESC data!: 0 Failed to get VESC data!: 0
https://github.com/microsoft/vscode-arduino
i try it like this. working on it
- The supported legacy Arduino IDE versions are
1.6.xand up to, but not including,
2.0.0`.
1.8.7
had some breaking changes, causing board package and library installation failures. These failures were corrected in 1.8.8
and later.2.X.Y
is not supported and there are no plans for support in the future (issue 1477).
`
That sums up the situation. Files are there, and vscode seems to know where. But CodeAnalysis does not find them.
tried:
if (getVescUart().getVescValues()) { Serial.println("Connected to VESC."); } else { Serial.println("Failed to connect to VESC."); hasMotor = true; }
and got this;
Failed to get VESC data!: 0 Failed to get VESC data!: 0
That is coming from somewhere else. See the other.cpp
void GetVESCValues() {
if (!hasMotor) return;
if (getVescUart().getVescValues()) {
/*
Serial.print("RPM: ");
Serial.println(UART.data.rpm);
Serial.print("inpVoltage: ");
Serial.println(UART.data.inpVoltage);
Serial.print("ampHours: ");
Serial.println(UART.data.ampHours);
Serial.print("tachometerAbs: ");
Serial.println(UART.data.tachometerAbs);
*/
updateBatteryLevel(getVescUart().data.inpVoltage);
} else {
log("Failed to get VESC data!", 00000);
}
}
That sums up the situation. Files are there, and vscode seems to know where. But CodeAnalysis does not find them.
Maybe need to disable this feature?
I will disable it. I wanted to have the static c++ code analysis. But it is still better than Arduino IDE. I will merge what we have to prod and move on.
I dont like the IDE of Arduino that much. It was nice to get started, but i think there are better tools out there.
I don't like the .ino files. It makes me create to many global variables. Also sometimes the arduino compiler seems to move declarations around that cause strange bugs.