Hi there,
I am trying to implement an ultrasonic sensor, the A02YYUW into my Bela setup, but I am struggling with it for a while and stressing for an upcoming deadline / premiere. I thought the A02YYUW would work in more or less of the same manner as other ultrasonic sensors like the HC-SR04, but I now understand from the datasheet that I have to setup an UART connection. So I am now following these steps: https://learn.bela.io/using-bela/advanced-topics/bela-as-a-uart-adapter/#enabling-the-uart-port I have setup the UART overlay, but I am having troubles communicating with the UART pins. The bela tutorial on UART connections says that I should use 'open(), read() and write(), close() operations on the device file from a C program', so I am trying that on the /dev/ttyS4, but as I understand from this post , I need to use the P9_11 and P9_13 pins on the Beagleboard itself as the RX and TX, if I understand it correctly?
For the sound installations that we are creating we need to run 4 ultrasonic sensors on one Bela to switch the composition on / off. It seems impossible to run 4 ultrasonic A02YYUW sensors on the Bela based on what I have figured out about the UART connections on the Bela, or am I wrong?
I have the A02YYUW runing perfectly on an Arduino Uno. So I am thinking now of getting an Arduino Mega (which has four serial ports) for the four A02YYUW's and then send the data from the Arduino to the Bela. Would this be possible or would I then lack one serial port for the communication between the Mega and the Bela? I think it should be possible to use the 4 UART serial ports on the Mega for the four A02YYUW 's and then send the values via the USB serial connection to the Bela, right? It would be great to know, since we are going to install 7 installations, so I have to order 7 mega's and 28 A02YYUW's. Earlier I was using Sharp IR sensors to trigger the installation which worked great, but I am afraid that too much daylight might confuse these sensors and the A02YYUW's seem the most robust ultrasonic sensors for installations outside (the installations are running for 3 months).
Thanks in advance!
All the best,
Sjoerd