Jump to content

basic programming help

Go to solution Solved by Shoob,

What does this mean?

what do they find and replace? Is that something that programmers (not me) know about? Also can you explain the values behind the defines?

It replaces the key with the value.  (START = 8 ... etc.). It doesn't take up memory so it's mostly used for embedded programming.

You can read more here: https://www.arduino.cc/en/Reference/Define

As for the values, I don't know what they exactly are looking only at the defines. I'm not experienced in embedded programming, so I can't help much with that.

Hi, I need some help understanding what the #defines in the beginning of a program mean. I'm completely new to this but from seeing constants in PHP I think these are constants as well?

 

#define START 8

#define ACK 0x55

#define RDY 0x55

#define NOT_RDY 0XAA

#define IDLE 1

#define POLL 2

#define UNINITIALISED 0

#define DUMMY 0

#define ADC_START 3

#define ADC_ONTVANGEN 4 (ontvangen=receive in my language)

 

Can anyone explain what these basically are and what the values at the end means? I added the full program should you need this in order to tell me what these #defines are/do.

Link to comment
Share on other sites

Link to post
Share on other sites

#define is similar to declaring a constant, but it acts like find and replace.

From salty to bath salty in 2.9 seconds

 

Link to comment
Share on other sites

Link to post
Share on other sites

#define is similar to declaring a constant, but it acts like find and replace.

 

What does this mean?

what do they find and replace? Is that something that programmers (not me) know about? Also can you explain the values behind the defines?

Link to comment
Share on other sites

Link to post
Share on other sites

What does this mean?

what do they find and replace? Is that something that programmers (not me) know about? Also can you explain the values behind the defines?

It replaces the key with the value.  (START = 8 ... etc.). It doesn't take up memory so it's mostly used for embedded programming.

You can read more here: https://www.arduino.cc/en/Reference/Define

As for the values, I don't know what they exactly are looking only at the defines. I'm not experienced in embedded programming, so I can't help much with that.

From salty to bath salty in 2.9 seconds

 

Link to comment
Share on other sites

Link to post
Share on other sites

It replaces the key with the value.  (START = 8 ... etc.). It doesn't take up memory so it's mostly used for embedded programming.

You can read more here: https://www.arduino.cc/en/Reference/Define

As for the values, I don't know what they exactly are looking only at the defines. I'm not experienced in embedded programming, so I can't help much with that.

Thanks, that link was what I needed.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×