Go Down

Topic: handwriten code will not compile (Read 560 times) previous topic - next topic


I don't get it !

this is what I wrote:

//example 01   : blinking LED

const int LED = 13            // LED conected to
                             //  digital pin 13
void setup() {                         

pinMode(LED, OUTPUT);     //  sets the digital
                              //  as output

,void loop()
  didgitawrite(LED, HIGH);     // turns the LED on
  delay(1000);                 // waits for one second
  didgitalwrite(LED, LOW);     // turns the LED off
  delay(1000);                 // waits for one second

this is the error msg.

sketch_mar16a:7: error: expected ',' or ';' before 'void'

 void setup() {                         


sketch_mar16a:13: error: expected unqualified-id before ',' token

 ,void loop()


sketch_mar16a:13: error: expected unqualified-id before 'void'

 ,void loop()


exit status 1
expected ',' or ';' before 'void'

Thanks for the help!


You have a comma before before void loop()

Next time please use code tags when posting code
Type [code]
Paste your code after that
Type [/code] after that
If you understand an example, use it.
If you don't understand an example, don't use it.

Electronics engineer by trade, software engineer by profession. Trying to get back into electronics after 15 years absence.


Code: [Select]
sketch_mar16a:7: error: expected ',' or ';' before 'void'

 void setup() {                        


It's because you forgot the semicolon at the end of this line:
Code: [Select]
const int LED = 13    


Mar 17, 2018, 05:39 pm Last Edit: Mar 17, 2018, 05:41 pm by larryd
Before writing any Arduino code, review the examples in the IDE to see how things are done.

You cannot invent your own syntax and expect things to work.

No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.


Also, read those errors - they tell you where the compiler notices the problem, and for problems like this, the error is pretty clear...
ATTinyCore and megaTinyCore for all ATtiny, DxCore for DA/DB-series! github.com/SpenceKonde
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

Go Up