From d7669ee352381f35b17bd87f5456cdaed3061590 Mon Sep 17 00:00:00 2001 From: Robert Hedman <robert.hedman@mac.com> Date: Tue, 19 Dec 2017 13:46:18 +0100 Subject: [PATCH] updated serial send with error case --- src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index a937a7d..aac1c42 100644 --- a/src/main.rs +++ b/src/main.rs @@ -164,7 +164,10 @@ fn main() { // PID controller // send voltage to motors. - port.write(&message[0..message_length]).unwrap(); + match port.write(&message[0..message_length]) { + Ok(n) => {println!("Controller: sent {} bytes to arduino!", n);}, + Err(e) => {println!("Controller: could not write to arduino: {}", e); }, + } } -- GitLab