Go Down

Topic: help !!Arduino code that takes an action when it reads 1 from a binary table  (Read 2409 times) previous topic - next topic

doener3

Hello ! I would like help on a code that enables a pin on my arduino when the program reads 1 from a binary table (i,j) ! I think it should be easy but i can't find the solution as i am a beginner!
Thank you

ieee488

Hello ! I would like help on a code that enables a pin on my arduino when the program reads 1 from a binary table (i,j) ! I think it should be easy but i can't find the solution as i am a beginner!
Thank you
Help?  Do you mean you want us to write the program for you?

There won't be a solution ready made for you, so you'll have to learn how to do it step by step.

.

doener3

i dont want the code i just need the part that says in the loop (i,j) for example at cordinate (4,6) of my binary table if its 1 to recognize it ! I cant make it work !

ieee488

i dont want the code i just need the part that says in the loop (i,j) for example at cordinate (4,6) of my binary table if its 1 to recognize it ! I cant make it work !
Post the code you have written so far using code tags.

No help without it.


Robin2

To make it easy for people to help you please modify your post and use the code button </>


Code: [Select]
so your code
looks like this
and is easy to copy to a text editor. See How to use the Forum

Your code is too long for me to study quickly without copying to my text editor. The text editor shows line numbers, identifies matching brackets and allows me to search for things like all instances of a particular variable or function.


If you just want to iterate trough a 2-dimensional array then I think something like this should work

Code: [Select]
for (byte outerLoop = 0; outerLoop < outerMax; outerLoop ++) {
    for (byte innerLoop = 0; innerLoop < innerMax; innerLoop ++) {
       currentVal = array[outerLoop][innerLoop];
    }
}


Not tested. Hopefully someone will correct me if I have the details wrong.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Go Up