Bakyt,
So two possible methods to do this depending on whether you want to receive the readings via the BT header or the microUSB connector. [Note that one point in using a BT device is to "isolate" your PC from any possible damage while testing devices but if you are prepared to put that to one side ...]
Method 1: BT Header
This bit of
code expects a BT trasmitter to be connected on the BT serial port header and checks for that during setup. The code sends "AT" to the BT device and expects to get an "OK" back within one second. The code will only send readings to the BT header if the "OK" is received. So connecting the FTDI rather than a BT device to the BT header will cause this test to fail unless you are really quick at typing OK into the terminal screen!
You could change the "false" to "true" on this
line to trick the detection logic into thinking a BT device is connected and force readings to be sent to the header and onto the FTDI, i.e:
You would need to re-instate the code that you had previously commented out. If you want to use the Arduino IDE Serial Plotter to graphically display the readings then you should change BT_OUTPUT_AMPS to BT_OUTPUT_NANOS on this
line so that the format of the readings can be understood by the IDE Plotter, i.e.:
Method 2:
Rather than using the BT header to receive the readings, you could redirect the readings to the usb connector and use that to connect to the Mac instead. To do this change the code that you identified before to use the
SerialUSB (this sends data to the usb connector) rather than
Serial (this sends data to the BT header). So replace these
lines with the following:
if (millis() - btInterval > BT_REFRESH_INTERVAL) //refresh rate (ms)
{
btInterval = millis();
readVOUT();
float VOUT = ((readDiff)/4096.0)*LDO_OUTPUT*1000*(OFFSET?1:OUTPUT_CALIB_FACTOR);
SerialUSB.println(VOUT * (RANGE_NA ? 1 : RANGE_UA ? 1000 : 1000000));
}
I have played around with the BT connector and have modified these parts of the code before so I think the above options should work but let me know if any issues.