giuliomoro
I think I've fixed the problem, the delay between the 1 and 0 message was way too long, and now I make sure there is nothing within my operating range on the sensors (5-45cm).
But, as always, I have a new problem 🙂. Well, not exactly a problem, more of an oversight. I didnt realise how much of a flat surface has to be used for the sensor to 'hear' the echo back. After a long time looking at my code, wondering why suddenly sometimes all of the solenoids actuate, I realised it was because when the sensor doesn't receive an echo, it panics and sends an output to some or all of the solenoids, causing them to turn on (I think its something to do with Bela as I get a block dropped when it happens. Normally what happens is there is a massive spike in the distance received which is normally 5-45cm, so it spikes 300 or something, and then block dropped, and then the solenoids panic actuate... My pure data patch has conditions in it, so that the only time the solenoids actuate should be when the distance is between 5-45cm, this leads me to believe that its a bela/cpp problem).
On an unrelated note, I've just Run the project and nothings working??? No print data going to the console, no solenoids reacting to the sensors. I made a test metro-print patch, and its not printing anything to the console. I've tried unplugging, ejecting the SD card. Any ideas?
Thanks for any help
https://i.imgur.com/X1YTxGb.jpg This works
https://i.imgur.com/F4d8hES.jpg This angle sometimes fails to return the signal to the sensor causing Bela to panic