If the first Pico detects switch 4 turning on it sends 0004On. The Pi will interpret that as sensor 4 on Pico 0.I don't think I understand this correctly.
I read you description as each Pico will modify a status message from an upstream Pico before sending it downstream towards the RPi.
That would end in the RPi interpreting all status messages received as coming from the nearest Pico to the RPi.
So first Pico (let's call it 01) detects a change on sensor 4 and sends 0104On. This becomes 0204On, 0304On etc. until it reaches the RPi, which interprets that sensor 4 on Pico xx (the last Pico just before the RPi) has switched on.
That's not going to work - or have I misunderstood something?
If the second Pico detects switch 4 turning on it sends 0004On to the first Pico. The first Pico modifies that to 0104On and sends that to the Pi. The Pi interprets that as sensor 4 on Pico 1.
Third Pico sends 0004On to second Pico which modifies and sends 0104On to first Pico, which modifies and sends 0204On to Pi. Sensor 4 on Pico 2.
Good for up to 100 Picos

This way there's no need to set any hardware addresses in the Picos. They all run identical code.
Statistics: Posted by rpdom — Mon Nov 18, 2024 11:02 am