Simulate a Serial command with code

Hello guys,

i try to use a dfrobot ph sensor what works well, till it comes to calibration. The libary needs to read a serial command "enterph" send manually from the serial monitor to start the calibration routine. The thing is, i want to use the sensor without a pc later and want to start the calibration process by code with an event of a button or so.

now im searching for a way to simulate this serial input within the code.

Do you know a way to do this?

simply "Serial.println()" or "Serial.write()" doesnt the trick. i only want to use the arduino itself and no secondary hardware to send ove a serial command. Thats what i found so far as solution.

any help would be appreciated

Change that code to trigger on a button press.

It's called loopback.
Tie TX to RX, i.e. pin 1 to 0. Now your Serial.println(whatever) should be received.

1 Like

Is this value for your code to calibrate the pH sensor?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.