hee
I write a sketch with a runShellCommand and when it reach "valgevaar.runShellCommand("sh /root/valgevaar.sh");" it chrashes and does nothing anymore. what do I wrong?
also when I place "int valgevaarTeller = 0;" under "int analogReading[6];" it doen't count anymore in my opinion its somthing with the stack that someone else overwrite it. how can i see what is in there?
#include <Process.h>
int valgevaarTeller = 0;
int analogInPin[6] = {A0,A1,A2,A3,A4,A5};
int digitalInPin[4] = {10,11,12,13};
int outPin[9] = {1,2,3,4,5,6,7,8,9};
int digitalReading[4];
int analogReading[6];
void setup()
{
Bridge.begin();
for(int i=0;i<sizeof(outPin);i++){
pinMode(outPin[i], OUTPUT);
}
for(int i=0;i<sizeof(digitalInPin);i++){
pinMode(digitalInPin[i], INPUT);
}
}
void loop()
{
delay(100);
Process valgevaar;
for(int i=0;i<sizeof(digitalReading);i++){
digitalReading[i] = digitalRead(digitalInPin[i]);
}
for(int i=0;i<sizeof(analogReading);i++){
analogReading[i] = analogRead(analogInPin[i]);
}
boolean geenValgevaar = true;
for(int i=0;i<sizeof(digitalReading);i++){
if (digitalReading[i] == 1)
{
geenValgevaar = false;
if (valgevaarTeller < 20)
{
valgevaarTeller++;
}
break;
}
}
if (geenValgevaar)
{
valgevaarTeller = 0;
}
else
{
if (valgevaarTeller == 10)
{
valgevaar.runShellCommand("sh /root/valgevaar.sh");
}
}