MATLAB

CODE 1

%clear all;
global a;
a = arduino('COM4', 'ESP32-WROOM-DevKitV1');
x = 0;
while(true)
writeDigitalPin(a,'D15',1);
pause(1);
writeDigitalPin(a,'D15',0);
pause(1);
value = readVoltage(a,'D34');
temp = (value*100);
disp(temp);
x = [x temp];
plot(x);
grid on;
xlabel('Time(seconds)')
ylabel('Temperature(C)');
title('Real-Time Temperature Graph');
drawnow
end
(0)