We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm trying to write node for delay of row of numbers, which enter the input sequentially. Row of nombers is random of 1-5.
in line 37 the value nomber 'i' is output from the array.
But when nValue=5, i=6, Arduino Uno outputs '60'. Wherein A[5] not equal 60.
`node { unsigned int i; int a; int *A;
int counter(unsigned int index, unsigned int nValue) { if (index > (nValue)) { return 1; } else { return index=index+1; } }
void init() { A = new int[a]; }
void evaluate(Context ctx) {
if (isSettingUp()) { // This run once int nValue = getValue<input_N>(ctx); a = nValue + 1; i = 1; init(); }
if (isInputDirty<input_UPD>(ctx)) {
int inValue = getValue<input_IN>(ctx); A[i] = inValue; int nValue = getValue<input_N>(ctx); i = counter(i, nValue); if(!isInputDirty<input_UPD>(ctx));
} emitValue<output_OUT1>(ctx, A[i]); emitValue<output_OUT2>(ctx, A[5]); //diagnotstic data } } data-delay.zip `
The text was updated successfully, but these errors were encountered:
Found a solution: the array is increased by 1 element. I don't use the last element of the array, but now the output is correct.
Sorry, something went wrong.
No branches or pull requests
I'm trying to write node for delay of row of numbers, which enter the input sequentially.
Row of nombers is random of 1-5.
in line 37 the value nomber 'i' is output from the array.
But when nValue=5, i=6, Arduino Uno outputs '60'. Wherein A[5] not equal 60.
`node {
unsigned int i;
int a;
int *A;
void init()
{
A = new int[a];
}
if (isSettingUp()) {
// This run once
int nValue = getValue<input_N>(ctx);
a = nValue + 1;
i = 1;
init(); }
if (isInputDirty<input_UPD>(ctx)) {
}
emitValue<output_OUT1>(ctx, A[i]);
emitValue<output_OUT2>(ctx, A[5]); //diagnotstic data
}
}
data-delay.zip
`
The text was updated successfully, but these errors were encountered: