Question about QTI sensors and the addon kit 28108
tnbk00
Posts: 2
Hi I have followed the instructions for the add on kit 28108 to add line following capability to my Boe-Bot.
I am using an arduino and have loaded the code example from the product page.
I am seeing some very odd behaviour. With one of the sensors the binary conversion when displaying to the terminal does a very strange thing.
For example the standard state is: (
1111
with all seeing black its
0000
If I cover the sensors one at a time from right to left I get the following output
1110 - 7 in decimal
1101 - 13 in decimal
1011 - 11 in decimal
111 - 7 in decimal but it drops the last (or the first) digit.
The final sensor for some reason does not seem to do the binary conversion correctly.
In the code I dropped the , BIN from the terminal output and it shows the correct decimal values.
I have swapped the offending QTI sensor with another one but the results are the same, which made me think maybe its the wiring or the code.
Any suggestions would be great!
I am using an arduino and have loaded the code example from the product page.
I am seeing some very odd behaviour. With one of the sensors the binary conversion when displaying to the terminal does a very strange thing.
For example the standard state is: (
1111
with all seeing black its
0000
If I cover the sensors one at a time from right to left I get the following output
1110 - 7 in decimal
1101 - 13 in decimal
1011 - 11 in decimal
111 - 7 in decimal but it drops the last (or the first) digit.
The final sensor for some reason does not seem to do the binary conversion correctly.
In the code I dropped the , BIN from the terminal output and it shows the correct decimal values.
I have swapped the offending QTI sensor with another one but the results are the same, which made me think maybe its the wiring or the code.
Any suggestions would be great!
Comments
1110 is 14 not 7
111 is 7
0111 and 111 are the same numbers.
From what you've described, it looks like the sensors and code are working correctly.
I'm sure there's a way to force a leading zero if you want one displayed but I don't know off hand how to do this with an Arduino.
The issue is that the rest of the code has case checks where it is looking for 0111 which it will never see. Ill just change what its looking for but this sure feels like something else is not right here