r/ArduinoProjects • • Jun 24 '23

Beginner need instructions

Post image

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

9 comments sorted by

6

u/_Error_Account_ Jun 24 '23

int led = 13;

pinMode(led, OUTPUT);

digitalWrite

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 printf function to print a message to the console. In Arduino, the "equivalent" method is Serial.println or Serial.print. I say equivalent because the Arduino version is less "capable" than C's printf but they do the same basic thing - print a message to the console. Other examples include things like pinMode or digitalWrite are 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.

3

u/[deleted] Jun 25 '23

I don't think any course would be that helpful. Granted that he has absolutely zero knowledge of C, many programmers recommend doing projects to learn rather than being stuck in tutorial hell.

1

u/gm310509 Jun 26 '23

Interesting thought, all of my courses (including the ones I have created and taught in the past) included exercises and mini projects that use what had just been taught.

I had just assumed that a (proper) course would include the same, otherwise it would just be theory - which I do not feel would be supportive of learning in IT.

2

u/ZaphodUB40 Jun 24 '23

Case sensitivity…all I’m going to say.

0

u/[deleted] Jun 24 '23

learn basic C++ before doing this, as it seems like you know nothing

0

u/[deleted] Jun 24 '23

[deleted]

2

u/Big_MoJo Jun 24 '23

Appreciate it man

0

u/[deleted] Jun 24 '23

[deleted]

2

u/Big_MoJo Jun 24 '23

Ok got that now it’s saying something is wrong with “void setup”