r/ArduinoProjects • u/Big_MoJo • Jun 24 '23
Beginner need instructions
I have zero clue what’s wrong here but I am a beginner to this so can you dumb it down for me
8
Upvotes
r/ArduinoProjects • u/Big_MoJo • Jun 24 '23
I have zero clue what’s wrong here but I am a beginner to this so can you dumb it down for me
6
u/gm310509 Jun 24 '23
You might want to follow an introductory C course and/or have a look at some of the language structures as listed here: https://www.arduino.cc/reference/en/#structure
You might try searching online for "introductory C course for Arduino".
Note that you can do a C programming tutorial or course online or on your PC. But there are some slight differences between PC and Arduino.
Firstly, the C/C++ language is the same on both.
The difference is in the runtime. For example, C on the PC has a
printffunction to print a message to the console. In Arduino, the "equivalent" method isSerial.printlnorSerial.print. I say equivalent because the Arduino version is less "capable" than C'sprintfbut they do the same basic thing - print a message to the console. Other examples include things likepinModeordigitalWriteare available on Arduino, but not a PC. All of these "runtime library" differences are because the platforms (PC and Arduino) provide different capabilities - and thus the programming environments (PC and Arduino) provide different functions that allow you to access those capabilities. There are some other differences (such as "word size"), but at this stage of your learning, you probably don't need to worry too much about those quite technical things.As to your errors, each line in a C program - or more precisely each statement, because a statement can be split over multiple lines - need to be terminated by a semi-colon.
Welcome to the hobby.