Skip to content

Instantly share code, notes, and snippets.

@ultramcu
Created May 10, 2014 18:19
Show Gist options
  • Save ultramcu/e262a4cb1a5da180c5ad to your computer and use it in GitHub Desktop.
Save ultramcu/e262a4cb1a5da180c5ad to your computer and use it in GitHub Desktop.
Arduino Pass by reference
typedef struct
{
int data;
}st_struct;
void my_fn(void *st)
{
st_struct *s = (st_struct *)st;
...
}
void setup()
{
...
}
void loop()
{
...
}
#include "arduino_code_st.h"
void my_fn(st_struct *st)
{
}
void setup()
{
}
void loop()
{
}
//File path ARDUINO_LIBRARY/arduino_code_st/arduino_code_st.h
typedef struct
{
int data;
}st_struct;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment