I am very new to code and all that I'm trying to do is to get the thing to spin. It is hooked up to an ESC and to the Arduino. When I try to upload it, it gives me this error on the first line:
sketch_jan04f:1: error: expected constructor, destructor, or type conversion before '.' token
It still gives me the same error even with the semicolons.
I am almost totally clueless about code
If you have any tips or improvements or suggestions on my code (above) please post a reply
HOW AND WHEN DO I USE THESE FUNCTIONS?
I tried looking it up and I only got more confused. Could you also tell me where and how to use these functions in my code?
The Arduino executes main() when powered up. The main() function calls init(), setup(), and loop(), in an endless loop. You don't have to use these functions. You just have to supply them.
There are dozens of sample sketches provided with the IDE that show how setup() and loop() are structured. Running some of them would show how they are used.
Also are you saying that the stars and slashes are for multiplying and dividing?
Yes.
Start looking at the example code found in the arduino IDE, that is the software you have running on your PC. Look in the File -> Examples menu to get started.
You are a way off being able to control motors yet until you learn the basics.
Also are you saying that the stars and slashes are for multiplying and dividing?
That's one use. The other, when they are use together is to start and end comments. Out of context, as your question was, the answers can go either way (or a host of other ways, for that matter). The point of my rather silly reply, was to get you to provide that context.
I meant the little descriptions next to the code.
int var = value; // Like this?
No, the comments (that's what they are) are not required. Often, they simply state the obvious. But, to a newcomer they explain what the code does. Of course, what is obvious to me and what is obvious to you are miles apart. So, you should provide them in code you share, so that we can see that your understanding of the code is correct.