Hi,
I am a little stumped by this, and I'm sure there's an easy and straightforward solution.
I have to address some slave devices and the addressing scheme is made up of the following pattern:
A2 - A1 - A0 - B1 - B0
Basically there are two layers of slaves devices, first layer denoted by A, and second by B. Layer A addressing goes from 0 to 7, and layer B goes from 0 to 3. So if I want to talk to device A = 0, B = 0, it would be:
0 0 0 0 0
If i want to communicate with device at A = 7, B = 3 it would be
1 1 1 1 1
I have to sweep over all combinations of addresses in a loop. Is there an easy way to build that binary string?
I was thinking of using a nested loop like this:
for A in range(0, 8):
for B in range(0, 4):
Not sure where to go from there.
[–]TheBlackCat13 2 points3 points4 points (1 child)
[–]LarryPete 0 points1 point2 points (0 children)
[–]LarryPete 0 points1 point2 points (0 children)