Notifications
Clear all

test code errors in platformIO

6 Posts
3 Users
0 Likes
687 Views
Melbul
(@melbul)
Member
Joined: 3 years ago
Posts: 43
Topic starter  

Hi Guys,

I have downloaded Visual Studio Code and set it up on my Windows machine.

I have copied Bills test codes from the DB1 GitHub pages and saved them using PIO.

they are all showing errors!

"comparison between signed and unsigned integer expressions"

"not declared" is another, the variable is declared at the bottom of the code.

Does anyone else have the same issue or am I doing something wrong here?

regards,

Mel.

 


   
Quote
vieuxgeek
(@vieuxgeek)
Member
Joined: 3 years ago
Posts: 12
 

I recently setup vscode with PlatformIO following the directions in the Dronebot Workshop Youtube video.  To test the code related to the video I did the following and all seemed to work ok.  I use Windows 10.

1. Downloaded the zip file "PlatformIO+-+DronBot+Workshop.zip" using the url dbot.ws/piocode.

2. Extracted files. I put them in user folder "Documents/PlatformIO/PlatformIO+-+DronBot+Workshop"

3. Opened vscode and did File->Open Folder ...  From file selection dialog selected folder of the test code (i.e. "Arduino Blink Test")

4. Opened src/main.cpp in Explorer pane

I did have an issue when I tried almost any thing in PIO with Windows 10 blocking programs access to files in the Documents folder.  Problem was related to "Controlled folder access" feature.  You can turn this feature off or allow specific apps though.  I decide to use allow function - I added programs as I found them (something failed - I checked what program was blocked and then added it.)

Not sure this helps.  If you post more specifics on what you tried I can see if I can help you.

When you're retired, every day is Saturday.


   
ReplyQuote
(@sj_h1)
Member
Joined: 4 years ago
Posts: 167
 

@vieuxgeek Without having the exact code you are trying to compile, it ia almost impossible for anyone to help you. Perhaps you could but the link drop the link you are trying to compile here and someone could give you a better answer. My guess is both errors are correct. You should never compare unlike types. Either make them both sighed or both unsigned. In both 'C' and 'C++', variables must be declared PRIOR  to use. Arduino IDE lets you get away with it but it is not good coding practice. Try moving the variable declaration to the top of the file but below any includes.

 


   
ReplyQuote
vieuxgeek
(@vieuxgeek)
Member
Joined: 3 years ago
Posts: 12
 

@sj_h1 I assume your reply is to @Melbul not me since he is the one with the problem.  I do agree with everything you said.

When you're retired, every day is Saturday.


   
ReplyQuote
(@sj_h1)
Member
Joined: 4 years ago
Posts: 167
 

@vieuxgeek Sorry I just it the reply and assumed it would be to the author.

 


   
ReplyQuote
Melbul
(@melbul)
Member
Joined: 3 years ago
Posts: 43
Topic starter  

thanks guys, yes the code runs in the Arduino IDE, so iy seems its the problem you specified.

 


   
ReplyQuote