I'm trying to send data to my computer from my arduino Mega 2560 using a bluesmirf bluetooth device. I've uploaded the appropriate firmware for the arduino itself, and when I tried to test it with a USB connection instead of a bluetooth connection, it worked perfectly fine. However, when I try to read data from the arduino using the bluesmirf, it gives me the error code 5002. My program is included below:
I have tried with a baud rate of both 9600 and 115200, set the connection type to bluesmirf, and board to Mega 2560. I have the program finding a COM port using the VISA find resource vi and select the correct port. I then have it initialize a connection and then take an analog reading of pin A0. When it gets to this point, it throws up the error message 5002. Does anyone know what the problem might be?