Arduino: port.write() freezes processing when bluetooth connection is unavailable
in
Integration and Hardware
•
1 month ago
Hello. I'm using this code to check the connection between an arduino board and processing (PC). try { port.write(222); } catch (Exception offline) { offScreen = 1; } When the arduino is been connected via usb cable to the pc usb port everything work great.If the usb cable has been unpluged the offscreen value became '1'. The problem is, that if I use a bluetooth module for a serial connection instead of usb cable, when the program tries to write to the port the "222", the program crashes. The catch function does not work. Any suggestions? Thanks
1