diff options
author | manasdas17 | 2019-08-26 09:14:01 +0530 |
---|---|---|
committer | manasdas17 | 2019-08-26 09:14:01 +0530 |
commit | a606e57a77628d2ac2301ee7e194bd46f7a5813b (patch) | |
tree | f17cd36483b9e173d2a1d906a0a8363431002b09 /OpenModelica_Arduino_With_MDD/test_firmware.mo | |
download | OpenModelica_Arduino_With_MDD-1-a606e57a77628d2ac2301ee7e194bd46f7a5813b.tar.gz OpenModelica_Arduino_With_MDD-1-a606e57a77628d2ac2301ee7e194bd46f7a5813b.tar.bz2 OpenModelica_Arduino_With_MDD-1-a606e57a77628d2ac2301ee7e194bd46f7a5813b.zip |
first commit
Diffstat (limited to 'OpenModelica_Arduino_With_MDD/test_firmware.mo')
-rw-r--r-- | OpenModelica_Arduino_With_MDD/test_firmware.mo | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/OpenModelica_Arduino_With_MDD/test_firmware.mo b/OpenModelica_Arduino_With_MDD/test_firmware.mo new file mode 100644 index 0000000..854d60f --- /dev/null +++ b/OpenModelica_Arduino_With_MDD/test_firmware.mo @@ -0,0 +1,20 @@ +model test_firmware "Testing SerialCommunication with Arduino" + +import sComm=Arduino.SerialCommunication.Functions; +Integer h(fixed = false); +Integer byte_read(fixed = false); +//String str(fixed =false); +Integer wr(fixed =false); +Integer c_OK(fixed =false); +algorithm + when initial() then + h:=sComm.open_serial(1,0,115200); + sComm.delay(2000); + wr:=sComm.write_serial(1,"v",1); + byte_read:= sComm.read_serial(1,2); + c_OK := sComm.close_serial(1) "To close the connection safely"; + end when; + annotation( + experiment(StartTime = 0, StopTime = 10, Tolerance = 1e-6, Interval = 10)); + +end test_firmware;
\ No newline at end of file |