summaryrefslogtreecommitdiff
path: root/Modelica-Arduino-MDD_Arduino_Revised/test_firmware.mo
diff options
context:
space:
mode:
authorSiddharth112352019-09-03 18:09:16 +0530
committerSiddharth112352019-09-03 18:09:16 +0530
commitb4b6aa36e3486a3544acc52419149b5671f841e9 (patch)
tree66c1783158f23e6d21c77324156fc57e18d4ac67 /Modelica-Arduino-MDD_Arduino_Revised/test_firmware.mo
parentf5266f634f4fb4fd39933a83551a01cf446256b8 (diff)
downloadOpenModelica_HIL-b4b6aa36e3486a3544acc52419149b5671f841e9.tar.gz
OpenModelica_HIL-b4b6aa36e3486a3544acc52419149b5671f841e9.tar.bz2
OpenModelica_HIL-b4b6aa36e3486a3544acc52419149b5671f841e9.zip
Pushing entire Modelica HIL Tasks repoHEADmaster
Diffstat (limited to 'Modelica-Arduino-MDD_Arduino_Revised/test_firmware.mo')
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/test_firmware.mo20
1 files changed, 20 insertions, 0 deletions
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/test_firmware.mo b/Modelica-Arduino-MDD_Arduino_Revised/test_firmware.mo
new file mode 100755
index 0000000..854d60f
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/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