Hello All, I am new to the arduino and have a fairly straight-forward question, but I have been unable to find a straight-forward answer while browsing the forum and help/tutorial sections.
I have 3 IR inputs connected to 3 digital inputs on the arduino. My goal is to convert the three inputs to a binary value, for example, if the inputs are HIGH/HIGH/LOW on the three channels, I want to convert that info into a binary value, B110, so I can use it in my script. Is there an easy way of doing this?
Also, a more general question, is the HIGH and LOW returned by DigitalRead() a string when imported? Does it have other values associtated with it? For example, if I use the int() conversion function, will int(HIGH) return 1.
Secondly, if I define, say, the following:
int a=1; int b=1; int c=0; int d=0;
Would it work to create a binary number defining it as:
being analogous to originally writing:
Thanks for your help! -NICK