Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to call external functions. #68

Open
jenya7 opened this issue Jan 10, 2022 · 1 comment
Open

How to call external functions. #68

jenya7 opened this issue Jan 10, 2022 · 1 comment

Comments

@jenya7
Copy link

jenya7 commented Jan 10, 2022

In order to make a script useful for a real world I'd like to write

int main()
{
int sens1_val;
int sens2_val;
while(1)
{
sens1_val = m_sensor.GetDataByValType(1, SENS_VAL_TYPE_TEMP);
sens2_val = m_sensor.GetDataByValType(2, SENS_VAL_TYPE_HUM);
if ( sens1_val > 30.5 && sens2_val > 60)
Out(1, true);

}

}

But how to point the script to external functions (m_sensor.GetDataByValType, Out)?

@iProgramMC
Copy link

You are writing in C, not C++

Also this is an extremely limited dialect of C. You might want to add a new opcode to the interpreter to handle this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants