Now I tried changing the "void loop" into "int loop" as I usually would do in java, except the code still wouldn't compile. Can someone help me? I'm new to this language and don't really know many commands
You can't change the setup() or loop() calls to anything besides void. There is simply nowhere for the return to go.
What you need to do is get a starter kit like http://www.sparkfun.com/products/10173 and just go nuts with it. Try! Do! Experiment! Write goofy code and watch it fail miserably! It's all about the journey.
Arduino is hiding a lot of backend C++ code from you, the function prototype defines the return type of a function and the prototype for setup and loop are hidden.
So a dot flashes back and forth through the columns. When a button is pressed, the dot pauses
So this part is just stacking the dots.
So, the code has to check that the dots are being stacked in the same column each time. So I assigned a number to each row in the column
And basically I was setting like
while(switchstate == 0) //for the button
{
//code, int col is being changed here
colstuff = 2^col;
//delay
flash = 2^col;
return flash;
}
That way, when the button is pressed and the while statement is broken, it would be pressed in between colstuff and flash, and the values wouldn't be same all the time.
err... you are not making much sense, your code doesn't make sense because the return statement in the while loop will always execute, so the while loop is essentially an if statement.
the boolean expression given as the condition of a while loop is only evaluated at the start of the loop