Page 1 of 1

Passing pointers to C macro modules

Posted: Mon Aug 12, 2013 5:54 pm
by Pyhis
Hi

I am trying to use a function like this in flowcode. I am passing 4 variables and declaring pointers to them, and in the function I am
changing the values of the variables with pointers. Is this possible to make to a macro block or something similar? I am trying to avoid global variables.
If this is not possible, how would you do it?

Code: Select all

 char readDHT22(short *temp_integer, char *temp_decimal, char *hum_integer,char *hum_decimal) { 
Regards,
Kristian

Re: Passing pointers to C macro modules

Posted: Wed Aug 14, 2013 12:47 pm
by JonnyW
Hello.

What version of Flowcode are you using? If you wish to pass variables like this to an existing C function in v5 or below you can use a C code icon. If you wish to create a Flowcode macro, this will only allow passing of parameters as strings at present.

This changes with v6 and you can pass arrays into macros no problems. Passing by-ref (so you can modify the values) is allowed.

We are going to an open Beta hopefully today so you will be able to download and test this. Keep an eye on this post for details.

Jonny

Re: Passing pointers to C macro modules

Posted: Thu Aug 15, 2013 6:29 am
by Pyhis
How do you include your own .h and .c files to your project, so you can use the function with the C icon.

I really like visual representation of the flowcode, but I think it is a little too restricted.
There should be a place where you can include your own header files.

Kristian