blob: fbe7dc9778a9896fc70822bfd441a61795a3246b (
plain)
1
2
3
4
5
6
7
8
9
|
ok = open_serial(1, 2, 115200); // port 2, baud rate 115200
if ok ~= 0 then error('Unable to open serial port, please check'); end
for i = 1:1000 // Run for 1000 iterations
val = cmd_digital_in(1, 12); // Read the status of pin 12
cmd_arduino_meter(val);
end
close_serial(1); // To close the connection safely
|