I’m currently writing a sketch to control KH 810 Studio Subwoofer as I described here in another post:
A MAX232 is connected to pin 2 and 3 and I’m able to send commands to the subwoofer.
I succeeded to control the volume using a rotary encoder that sends a “setvol” command to the subwoofer. For that I created a function setvol().
I’m now trying to get a value from the subwoofer, in this example “getvol”. The idea would be to show this value on a LCD screen, but first I just want to print it on the serial monitor.
The value is in the same format than setvol and is contained between -95.00 and 20.00. I created a function getvol() that is sending the command getvol, but the returned value is always “-1.00” !
I tested that even if I do not send the getvol command, the value is stil the same, it looks like I cannot read the value at all.
I tested this using a simple USB to RS232 directly to the subwoofer and connected via PuTTY terminal.
When I type “getvol” carriage return the value is directly printed to a new line.
Any idea where I’m wrong here?
rotary.ino (1.31 KB)