![]() |
#define creation
I am trying to complicate my autonomous file by creating a new variable set to run off of and i need to know how to create a #define code in my .h files so it doesn't spit massive error messages at me for using a "not defined" variable, any instructions on how to properly define something would be nice.
|
Re: #define creation
I'm a little confused by your question, but this is how you correctly define a constant in a header and then use it in a C file
my_header.h Code:
#define MY_CONSTANT 1Code:
#include "my_header.h" |
Re: #define creation
It sounds like you want to "declare a variable", not "define" anything. Using #define is typically for constants and shortcuts to save typing. What you're probably looking for is something like this:
Code:
int auto_timer; |
Re: #define creation
you can do stuff like
Code:
#define GLOBE_MOTOR pwm03- Normally all constants have capital letters - Use names to label pwm's like in the example above. I found that is it much easier for a Dummy programmer to understand that the code is right and that it is something mechanical :D |
| All times are GMT -5. The time now is 16:30. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi