How does one debug code?

How does one debug code?

0
0

Debugging blocked Coding
Visual Text

Hi All, I’ve been following PaulW’s training on line and have been building up a small LED setup, but when I load it, it hangs up and says: *“sketch_dec06a:155:1: error: expected unqualified-id before ‘{‘ token”*

Is there anywhere that I can get written info on debugging this, as Paul does not reference it anywhere.

I’ll attach the sketch data and if you can analyze it and point me in the right direction, it will be highly appreciated.

Angus
Choose category:

Electronic components
Product SKU (can be found on the product page to the right of the image):
Drag and drop attachments here
4 files
Allowed file types: png, pdf, jpg, gif, mp4
Max file size: 28.7 MB
sketch_dec06a.inoFiletype is not allowed. Allowed extensions: png, pdf, jpg, gif, mp4
Programming Fault ID.jpg×
Glossary 1.jpg×
Arduino Code1.docxFiletype is not allowed. Allowed extensions: png, pdf, jpg, gif, mp4
Arduino Debug 1.docxFiletype is not allowed. Allowed extensions: png, pdf, jpg, gif, mp4
Flash RedLed.docxFiletype is not allowed. Allowed extensions: png, pdf, jpg, gif, mp4
Arduino Code1.pdf×
Arduino Debug 1.pdf×
Flash RedLed.pdf×
RGB Flash.pdf×
Notify me of follow
Terms and conditions Return and refund policy Privacy Policy Payment methods Bot Shop Shipping Bot Points Contact us
Bot Shop All rights reserved. We make electronics and robotics education and project building fun.

Marked as spam
Posted by (Questions: 1, Answers: 0)
Asked on Dec 7, 2021 2:29 pm
30 views
0
Private answer

Hi there, as per our email earlier, the void loop function is incorrect the void loop should look as follows

void loop(){
some code goes here
}

It should always start with a { and end with } if you have another function inside the void loop like a for loop it will look like the following

void loop(){
for(int i=0;i<5;i++){
code to repeat 5 times comes here.
}
}

I am also attatching the code I fixed as per my email earlier. as well as the unsimplified version of the code you sent but with the errors fixed

Marked as spam
Posted by (Questions: 0, Answers: 62)
Answered on Dec 7, 2021 2:49 pm