From 44ad9efa7e729739cde3103d8fc1e475efa2a923 Mon Sep 17 00:00:00 2001 From: Sumeet Koli Date: Mon, 18 Jun 2018 14:46:14 +0530 Subject: Change in directory structure --- ArduinoExamples.mo | 477 +++++++ Boards.mo | 1464 +++++++++++++++++++ Examples.mo | 374 +++++ Firmware/Arduino/pidmata3/pidmata3.ino | 904 ++++++++++++ Firmware/Tiva C/StandardFirmata.zip | Bin 0 -> 858425 bytes Firmware/Tiva C/StandardFirmata/Boards.h | 566 ++++++++ Firmware/Tiva C/StandardFirmata/Firmata.cpp | 554 ++++++++ Firmware/Tiva C/StandardFirmata/Firmata.h | 180 +++ Firmware/Tiva C/StandardFirmata/FirmataConstants.h | 97 ++ Firmware/Tiva C/StandardFirmata/FirmataDefines.h | 283 ++++ .../Tiva C/StandardFirmata/FirmataMarshaller.cpp | 431 ++++++ .../Tiva C/StandardFirmata/FirmataMarshaller.h | 75 + Firmware/Tiva C/StandardFirmata/FirmataParser.cpp | 480 +++++++ Firmware/Tiva C/StandardFirmata/FirmataParser.h | 105 ++ Firmware/Tiva C/StandardFirmata/Servo.cpp | 234 ++++ Firmware/Tiva C/StandardFirmata/Servo.h | 54 + .../Tiva C/StandardFirmata/StandardFirmata.ino | 864 ++++++++++++ .../StandardFirmata/TM4C123GH6PM_PinDiagram.jpeg | Bin 0 -> 1017259 bytes .../Tiva C/StandardFirmata/pinout_tm4c123g.txt | 88 ++ Firmware/pidmata3.ino | 904 ++++++++++++ Firmware/pidmata3/pidmata3.ino | 904 ++++++++++++ GettingStarted.mo | 67 + Internal.mo | 164 +++ Pins.mo | 117 ++ Resources/Images/Blink.png | Bin 0 -> 106798 bytes Resources/Images/BlinkingLEDModel.png | Bin 0 -> 9687 bytes Resources/Images/CustomExample.png | Bin 0 -> 55291 bytes Resources/Images/DefaultSynchronize.png | Bin 0 -> 66468 bytes Resources/Images/Dimming.png | Bin 0 -> 106641 bytes Resources/Images/FirmataLocation.png | Bin 0 -> 33536 bytes Resources/Images/Interval.png | Bin 0 -> 225058 bytes Resources/Images/ModelPlugDocumentation-1.png | Bin 0 -> 181717 bytes Resources/Images/ModelPlugDocumentation-2.png | Bin 0 -> 18389 bytes Resources/Images/ModelPlugDocumentation-3.png | Bin 0 -> 22183 bytes Resources/Images/ModelPlugLog-nomarkers.png | Bin 0 -> 172348 bytes Resources/Images/ModelPlugLog-withmarkers.png | Bin 0 -> 510685 bytes Resources/Images/PinNumber.png | Bin 0 -> 36423 bytes Resources/Images/QuotedSerialPort.png | Bin 0 -> 54182 bytes Resources/Images/ReadAnalog.png | Bin 0 -> 110825 bytes Resources/Images/SerialPortLocation.png | Bin 0 -> 37429 bytes Resources/Images/ServoExample.png | Bin 0 -> 117766 bytes Resources/Images/SimpleONOFF.png | Bin 0 -> 137660 bytes Resources/Images/StandardFirmata.png | Bin 0 -> 56447 bytes Resources/Images/StopTime.png | Bin 0 -> 224766 bytes Resources/Images/SynchronizeSetting.png | Bin 0 -> 66468 bytes Resources/Images/Thumbs.db | Bin 0 -> 38912 bytes Resources/Images/analogInput.png | Bin 0 -> 4531 bytes Resources/Images/analogOutput.png | Bin 0 -> 4588 bytes Resources/Images/arduino.png | Bin 0 -> 5855 bytes Resources/Images/arduinoLeonardo.png | Bin 0 -> 5922 bytes Resources/Images/custom.png | Bin 0 -> 5411 bytes Resources/Images/digitalInput.png | Bin 0 -> 4514 bytes Resources/Images/digitalOutput.png | Bin 0 -> 4577 bytes Resources/Images/example1.png | Bin 0 -> 28754 bytes Resources/Images/example2.png | Bin 0 -> 30650 bytes Resources/Images/features.png | Bin 0 -> 37820 bytes Resources/Images/front.png | Bin 0 -> 46421 bytes Resources/Images/servo.png | Bin 0 -> 5171 bytes Resources/Images/standard.png | Bin 0 -> 5606 bytes Resources/Include/modelPlugFirmata.h | 33 + Resources/Include/modelPlugFirmata.h~ | 33 + Resources/Library/linux64/libmodelPlugFirmata.so | Bin 0 -> 56334 bytes Source/CMakeCache.txt | 307 ++++ Source/CMakeCache.txt~ | 307 ++++ Source/CMakeFiles/3.5.1/CMakeCCompiler.cmake | 67 + Source/CMakeFiles/3.5.1/CMakeCXXCompiler.cmake | 68 + .../3.5.1/CMakeDetermineCompilerABI_C.bin | Bin 0 -> 8640 bytes .../3.5.1/CMakeDetermineCompilerABI_CXX.bin | Bin 0 -> 8656 bytes Source/CMakeFiles/3.5.1/CMakeSystem.cmake | 15 + .../3.5.1/CompilerIdC/CMakeCCompilerId.c | 544 ++++++++ Source/CMakeFiles/3.5.1/CompilerIdC/a.out | Bin 0 -> 8800 bytes .../3.5.1/CompilerIdCXX/CMakeCXXCompilerId.cpp | 533 +++++++ Source/CMakeFiles/3.5.1/CompilerIdCXX/a.out | Bin 0 -> 8808 bytes Source/CMakeFiles/CMakeDirectoryInformation.cmake | 16 + Source/CMakeFiles/CMakeOutput.log | 554 ++++++++ Source/CMakeFiles/Makefile.cmake | 115 ++ Source/CMakeFiles/Makefile2 | 108 ++ Source/CMakeFiles/TargetDirectories.txt | 3 + Source/CMakeFiles/cmake.check_cache | 1 + Source/CMakeFiles/feature_tests.bin | Bin 0 -> 12696 bytes Source/CMakeFiles/feature_tests.c | 34 + Source/CMakeFiles/feature_tests.cxx | 405 ++++++ .../modelPlugFirmata.dir/CXX.includecache | 108 ++ .../modelPlugFirmata.dir/DependInfo.cmake | 26 + Source/CMakeFiles/modelPlugFirmata.dir/build.make | 140 ++ .../modelPlugFirmata.dir/cmake_clean.cmake | 11 + .../modelPlugFirmata.dir/depend.internal | 10 + Source/CMakeFiles/modelPlugFirmata.dir/depend.make | 10 + Source/CMakeFiles/modelPlugFirmata.dir/flags.make | 10 + Source/CMakeFiles/modelPlugFirmata.dir/link.txt | 1 + .../modelPlugFirmata.dir/modelPlugFirmata.cpp.o | Bin 0 -> 39400 bytes .../CMakeFiles/modelPlugFirmata.dir/progress.make | 4 + .../CMakeFiles/modelPlugFirmata.dir/serial.cpp.o | Bin 0 -> 37096 bytes Source/CMakeFiles/progress.marks | 1 + Source/CMakeLists.txt | 20 + Source/COPYING | 674 +++++++++ Source/Makefile | 208 +++ Source/Makefile~ | 208 +++ Source/README | 2 + Source/cmake_install.cmake | 44 + Source/libmodelPlugFirmata.so | Bin 0 -> 56334 bytes Source/modelPlugFirmata.cpp | 680 +++++++++ Source/modelPlugFirmata.h | 30 + Source/serial.cpp | 905 ++++++++++++ Source/serial.h | 57 + package.mo | 1475 ++++++++++++++++++++ package.order | 6 + 107 files changed, 17159 insertions(+) create mode 100644 ArduinoExamples.mo create mode 100644 Boards.mo create mode 100644 Examples.mo create mode 100644 Firmware/Arduino/pidmata3/pidmata3.ino create mode 100644 Firmware/Tiva C/StandardFirmata.zip create mode 100644 Firmware/Tiva C/StandardFirmata/Boards.h create mode 100644 Firmware/Tiva C/StandardFirmata/Firmata.cpp create mode 100644 Firmware/Tiva C/StandardFirmata/Firmata.h create mode 100644 Firmware/Tiva C/StandardFirmata/FirmataConstants.h create mode 100644 Firmware/Tiva C/StandardFirmata/FirmataDefines.h create mode 100644 Firmware/Tiva C/StandardFirmata/FirmataMarshaller.cpp create mode 100644 Firmware/Tiva C/StandardFirmata/FirmataMarshaller.h create mode 100644 Firmware/Tiva C/StandardFirmata/FirmataParser.cpp create mode 100644 Firmware/Tiva C/StandardFirmata/FirmataParser.h create mode 100644 Firmware/Tiva C/StandardFirmata/Servo.cpp create mode 100644 Firmware/Tiva C/StandardFirmata/Servo.h create mode 100644 Firmware/Tiva C/StandardFirmata/StandardFirmata.ino create mode 100644 Firmware/Tiva C/StandardFirmata/TM4C123GH6PM_PinDiagram.jpeg create mode 100644 Firmware/Tiva C/StandardFirmata/pinout_tm4c123g.txt create mode 100644 Firmware/pidmata3.ino create mode 100644 Firmware/pidmata3/pidmata3.ino create mode 100644 GettingStarted.mo create mode 100644 Internal.mo create mode 100644 Pins.mo create mode 100644 Resources/Images/Blink.png create mode 100644 Resources/Images/BlinkingLEDModel.png create mode 100644 Resources/Images/CustomExample.png create mode 100644 Resources/Images/DefaultSynchronize.png create mode 100644 Resources/Images/Dimming.png create mode 100644 Resources/Images/FirmataLocation.png create mode 100644 Resources/Images/Interval.png create mode 100644 Resources/Images/ModelPlugDocumentation-1.png create mode 100644 Resources/Images/ModelPlugDocumentation-2.png create mode 100644 Resources/Images/ModelPlugDocumentation-3.png create mode 100644 Resources/Images/ModelPlugLog-nomarkers.png create mode 100644 Resources/Images/ModelPlugLog-withmarkers.png create mode 100644 Resources/Images/PinNumber.png create mode 100644 Resources/Images/QuotedSerialPort.png create mode 100644 Resources/Images/ReadAnalog.png create mode 100644 Resources/Images/SerialPortLocation.png create mode 100644 Resources/Images/ServoExample.png create mode 100644 Resources/Images/SimpleONOFF.png create mode 100644 Resources/Images/StandardFirmata.png create mode 100644 Resources/Images/StopTime.png create mode 100644 Resources/Images/SynchronizeSetting.png create mode 100644 Resources/Images/Thumbs.db create mode 100644 Resources/Images/analogInput.png create mode 100644 Resources/Images/analogOutput.png create mode 100644 Resources/Images/arduino.png create mode 100644 Resources/Images/arduinoLeonardo.png create mode 100644 Resources/Images/custom.png create mode 100644 Resources/Images/digitalInput.png create mode 100644 Resources/Images/digitalOutput.png create mode 100644 Resources/Images/example1.png create mode 100644 Resources/Images/example2.png create mode 100644 Resources/Images/features.png create mode 100644 Resources/Images/front.png create mode 100644 Resources/Images/servo.png create mode 100644 Resources/Images/standard.png create mode 100755 Resources/Include/modelPlugFirmata.h create mode 100755 Resources/Include/modelPlugFirmata.h~ create mode 100755 Resources/Library/linux64/libmodelPlugFirmata.so create mode 100755 Source/CMakeCache.txt create mode 100755 Source/CMakeCache.txt~ create mode 100755 Source/CMakeFiles/3.5.1/CMakeCCompiler.cmake create mode 100755 Source/CMakeFiles/3.5.1/CMakeCXXCompiler.cmake create mode 100755 Source/CMakeFiles/3.5.1/CMakeDetermineCompilerABI_C.bin create mode 100755 Source/CMakeFiles/3.5.1/CMakeDetermineCompilerABI_CXX.bin create mode 100755 Source/CMakeFiles/3.5.1/CMakeSystem.cmake create mode 100755 Source/CMakeFiles/3.5.1/CompilerIdC/CMakeCCompilerId.c create mode 100755 Source/CMakeFiles/3.5.1/CompilerIdC/a.out create mode 100755 Source/CMakeFiles/3.5.1/CompilerIdCXX/CMakeCXXCompilerId.cpp create mode 100755 Source/CMakeFiles/3.5.1/CompilerIdCXX/a.out create mode 100755 Source/CMakeFiles/CMakeDirectoryInformation.cmake create mode 100755 Source/CMakeFiles/CMakeOutput.log create mode 100755 Source/CMakeFiles/Makefile.cmake create mode 100755 Source/CMakeFiles/Makefile2 create mode 100755 Source/CMakeFiles/TargetDirectories.txt create mode 100755 Source/CMakeFiles/cmake.check_cache create mode 100755 Source/CMakeFiles/feature_tests.bin create mode 100755 Source/CMakeFiles/feature_tests.c create mode 100755 Source/CMakeFiles/feature_tests.cxx create mode 100755 Source/CMakeFiles/modelPlugFirmata.dir/CXX.includecache create mode 100755 Source/CMakeFiles/modelPlugFirmata.dir/DependInfo.cmake create mode 100755 Source/CMakeFiles/modelPlugFirmata.dir/build.make create mode 100755 Source/CMakeFiles/modelPlugFirmata.dir/cmake_clean.cmake create mode 100755 Source/CMakeFiles/modelPlugFirmata.dir/depend.internal create mode 100755 Source/CMakeFiles/modelPlugFirmata.dir/depend.make create mode 100755 Source/CMakeFiles/modelPlugFirmata.dir/flags.make create mode 100755 Source/CMakeFiles/modelPlugFirmata.dir/link.txt create mode 100755 Source/CMakeFiles/modelPlugFirmata.dir/modelPlugFirmata.cpp.o create mode 100755 Source/CMakeFiles/modelPlugFirmata.dir/progress.make create mode 100755 Source/CMakeFiles/modelPlugFirmata.dir/serial.cpp.o create mode 100755 Source/CMakeFiles/progress.marks create mode 100755 Source/CMakeLists.txt create mode 100755 Source/COPYING create mode 100755 Source/Makefile create mode 100755 Source/Makefile~ create mode 100755 Source/README create mode 100755 Source/cmake_install.cmake create mode 100755 Source/libmodelPlugFirmata.so create mode 100755 Source/modelPlugFirmata.cpp create mode 100755 Source/modelPlugFirmata.h create mode 100755 Source/serial.cpp create mode 100755 Source/serial.h create mode 100644 package.mo create mode 100644 package.order diff --git a/ArduinoExamples.mo b/ArduinoExamples.mo new file mode 100644 index 0000000..fb76844 --- /dev/null +++ b/ArduinoExamples.mo @@ -0,0 +1,477 @@ + package ArduinoExamples + extends Modelica.Icons.ExamplesPackage; + + package Led + extends Modelica.Icons.ExamplesPackage; + + model ex1_led_blue + extends Modelica.Icons.Example; + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-60, 60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.DigitalOutput digitalOutput1(Pin = 9) annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, -20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Sources.BooleanConstant booleanConstant1(k = true) annotation( + Placement(visible = true, transformation(origin = {-60, -20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Boards.customBoard customBoard1(BoardName = "Arduino UNO", Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {61, -21}, extent = {{-21, -21}, {21, 21}}, rotation = 0))); + equation + connect(digitalOutput1.pinConnector, customBoard1.boardConnector) annotation( + Line(points = {{20, -20}, {60, -20}, {60, -20}, {62, -20}})); + connect(booleanConstant1.y, digitalOutput1.u) annotation( + Line(points = {{-38, -20}, {-20, -20}, {-20, -20}, {-20, -20}}, color = {255, 0, 255})); + end ex1_led_blue; + + + + model ex2_led_blue_delay + extends Modelica.Icons.Example; + OpenModelicaArduino.Boards.Arduino arduino1(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {60, -20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.DigitalOutput digitalOutput1(Pin = 9) annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, -20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1(enableRealTimeScaling = false) annotation( + Placement(visible = true, transformation(origin = {-60, 60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Sources.BooleanPulse booleanPulse1(period = 20, startTime = 5, width = 10) annotation( + Placement(visible = true, transformation(origin = {-60, -20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + equation + connect(booleanPulse1.y, digitalOutput1.u) annotation( + Line(points = {{-38, -20}, {-20, -20}, {-20, -20}, {-20, -20}}, color = {255, 0, 255})); + connect(digitalOutput1.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{20, -20}, {60, -20}, {60, -20}, {60, -20}})); + end ex2_led_blue_delay; + + model ex3_led_blue_red + extends Modelica.Icons.Example; + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-60, 60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.DigitalOutput digitalOutput1(Pin = 9) annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, 3.55271e-15}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.DigitalOutput digitalOutput2(Pin = 11) annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, -60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Sources.BooleanPulse booleanPulse1(period = 20, startTime = 5, width = 25) annotation( + Placement(visible = true, transformation(origin = {-60, 3.55271e-15}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Sources.BooleanPulse booleanPulse2(period = 20, startTime = 5, width = 40) annotation( + Placement(visible = true, transformation(origin = {-60, -60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Boards.customBoard customBoard1(BoardName = "Arduino UNO", Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {60, -20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + equation + connect(digitalOutput1.pinConnector, customBoard1.boardConnector) annotation( + Line(points = {{20, 0}, {60, 0}, {60, -20}, {60, -20}})); + connect(digitalOutput2.pinConnector, customBoard1.boardConnector) annotation( + Line(points = {{20, -60}, {60, -60}, {60, -20}, {60, -20}})); + connect(booleanPulse2.y, digitalOutput2.u) annotation( + Line(points = {{-38, -60}, {-20, -60}, {-20, -60}, {-20, -60}}, color = {255, 0, 255})); + connect(booleanPulse1.y, digitalOutput1.u) annotation( + Line(points = {{-38, 0}, {-20, 0}, {-20, 0}, {-20, 0}}, color = {255, 0, 255})); + end ex3_led_blue_red; + + model ex4_led_blink + extends Modelica.Icons.Example; + OpenModelicaArduino.Boards.Arduino arduino1(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {42, -6}, extent = {{-14, -14}, {14, 14}}, rotation = 0))); + OpenModelicaArduino.Pins.DigitalOutput digitalOutput1(Pin = 10) annotation( + Placement(visible = true, transformation(origin = {-9, -7}, extent = {{-13, -13}, {13, 13}}, rotation = 0))); + Modelica.Blocks.Sources.BooleanPulse booleanPulse1(period = 2, startTime = 4, width = 50) annotation( + Placement(visible = true, transformation(origin = {-68, -12}, extent = {{-14, -14}, {14, 14}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-19, 51}, extent = {{-13, -13}, {13, 13}}, rotation = 0))); + equation + connect(booleanPulse1.y, digitalOutput1.u) annotation( + Line(points = {{-53, -12}, {-24, -12}, {-24, -7}, {-22, -7}}, color = {255, 0, 255})); + connect(digitalOutput1.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{4, -7}, {22, -7}, {22, -6}, {42, -6}})); + annotation( + uses(OpenModelicaArduino(version = "1.2"), Modelica(version = "3.2.2"), Modelica_DeviceDrivers(version = "1.5.0"))); + end ex4_led_blink; + end Led; + + package Push_button + extends Modelica.Icons.ExamplesPackage; + + model ex1_push_button_status + extends Modelica.Icons.Example; + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-70, 70}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaArduino.Boards.Arduino arduino1(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {-60, 3.55271e-15}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.DigitalInput digitalInput1(Pin = 12) annotation( + Placement(visible = true, transformation(origin = {0, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Interaction.Show.BooleanValue booleanValue1 annotation( + Placement(visible = true, transformation(origin = {80, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + equation + connect(digitalInput1.y, booleanValue1.activePort) annotation( + Line(points = {{20, 0}, {54, 0}, {54, 0}, {58, 0}}, color = {255, 0, 255})); + connect(arduino1.boardConnector, digitalInput1.pinConnector) annotation( + Line(points = {{-60, 0}, {-20, 0}})); + Modelica.Utilities.Streams.print(String(booleanValue1.activePort)); + end ex1_push_button_status; + + model ex2_led_push_button + extends Modelica.Icons.Example; + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-60, 60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.DigitalOutput digitalOutput1(Pin = 9) annotation( + Placement(visible = true, transformation(origin = {-60, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.DigitalInput digitalInput1(Pin = 12) annotation( + Placement(visible = true, transformation(origin = {62, 3.55271e-15}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Boards.customBoard customBoard1(BoardName = "Arduino UNO", Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, 3.55271e-15}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + equation + connect(customBoard1.boardConnector, digitalInput1.pinConnector) annotation( + Line(points = {{0, 0}, {44, 0}, {44, 0}, {42, 0}})); + connect(digitalOutput1.pinConnector, customBoard1.boardConnector) annotation( + Line(points = {{-40, 0}, {0, 0}, {0, 0}, {0, 0}})); + connect(digitalInput1.y, digitalOutput1.u) annotation( + Line(points = {{82, 0}, {94, 0}, {94, -40}, {-92, -40}, {-92, 0}, {-80, 0}, {-80, 0}}, color = {255, 0, 255})); + end ex2_led_push_button; + end Push_button; + + package Ldr + extends Modelica.Icons.ExamplesPackage; + + model ex1_ldr_read + extends Modelica.Icons.Example; + OpenModelicaArduino.Boards.Arduino arduino1(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {-60, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.AnalogInput analogInput1(MaxValue = 1024, MinValue = 0, Pin = 23, adcResolution = 12) annotation( + Placement(visible = true, transformation(origin = {-4.44089e-16, 4.44089e-16}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-60, 60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Interaction.Show.RealValue realValue1(use_numberPort = true) annotation( + Placement(visible = true, transformation(origin = {60, -8.88178e-16}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + equation + connect(analogInput1.y, realValue1.numberPort) annotation( + Line(points = {{20, 0}, {37, 0}}, color = {0, 0, 127})); + connect(arduino1.boardConnector, analogInput1.pinConnector) annotation( + Line(points = {{-60, 0}, {-20, 0}, {-20, 0}, {-20, 0}})); + Modelica.Utilities.Streams.print(String(realValue1.numberPort)); + annotation( + uses(Modelica(version = "3.2.2"))); + end ex1_ldr_read; + + model ex2_ldr_led + extends Modelica.Icons.Example; + OpenModelicaArduino.Pins.DigitalOutput digitalOutput1(Pin = 9) annotation( + Placement(visible = true, transformation(origin = {-60, 20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.AnalogInput analogInput1(MaxValue = 1023, MinValue = 0, Pin = 19) annotation( + Placement(visible = true, transformation(origin = {60, 20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-70, 68}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Sources.Constant const(k = 300) annotation( + Placement(visible = true, transformation(origin = {60, -70}, extent = {{20, -20}, {-20, 20}}, rotation = 0))); + Modelica.Blocks.Logical.Less less1 annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, -40}, extent = {{20, -20}, {-20, 20}}, rotation = 0))); + OpenModelicaArduino.Boards.customBoard customBoard1(BoardName = "Arduino UNO", Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, 20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + equation + connect(customBoard1.boardConnector, analogInput1.pinConnector) annotation( + Line(points = {{0, 20}, {40, 20}, {40, 20}, {40, 20}})); + connect(digitalOutput1.pinConnector, customBoard1.boardConnector) annotation( + Line(points = {{-40, 20}, {0, 20}, {0, 20}, {0, 20}})); + connect(const.y, less1.u2) annotation( + Line(points = {{38, -70}, {32, -70}, {32, -56}, {24, -56}}, color = {0, 0, 127})); + connect(less1.y, digitalOutput1.u) annotation( + Line(points = {{-22, -40}, {-92, -40}, {-92, 20}, {-80, 20}}, color = {255, 0, 255})); + connect(analogInput1.y, less1.u1) annotation( + Line(points = {{80, 20}, {90, 20}, {90, -40}, {24, -40}}, color = {0, 0, 127})); + end ex2_ldr_led; + end Ldr; + + package DC_motor + extends Modelica.Icons.ExamplesPackage; + + model ex1_dcmotor_clock + extends Modelica.Icons.Example; + OpenModelicaArduino.Boards.Arduino arduino1(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {60, 4.21885e-15}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.AnalogOutput analogOutput1(MaxValue = 255, MinValue = 0, Pin = 9) annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, 20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.AnalogOutput analogOutput2(MaxValue = 255, MinValue = 0, Pin = 10) annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, -40}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {60, 60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Sources.Constant const(k = 0) annotation( + Placement(visible = true, transformation(origin = {-60, -40}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Sources.Pulse pulse1(amplitude = 255, period = 20, startTime = 5, width = 15) annotation( + Placement(visible = true, transformation(origin = {-60, 20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + equation + connect(analogOutput2.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{20, -40}, {60, -40}, {60, 0}, {60, 0}})); + connect(analogOutput1.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{20, 20}, {60, 20}, {60, 0}, {60, 0}, {60, 0}})); + connect(const.y, analogOutput2.u) annotation( + Line(points = {{-38, -40}, {-22, -40}, {-22, -40}, {-20, -40}}, color = {0, 0, 127})); + connect(pulse1.y, analogOutput1.u) annotation( + Line(points = {{-38, 20}, {-22, 20}, {-22, 20}, {-20, 20}}, color = {0, 0, 127})); + end ex1_dcmotor_clock; + + model ex2_dcmotor_both + extends Modelica.Icons.Example; + OpenModelicaArduino.Boards.Arduino arduino1(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {60, 4.21885e-15}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {60, 60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.DigitalOutput digitalOutput1(Pin = 8) annotation( + Placement(visible = true, transformation(origin = {1.33227e-15, 26}, extent = {{-14, -14}, {14, 14}}, rotation = 0))); + OpenModelicaArduino.Pins.DigitalOutput digitalOutput2(Pin = 9) annotation( + Placement(visible = true, transformation(origin = {4, -40}, extent = {{-14, -14}, {14, 14}}, rotation = 0))); + Modelica.Blocks.Sources.BooleanPulse booleanPulse1(period = 20) annotation( + Placement(visible = true, transformation(origin = {-65, 25}, extent = {{-13, -13}, {13, 13}}, rotation = 0))); + Modelica.Blocks.Sources.BooleanPulse booleanPulse2(period = 20, startTime = 10) annotation( + Placement(visible = true, transformation(origin = {-60, -40}, extent = {{-14, -14}, {14, 14}}, rotation = 0))); + equation + connect(booleanPulse1.y, digitalOutput1.u) annotation( + Line(points = {{-50, 26}, {-14, 26}}, color = {255, 0, 255})); + connect(digitalOutput1.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{14, 26}, {60, 26}, {60, 0}})); + connect(booleanPulse2.y, digitalOutput2.u) annotation( + Line(points = {{-44, -40}, {-10, -40}}, color = {255, 0, 255})); + connect(digitalOutput2.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{18, -40}, {60, -40}, {60, 0}})); + end ex2_dcmotor_both; + + model ex3_dcmotor_loop + extends Modelica.Icons.Example; + OpenModelicaArduino.Boards.Arduino arduino1(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {60, 4.21885e-15}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.AnalogOutput analogOutput1(MaxValue = 255, MinValue = 0, Pin = 9) annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, 18}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.AnalogOutput analogOutput2(MaxValue = 255, MinValue = 0, Pin = 10) annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, -40}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {60, 60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Sources.Pulse pulse1(amplitude = 255, period = 10, startTime = 5, width = 30) annotation( + Placement(visible = true, transformation(origin = {-60, 20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Sources.Pulse pulse2(amplitude = 255, period = 10, startTime = 10, width = 20) annotation( + Placement(visible = true, transformation(origin = {-60, -40}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + equation + connect(pulse1.y, analogOutput1.u) annotation( + Line(points = {{-38, 20}, {-20, 20}, {-20, 18}}, color = {0, 0, 127})); + connect(analogOutput1.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{20, 18}, {20, 39}, {60, 39}, {60, 0}})); + connect(pulse2.y, analogOutput2.u) annotation( + Line(points = {{-38, -40}, {-20, -40}, {-20, -40}, {-20, -40}}, color = {0, 0, 127})); + connect(analogOutput2.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{20, -40}, {60, -40}, {60, 0}, {60, 0}})); + end ex3_dcmotor_loop; + end DC_motor; + + package Potentiometer + extends Modelica.Icons.ExamplesPackage; + + model ex1_pot_threshold + extends Modelica.Icons.Example; + OpenModelicaArduino.Pins.AnalogInput analogInput1(MaxValue = 1023, MinValue = 0, Pin = 23, adcResolution = 12) annotation( + Placement(visible = true, transformation(origin = {28, 50}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaArduino.Pins.DigitalOutput digitalOutput1(Pin = 9) annotation( + Placement(visible = true, transformation(origin = {-50, 90}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {70, 70}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaArduino.Pins.DigitalOutput digitalOutput2(Pin = 10) annotation( + Placement(visible = true, transformation(origin = {-50, 50}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Logical.GreaterEqualThreshold greaterEqualThreshold1(threshold = 0) annotation( + Placement(visible = true, transformation(origin = {70, 10}, extent = {{10, -10}, {-10, 10}}, rotation = 0))); + Modelica.Blocks.Logical.GreaterEqualThreshold greaterEqualThreshold2(threshold = 320) annotation( + Placement(visible = true, transformation(origin = {70, -30}, extent = {{10, -10}, {-10, 10}}, rotation = 0))); + Modelica.Blocks.Logical.GreaterEqualThreshold greaterEqualThreshold3(threshold = 900) annotation( + Placement(visible = true, transformation(origin = {70, -70}, extent = {{10, -10}, {-10, 10}}, rotation = 0))); + Modelica.Blocks.Logical.Xor xor1 annotation( + Placement(visible = true, transformation(origin = {30, -10}, extent = {{10, -10}, {-10, 10}}, rotation = 0))); + Modelica.Blocks.Logical.Xor xor2 annotation( + Placement(visible = true, transformation(origin = {30, -50}, extent = {{10, -10}, {-10, 10}}, rotation = 0))); + OpenModelicaArduino.Pins.DigitalOutput digitalOutput3(Pin = 11) annotation( + Placement(visible = true, transformation(origin = {-50, 10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaArduino.Boards.customBoard customBoard1(BoardName = "Arduino UNO", Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {-10, 50}, extent = {{-14, -14}, {14, 14}}, rotation = 0))); + equation + connect(analogInput1.pinConnector, customBoard1.boardConnector) annotation( + Line(points = {{18, 50}, {-10, 50}})); + connect(digitalOutput1.pinConnector, customBoard1.boardConnector) annotation( + Line(points = {{-40, 90}, {-10, 90}, {-10, 50}})); + connect(digitalOutput2.pinConnector, customBoard1.boardConnector) annotation( + Line(points = {{-40, 50}, {-10, 50}})); + connect(digitalOutput3.pinConnector, customBoard1.boardConnector) annotation( + Line(points = {{-40, 10}, {-10, 10}, {-10, 50}})); + connect(xor1.y, digitalOutput3.u) annotation( + Line(points = {{20, -10}, {-72, -10}, {-72, 10}, {-60, 10}, {-60, 10}}, color = {255, 0, 255})); + connect(xor2.y, digitalOutput2.u) annotation( + Line(points = {{20, -50}, {-80, -50}, {-80, 50}, {-60, 50}, {-60, 50}}, color = {255, 0, 255})); + connect(greaterEqualThreshold3.y, digitalOutput1.u) annotation( + Line(points = {{60, -70}, {-90, -70}, {-90, 90}, {-60, 90}, {-60, 90}}, color = {255, 0, 255})); + connect(greaterEqualThreshold3.y, xor2.u2) annotation( + Line(points = {{60, -70}, {52, -70}, {52, -58}, {42, -58}, {42, -58}, {42, -58}}, color = {255, 0, 255})); + connect(greaterEqualThreshold2.y, xor2.u1) annotation( + Line(points = {{60, -30}, {52, -30}, {52, -50}, {42, -50}, {42, -50}}, color = {255, 0, 255})); + connect(greaterEqualThreshold2.y, xor1.u2) annotation( + Line(points = {{60, -30}, {52, -30}, {52, -18}, {42, -18}, {42, -18}}, color = {255, 0, 255})); + connect(greaterEqualThreshold1.y, xor1.u1) annotation( + Line(points = {{60, 10}, {50, 10}, {50, -10}, {42, -10}, {42, -10}}, color = {255, 0, 255})); + connect(analogInput1.y, greaterEqualThreshold1.u) annotation( + Line(points = {{38, 50}, {94, 50}, {94, 10}, {82, 10}, {82, 10}}, color = {0, 0, 127})); + connect(analogInput1.y, greaterEqualThreshold2.u) annotation( + Line(points = {{38, 50}, {94, 50}, {94, -30}, {82, -30}, {82, -30}, {82, -30}}, color = {0, 0, 127})); + connect(analogInput1.y, greaterEqualThreshold3.u) annotation( + Line(points = {{38, 50}, {94, 50}, {94, -70}, {82, -70}, {82, -70}}, color = {0, 0, 127})); + annotation( + uses(OpenModelicaArduino(version = "1.2"))); + end ex1_pot_threshold; + end Potentiometer; + + package Thermistor + extends Modelica.Icons.ExamplesPackage; + + model ex1_therm_read + extends Modelica.Icons.Example; + OpenModelicaArduino.Pins.AnalogInput analogInput1(MaxValue = 1023, MinValue = 0, Pin = 18) annotation( + Placement(visible = true, transformation(origin = {-4.44089e-16, 4.44089e-16}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-60, 60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Boards.customBoard customBoard1(BoardName = "Arduino UNO", Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {-59, -1}, extent = {{-21, -21}, {21, 21}}, rotation = 0))); + equation + connect(customBoard1.boardConnector, analogInput1.pinConnector) annotation( + Line(points = {{-58, 0}, {-20, 0}, {-20, 0}, {-20, 0}})); + Modelica.Utilities.Streams.print(String(analogInput1.y)); + end ex1_therm_read; + + model ex2_therm_buzzer + extends Modelica.Icons.Example; + OpenModelicaArduino.Boards.Arduino arduino1(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, 20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.DigitalOutput digitalOutput1(Pin = 3) annotation( + Placement(visible = true, transformation(origin = {-60, 20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.AnalogInput analogInput1(MaxValue = 1023, MinValue = 0, Pin = 18) annotation( + Placement(visible = true, transformation(origin = {60, 20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-70, 68}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Sources.Constant const(k = 500) annotation( + Placement(visible = true, transformation(origin = {60, -70}, extent = {{20, -20}, {-20, 20}}, rotation = 0))); + Modelica.Blocks.Logical.Greater greater1 annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, -40}, extent = {{20, -20}, {-20, 20}}, rotation = 0))); + Modelica.Blocks.Interaction.Show.RealValue realValue1 annotation( + Placement(visible = true, transformation(origin = {40, 60}, extent = {{20, -20}, {-20, 20}}, rotation = 0))); + equation + connect(analogInput1.y, realValue1.numberPort) annotation( + Line(points = {{80, 20}, {90, 20}, {90, 60}, {64, 60}, {64, 60}}, color = {0, 0, 127})); + connect(greater1.y, digitalOutput1.u) annotation( + Line(points = {{-22, -40}, {-94, -40}, {-94, 20}, {-80, 20}, {-80, 20}}, color = {255, 0, 255})); + connect(analogInput1.y, greater1.u1) annotation( + Line(points = {{80, 20}, {92, 20}, {92, -40}, {24, -40}, {24, -40}}, color = {0, 0, 127})); + connect(greater1.u2, const.y) annotation( + Line(points = {{24, -56}, {32, -56}, {32, -70}, {38, -70}, {38, -70}}, color = {0, 0, 127})); + connect(arduino1.boardConnector, analogInput1.pinConnector) annotation( + Line(points = {{0, 20}, {40, 20}})); + connect(digitalOutput1.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{-40, 20}, {0, 20}})); + Modelica.Utilities.Streams.print(String(realValue1.numberPort)); + annotation( + uses(Modelica(version = "3.2.2"))); + end ex2_therm_buzzer; + end Thermistor; + + package Servo_motor + extends Modelica.Icons.ExamplesPackage; + + model ex1_servo_init + extends Modelica.Icons.Example; + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {70, 70}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaArduino.Boards.Arduino arduino1(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {78, 20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.Servo servo1(InputUnit = OpenModelicaArduino.Internal.Types.ServoUnit.None, MaxPulse = 1000000, MinPulse = 500000, Pin = 23) annotation( + Placement(visible = true, transformation(origin = {20, 20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Sources.Constant const(k = 0.1667) annotation( + Placement(visible = true, transformation(origin = {-40, 20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + equation + connect(const.y, servo1.u) annotation( + Line(points = {{-18, 20}, {-4, 20}, {-4, 20}, {0, 20}}, color = {0, 0, 127})); + connect(servo1.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{40, 20}, {76, 20}, {76, 18}, {78, 18}, {78, 20}})); + annotation( + uses(Modelica_DeviceDrivers(version = "1.5.0"), OpenModelicaArduino(version = "1.2"), Modelica(version = "3.2.2"))); + end ex1_servo_init; + + model ex2_servo_reverse + extends Modelica.Icons.Example; + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {70, 70}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaArduino.Boards.Arduino arduino1(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {78, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.Servo servo1(InputUnit = OpenModelicaArduino.Internal.Types.ServoUnit.None, MaxPulse = 1000000, MinPulse = 500000, Pin = 3) annotation( + Placement(visible = true, transformation(origin = {20, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Sources.Pulse pulse2(amplitude = 0.5, offset = 0.5, period = 2, startTime = 6, width = 50) annotation( + Placement(visible = true, transformation(origin = {-80, -60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Math.Product product1 annotation( + Placement(visible = true, transformation(origin = {-40, 1.77636e-15}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Sources.Constant const(k = 0.5) annotation( + Placement(visible = true, transformation(origin = {-80, 60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + equation + connect(const.y, product1.u1) annotation( + Line(points = {{-58, 60}, {-36, 60}, {-36, 24}, {-80, 24}, {-80, 10}, {-64, 10}, {-64, 12}}, color = {0, 0, 127})); + connect(pulse2.y, product1.u2) annotation( + Line(points = {{-58, -60}, {-48, -60}, {-48, -24}, {-80, -24}, {-80, -12}, {-64, -12}, {-64, -12}}, color = {0, 0, 127})); + connect(product1.y, servo1.u) annotation( + Line(points = {{-18, 0}, {0, 0}, {0, 0}, {0, 0}}, color = {0, 0, 127})); + connect(servo1.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{40, 0}, {78, 0}})); + annotation( + uses(Modelica_DeviceDrivers(version = "1.5.0"), OpenModelicaArduino(version = "1.2"), Modelica(version = "3.2.2"))); + end ex2_servo_reverse; + + model ex3_servo_loop + extends Modelica.Icons.Example; + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {70, 70}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaArduino.Boards.Arduino arduino1(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {78, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.Servo servo1(InputUnit = OpenModelicaArduino.Internal.Types.ServoUnit.None, MaxPulse = 1000000, MinPulse = 500000, Pin = 23) annotation( + Placement(visible = true, transformation(origin = {20, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Sources.Ramp ramp1(duration = 10, height = 10, startTime = 5) annotation( + Placement(visible = true, transformation(origin = {-90, -70}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Math.RealToInteger realToInteger1 annotation( + Placement(visible = true, transformation(origin = {-50, -70}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Sources.Constant const(k = 0.11) annotation( + Placement(visible = true, transformation(origin = {-70, 68}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Math.Product product1 annotation( + Placement(visible = true, transformation(origin = {-28, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Math.IntegerToReal integerToReal1 annotation( + Placement(visible = true, transformation(origin = {-10, -70}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + equation + connect(integerToReal1.y, product1.u2) annotation( + Line(points = {{2, -70}, {14, -70}, {14, -36}, {-56, -36}, {-56, -6}, {-40, -6}, {-40, -6}}, color = {0, 0, 127})); + connect(realToInteger1.y, integerToReal1.u) annotation( + Line(points = {{-38, -70}, {-22, -70}, {-22, -70}, {-22, -70}}, color = {255, 127, 0})); + connect(ramp1.y, realToInteger1.u) annotation( + Line(points = {{-78, -70}, {-62, -70}}, color = {0, 0, 127})); + connect(const.y, product1.u1) annotation( + Line(points = {{-58, 68}, {-52, 68}, {-52, 6}, {-40, 6}, {-40, 6}}, color = {0, 0, 127})); + connect(product1.y, servo1.u) annotation( + Line(points = {{-16, 0}, {0, 0}, {0, 0}, {0, 0}}, color = {0, 0, 127})); + connect(servo1.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{40, 0}, {78, 0}})); + annotation( + uses(Modelica_DeviceDrivers(version = "1.5.0"), OpenModelicaArduino(version = "1.2"), Modelica(version = "3.2.2"))); + end ex3_servo_loop; + + model ex4_servo_pot + extends Modelica.Icons.Example; + OpenModelicaArduino.Boards.Arduino arduino1(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {60, 3.10862e-15}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.Servo servo1(InputUnit = OpenModelicaArduino.Internal.Types.ServoUnit.None, MaxPulse = 1000000, MinPulse = 500000, Pin = 9) annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, 3.55271e-15}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.AnalogInput analogInput1(MaxValue = 1, MinValue = 0, Pin = 16) annotation( + Placement(visible = true, transformation(origin = {-60, 3.55271e-15}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-60, 60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + equation + connect(analogInput1.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{-80, 0}, {-92, 0}, {-92, -52}, {60, -52}, {60, 0}, {60, 0}})); + connect(servo1.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{20, 0}, {62, 0}, {62, 0}, {60, 0}, {60, 0}})); + connect(analogInput1.y, servo1.u) annotation( + Line(points = {{-40, 0}, {-16, 0}, {-16, 0}, {-20, 0}}, color = {0, 0, 127})); + annotation( + uses(OpenModelicaArduino(version = "1.2"), Modelica_DeviceDrivers(version = "1.5.0"))); + end ex4_servo_pot; + end Servo_motor; + end ArduinoExamples; \ No newline at end of file diff --git a/Boards.mo b/Boards.mo new file mode 100644 index 0000000..7a8a579 --- /dev/null +++ b/Boards.mo @@ -0,0 +1,1464 @@ +package OpenModelicaEmbedded "Connecting OpenModelica with Arduino" + package GettingStarted "Procedure to run first model using OpenModelicaArduino" + extends Modelica.Icons.Information; + annotation( + preferredView = "info", + Documentation(info = "
.
+.
+The first thing you need to do is upload the Firmware code to your board .
+ +Figure 1. Location of the Firmware sketch.
+If you wish to use PID(Proportional-integral-derivative) then use another firmware provided with the package. To open an firmware through Arduino IDE click on “Open“ and Browse to the location where you extracted the package. Insdie the package folder look for folder named “Firmware“ which contains a file named “pidmata3.ino“. Select that file and click open to load firmware in Arduino IDE.
+ Important instructions for using above mentioned firmware “pidmata3.ino“:
+
Once the the Firmware code is in the board, you need to write down the serial port that it is using. This is important because you need to give the port name to OpenModelicaArduino in order to communicate with the board. You can find the serial port in Tools->Serial Port or in the bottom-right corner of the Arduino software window (see Figure 2). In Windows the serial port name is something like “COM5”, while in OS X and Linux the name will be something like “/dev/ttyACM0”. Now you are ready to make your first model.
+ +Figure 2. Finding the serial port being used.
+As a first exercise, you are going to reproduce with OpenModelicaArduino the blinking LED example. You can either open the prebuilt example (OpenModelicaArduino.Examples.BlinkLed) or build it by yourself. To build the model, locate the components:
+Connect the components as in Figure 3. One thing to notice is that the DigitalOutput model is connected to the Arduino component to specify that the pin belongs to that board. This connection is necessary because OpenModelicaArduino can use multiple boards with multiple pins at the same time.
+ +Figure 3. Diagram of the blinking LED.
+Next you need to specify the serial port that the board is using. This is done by selecting the Arduino component and showing its parameters. In the parameter view, you can find the Port parameter. Write the port name that you got in the section “Preparing your board”. Important: the name must be have quotation marks as shown in Figure 4.
+ +Figure 4. Specifying the serial port name.
+Now you need to set the pin number that you are going to use in the DigitalOutput component. Usually, the Arduino boards have an LED attached to pin 13. Set that number in the Pin parameter as shown in Figure 5.
+ +Figure 5. Specifying the pin to use.
+For the BooleanPulse component, set the 'period' parameter to 1. The model is ready to simulate. Press the simulate button and wait to see the results.
+The first time you run the model, it is probably simulated so fast that you do not have time to react. The reason is that OpenModelica simulates the model as fast as possible. In order to interact with your models using OpenModelicaArduino, it is necessary to synchronize the simulation time with real time. This is done in by using Synchronisation block in ModelicaDeviceDriver library. After simulating the model one time, you need to check in the checkbox “Synchronize with real-time” as shown in Figure 6.
+ //+ //
Figure 6. Synchronizing your simulation with real time.
+ //If you are building many models with the OpenModelicaArduino library, you should set the “Synchronize with real-time” option as a default simulation setting in SimulationCenter under the menu Tools->Options in the section SimulationCenter->Default Experiment (see Figure 7).
+ //+ //
Figure 7. Setting \"Synchronize with real-time\" as default.
+ //Now run the simulation again and you should see the LED blinking until the simulation reaches the stop time. If you want to keep the simulation running continuously, you need to change the stop time to “infinite” as shown in Figure 8.
+ // + //Figure 8. Setting the stop time to infinite.
+ //If you run the simulation again, you should see the LED blinking continuously.
+One thing that you may have noticed is that OpenModelicaArduino prints status messages in the simulation log (see Figure 9). The first thing it prints is a list of the available ports. In that list, you should see your current port (A). After that, it prints the current port and the speed used (B). Once the port is opened, you receive a notification that the board is initialized (C). Usually the boards report the version of Firmata that you are running. Then you set the sampling interval that the board uses (D). In this example, you can see that you are setting pin 13 to be an output because you have used the DigitalOutput component (E). Finally you will see that the board will send you a list of all the pins available and thier capabilities (F). This list contains the number of the pin and the modes in which it can be used, for example: DigitalInput, DigitalOutput, AnalogInput, AnalogOutput, and Servo.
+ +Figure 9. Messages shown by OpenModelicaArduino.
+This is a checklist that you can follow in order to solve most of the problems that can occur when using the ModelPlug library:
+If you are still having problems, you can go to http://community.wolfram.com and ask a question.
+OpenModelicaArduino contains a series of basic examples showing the functionality of the components. You can check the Examples under ModelPlug.Examples. Once you have learned how to use the basic components of OpenModelicaArduino, you can check the Arduino Playground to learn how to connect other sensors and actuators (http://playground.arduino.cc).
", revisions = ""), + Diagram(coordinateSystem(extent = {{-148.5, -105}, {148.5, 105}}, preserveAspectRatio = true, initialScale = 0.1, grid = {5, 5}))); + end GettingStarted; + + package Pins "Components to access the board I/O" + extends Internal.Icons.Block; + + model AnalogInput "Reads an analog signal from the specified pin" + extends OpenModelicaArduino.Internal.Icons.Block; + Modelica.Blocks.Interfaces.RealOutput y annotation( + Placement(visible = true, transformation(origin = {110, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {100, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + parameter Integer Pin = 0 "Number of the analog pin"; + OpenModelicaArduino.Internal.Interfaces.PinConnector pinConnector annotation( + Placement(visible = true, transformation(origin = {-100, -0}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-100, -0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + parameter Real InitValue = 0 "Initial value until the board responds" annotation( + Dialog(group = "Initialization")); + parameter Real MinValue = 0 "Minimum value of ADC" annotation( + Dialog(group = "Scaling")); + parameter Real MaxValue = 1 "Maximum value of ADC" annotation( + Dialog(group = "Scaling")); + parameter Integer adcResolution = 10 "Resolution of the ADC in your microcontroller" annotation( + Dialog(group = "Scaling")); + equation + y = OpenModelicaArduino.Internal.ExternalFunctions.readAnalogPin(Pin, MinValue, MaxValue, InitValue, pinConnector, adcResolution); + annotation( + Documentation(info = "Reads an analog signal from the specified pin. This component uses the 'analogRead' function of Arduino.
+Signal Range: By default, the signal goes from 0 to 1 where 0 represents no voltage and 1 the voltage reference of the ADC in the board. This signal can be scaled by setting the 'MinValue' and 'MaxValue' parameters.
+Not all pins support analog input. Check the documentation of your board to find the pin capabilities.
+", revisions = ""), + Icon(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -85}, {100, 85}}, radius = 40), Rectangle(fillColor = {243, 134, 48}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-90, -60}, {90, 60}}, radius = 40), Text(origin = {0, -130}, extent = {{-100, -20}, {100, 20}}, textString = "Pin %Pin"), Text(origin = {0, 10}, extent = {{-75, -15}, {75, 25}}, textString = "Analog", textStyle = {TextStyle.Bold}), Text(origin = {0, -20}, extent = {{-75, -15}, {75, 25}}, textString = "Input", textStyle = {TextStyle.Bold})}), + Diagram(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -75}, {100, 75}}, radius = 40), Rectangle(fillColor = {243, 134, 48}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-90, -50}, {90, 50}}, radius = 40), Text(origin = {0, 20}, extent = {{-75, -15}, {75, 25}}, textString = "Analog", textStyle = {TextStyle.Bold}), Text(origin = {0, -20}, extent = {{-75, -15}, {75, 25}}, textString = "Input", textStyle = {TextStyle.Bold})})); + end AnalogInput; + + model AnalogOutput "Writes an analog signal to the specified pin" + extends OpenModelicaArduino.Internal.Icons.Block; + Modelica.Blocks.Interfaces.RealInput u annotation( + Placement(visible = true, transformation(origin = {-110, -0}, extent = {{-25, -25}, {25, 25}}, rotation = 0), iconTransformation(origin = {-100, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + parameter Integer Pin = 0 "Number of the PWM/DAC pin"; + OpenModelicaArduino.Internal.Interfaces.PinConnector pinConnector annotation( + Placement(visible = true, transformation(origin = {100, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {100, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + parameter Real MinValue = 0 "Value considered as minimum by the PWM/DAC" annotation( + Dialog(group = "Scaling")); + parameter Real MaxValue = 1 "Value considered as maximum by the PWM/DAC" annotation( + Dialog(group = "Scaling")); + protected + Real scaled_u = (u - MinValue) / (MaxValue - MinValue); + equation + OpenModelicaArduino.Internal.ExternalFunctions.writeAnalogPin(Pin, pinConnector, scaled_u); + annotation( + Documentation(info = "
Writes an analog signal to the specified pin. This component uses the 'analogWrite' function of Arduino.
+Signal Range: By default, the signal goes from 0 to 1, where 0 represents no voltage and 1 the maximum voltage that PWM/DAC of your board can provide. This signal can be scaled by setting the 'MinValue' and 'MaxValue' parameters.
+Analog outputs use the PWM capabilities of the pins, therefore, they do not provide a continuous signal. If you want to get a continuous signal, you need to add a lowpass filter. Check the Arduino Playground (http://playground.arduino.cc) for more information on PWM.
+Not all pins support analog output. Check the documentation of your board to find the pin capabilities.
+", revisions = ""), + Icon(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -85}, {100, 85}}, radius = 40), Rectangle(fillColor = {243, 134, 48}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-90, -60}, {90, 60}}, radius = 40), Text(origin = {0, -130}, extent = {{-100, -20}, {100, 20}}, textString = "Pin %Pin"), Text(origin = {0, 10}, extent = {{-75, -15}, {75, 25}}, textString = "Analog", textStyle = {TextStyle.Bold}), Text(origin = {0, -20}, extent = {{-75, -15}, {75, 25}}, textString = "Output", textStyle = {TextStyle.Bold})}), + Diagram(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -75}, {100, 75}}, radius = 40), Rectangle(fillColor = {243, 134, 48}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-90, -50}, {90, 50}}, radius = 40), Text(origin = {0, 20}, extent = {{-75, -15}, {75, 25}}, textString = "Analog", textStyle = {TextStyle.Bold}), Text(origin = {0, -20}, extent = {{-75, -15}, {75, 25}}, textString = "Output", textStyle = {TextStyle.Bold})})); + end AnalogOutput; + + model DigitalInput "Reads a digital signal from the specified pin" + extends OpenModelicaArduino.Internal.Icons.Block; + Modelica.Blocks.Interfaces.BooleanOutput y annotation( + Placement(visible = true, transformation(origin = {110, 1.643}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {101.75, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + parameter Integer Pin = 0 "Number of the digital pin"; + parameter Boolean InitValue = false "Initial value until the board responds" annotation( + Dialog(group = "Initialization")); + OpenModelicaArduino.Internal.Interfaces.PinConnector pinConnector annotation( + Placement(visible = true, transformation(origin = {-100, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-100, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + equation + y = OpenModelicaArduino.Internal.ExternalFunctions.readDigitalPin(Pin, InitValue, pinConnector); + annotation( + Documentation(info = "
Reads a digital signal from the specified pin. This component uses the 'digitalRead' function of Arduino.
+Signal Range: This component accepts only Boolean signals (true/false).
", revisions = ""), + Icon(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -85}, {100, 85}}, radius = 40), Rectangle(fillColor = {0, 170, 255}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-90, -60}, {90, 60}}, radius = 40), Text(origin = {0, -130}, extent = {{-100, -20}, {100, 20}}, textString = "Pin %Pin"), Text(origin = {0, 10}, extent = {{-75, -15}, {75, 25}}, textString = "Digital", textStyle = {TextStyle.Bold}), Text(origin = {0, -20}, extent = {{-75, -15}, {75, 25}}, textString = "Input", textStyle = {TextStyle.Bold})}), + Diagram(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -75}, {100, 75}}, radius = 40), Rectangle(fillColor = {0, 170, 255}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-90, -50}, {90, 50}}, radius = 40), Text(origin = {0, 20}, extent = {{-75, -15}, {75, 25}}, textString = "Digital", textStyle = {TextStyle.Bold}), Text(origin = {0, -20}, extent = {{-75, -15}, {75, 25}}, textString = "Input", textStyle = {TextStyle.Bold})})); + end DigitalInput; + + model DigitalOutput "Writes a digital signal to the specified pin" + extends OpenModelicaArduino.Internal.Icons.Block; + Modelica.Blocks.Interfaces.BooleanInput u annotation( + Placement(visible = true, transformation(origin = {-110, -0}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-100, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + parameter Integer Pin = 0 "Number of the digital pin"; + OpenModelicaArduino.Internal.Interfaces.PinConnector pinConnector annotation( + Placement(visible = true, transformation(origin = {100, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {100, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + equation + OpenModelicaArduino.Internal.ExternalFunctions.writeDigitalPin(Pin, pinConnector, u); + annotation( + Documentation(info = "Writes a digital signal to the specified pin. This component uses the 'digitalWrite' function of Arduino.
+Signal Range: This component accepts only Boolean signals (true/false).
", revisions = ""), + Icon(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -85}, {100, 85}}, radius = 40), Rectangle(fillColor = {0, 170, 255}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-90, -60}, {90, 60}}, radius = 40), Text(origin = {0, -130}, extent = {{-100, -20}, {100, 20}}, textString = "Pin %Pin"), Text(origin = {0, 10}, extent = {{-75, -15}, {75, 25}}, textString = "Digital", textStyle = {TextStyle.Bold}), Text(origin = {0, -20}, extent = {{-75, -15}, {75, 25}}, textString = "Output", textStyle = {TextStyle.Bold})}), + Diagram(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -75}, {100, 75}}, radius = 40), Rectangle(fillColor = {0, 170, 255}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-90, -50}, {90, 50}}, radius = 40), Text(origin = {0, 20}, extent = {{-75, -15}, {75, 25}}, textString = "Digital", textStyle = {TextStyle.Bold}), Text(origin = {0, -20}, extent = {{-75, -15}, {75, 25}}, textString = "Input", textStyle = {TextStyle.Bold})})); + end DigitalOutput; + + model Servo "Controls a servo motor attached to the specified pin" + extends OpenModelicaArduino.Internal.Icons.Block; + Modelica.Blocks.Interfaces.RealInput u annotation( + Placement(visible = true, transformation(origin = {-110, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-100, -0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Internal.Interfaces.PinConnector pinConnector annotation( + Placement(visible = true, transformation(origin = {100, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {100, -0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + parameter Integer Pin = 0 "Pin number of the servo"; + parameter OpenModelicaArduino.Internal.Types.ServoUnit InputUnit "if None (Default) the servo receives a signal between 0 and 1. If Degrees the control signal is from 0 to 180. If Radians the signal is from 0 to Pi."; + parameter Integer MinPulse = 544 "The pulse width, in microseconds, corresponding to the minimum (0-degree) angle on the servo. + (Ignore this parameter if using Tiva C board)" annotation( + Dialog(group = "Advanced")); + parameter Integer MaxPulse = 2400 "The pulse width, in microseconds, corresponding to the maximum (180-degree) angle on the servo. + (Ignore this parameter if using Tiva C board)" annotation( + Dialog(group = "Advanced")); + Real outputSignal; + equation + outputSignal = if InputUnit == OpenModelicaArduino.Internal.Types.ServoUnit.None then u else if InputUnit == OpenModelicaArduino.Internal.Types.ServoUnit.Degrees then u / 180 else if InputUnit == OpenModelicaArduino.Internal.Types.ServoUnit.Radians then u / Modelica.Constants.pi else u; + OpenModelicaArduino.Internal.ExternalFunctions.writeServoPin(Pin, pinConnector, u, MinPulse, MaxPulse); + annotation( + Documentation(info = "Controls a servo motor attached to the specified pin. This component uses the 'Servo' library of Arduino.
+Signal Range: By default, the range goes from 0 to 1, which corresponds to 0 to 180 degrees. If you want to input values in radians, you can change the parameter 'InputUnit' from 'Degrees' to 'Radians'.
+If your servo does not work correctly with the default settings, you can set the parameters 'MinPulse' and 'MaxPulse'. To get more information on how to configure a servo, you can check the documentation of the Servo library, http://arduino.cc/en/reference/servo.
", revisions = ""), + Icon(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -85}, {100, 85}}, radius = 40), Rectangle(fillColor = {0, 255, 127}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-90, -60}, {90, 60}}, radius = 40), Text(origin = {0, -130}, extent = {{-100, -20}, {100, 20}}, textString = "Pin %Pin"), Text(extent = {{-75, -25}, {75, 25}}, textString = "Servo", textStyle = {TextStyle.Bold})}), + Diagram(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -75}, {100, 75}}, radius = 40), Rectangle(fillColor = {0, 255, 127}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-90, -50}, {90, 50}}, radius = 40), Text(extent = {{-75, -25}, {75, 25}}, textString = "Servo", textStyle = {TextStyle.Bold})})); + end Servo; + annotation( + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(visible = true, origin = {-30, 30}, fillColor = {250, 105, 0}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-25, -25}, {25, 25}}, radius = 50), Rectangle(visible = true, origin = {30, 30}, fillColor = {243, 134, 48}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-25, -25}, {25, 25}}, radius = 50), Rectangle(visible = true, origin = {-30, -30}, fillColor = {167, 219, 216}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-25, -25}, {25, 25}}, radius = 50), Rectangle(visible = true, origin = {30, -30}, fillColor = {105, 210, 231}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-25, -25}, {25, 25}}, radius = 50)}), + Diagram(coordinateSystem(extent = {{-148.5, -105}, {148.5, 105}}, preserveAspectRatio = true, initialScale = 0.1, grid = {5, 5}))); + end Pins; + + package Boards "Components to connect to the Firmata boards" + model Arduino "Component with default configuration for Arduino boards" + parameter Internal.Types.SerialPort Port = "COM1" "Name of the serial port"; + parameter Boolean ShowPinCapabilities = true "Set to true if you want to see the capabilities of the pins in your board"; + parameter Boolean UseDTR = false "Some boards like Arduino Leonardo require UseDTR=true"; + OpenModelicaArduino.Internal.ExternalFunctions.FirmataBoardObject board = Internal.ExternalFunctions.FirmataBoardObject.constructor(Port, ShowPinCapabilities, integer(UpdatePeriod * 1000), BaudRate, UseDTR); + OpenModelicaArduino.Internal.Interfaces.BoardConnector boardConnector annotation( + Placement(visible = true, transformation(origin = {-90, -12.256}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {0, 0}, extent = {{-100, -100}, {100, 100}}, rotation = 0))); + protected + discrete Integer BoardId(start = -1) "Board Identifier. Initialized automatically keep as -1."; + constant Modelica.SIunits.Time UpdatePeriod = 0.01 "Sampling interval. The standard Firmata has a maximum samplig period of 10 ms (0.01 s)"; + constant Integer BaudRate = 57600 "Baud rate used to comunicate with the board"; + equation + when initial() then + BoardId = Internal.ExternalFunctions.getBoardId(board); + end when; + when sample(0, UpdatePeriod) then + OpenModelicaArduino.Internal.ExternalFunctions.updateBoard(BoardId); + end when; + boardConnector = BoardId; + annotation( + Documentation(info = "This component provides a ready-to-use configuration for the Arduino board. This component has been tested with Arduino Uno, Arduino Mega 2560, and Arduino Mini, but it should work with any Arduino board.
+When running the simulation, you will get a list of the capabilities of every pin. If you want to stop showing the capabilities every time you simulate, you need to set the property 'ShowCapabilities' to false. If you are not sure about the location of a specific pin in your board, you should check the documentation for your board.
", revisions = ""), + Icon(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Polygon(origin = {10.562, 9.352}, fillColor = {42, 85, 94}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-85.751, 70.648}, {-102.737, 66.761}, {-105.751, 50.648}, {-105.751, -69.352}, {-99.475, -85.465}, {-85.751, -89.352}, {74.249, -89.352}, {81.746, -83.29}, {84.249, -76.041}, {84.249, 34.141}, {79.249, 43.202}, {54.249, 43.202}, {52.314, 67.486}, {31.729, 70.648}, {-85.751, 70.648}}, smooth = Smooth.Bezier), Rectangle(origin = {-71.211, 40}, fillColor = {106, 108, 116}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-32.24, -20}, {32.24, 20}}, radius = 10), Rectangle(origin = {-79.366, -45.041}, fillPattern = FillPattern.Solid, extent = {{-25.915, -15.041}, {25.915, 15.041}}, radius = 10), Text(origin = {0, -130}, extent = {{-100, -20}, {100, 20}}, textString = "%Port"), Text(origin = {5, -30}, lineColor = {255, 255, 255}, extent = {{-75, 30}, {75, -30}}, textString = "Arduino")}), + Diagram(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Polygon(origin = {10.562, 9.352}, fillColor = {42, 85, 94}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-85.751, 70.648}, {-102.737, 66.761}, {-105.751, 50.648}, {-105.751, -69.352}, {-99.475, -85.465}, {-85.751, -89.352}, {74.249, -89.352}, {81.746, -83.29}, {84.249, -76.041}, {84.249, 34.141}, {79.249, 43.202}, {54.249, 43.202}, {52.314, 67.486}, {31.729, 70.648}, {-85.751, 70.648}}, smooth = Smooth.Bezier), Rectangle(origin = {-71.211, 40}, fillColor = {106, 108, 116}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-32.24, -20}, {32.24, 20}}, radius = 10), Rectangle(origin = {-79.366, -45.041}, fillPattern = FillPattern.Solid, extent = {{-25.915, -15.041}, {25.915, 15.041}}, radius = 10), Ellipse(origin = {-8.451, 32.225}, lineColor = {255, 255, 255}, fillColor = {42, 85, 94}, fillPattern = FillPattern.Solid, lineThickness = 5, extent = {{-15, -12.225}, {15, 12.225}}, endAngle = 360), Ellipse(origin = {21.55, 32.22}, lineColor = {255, 255, 255}, fillColor = {42, 85, 94}, fillPattern = FillPattern.Solid, lineThickness = 5, extent = {{-15, -12.23}, {15, 12.23}}, endAngle = 360), Text(origin = {-5, -15}, lineColor = {255, 255, 255}, extent = {{-75, 25}, {95, -35}}, textString = "Arduino", textStyle = {TextStyle.Bold})})); + end Arduino; + + model StandardFirmata "Component with default configuration for any board with the standard Firmata" + parameter Internal.Types.SerialPort Port = "COM1" "Name of the serial port"; + parameter Boolean ShowPinCapabilities = true "Set to true if you want to see the capabilities of the pins in your board"; + parameter Boolean UseDTR = false "Set to true if your board requires DTR"; + OpenModelicaArduino.Internal.Interfaces.BoardConnector boardConnector annotation( + Placement(visible = true, transformation(origin = {-90, -14.401}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {0, 0}, extent = {{-100, -100}, {100, 100}}, rotation = 0))); + OpenModelicaArduino.Internal.ExternalFunctions.FirmataBoardObject board = Internal.ExternalFunctions.FirmataBoardObject.constructor(Port, ShowPinCapabilities, integer(UpdatePeriod * 1000), BaudRate, UseDTR); + protected + discrete Integer BoardId(start = -1) "Board Identifier. Initialized automatically keep as -1."; + constant Modelica.SIunits.Time UpdatePeriod = 0.01 "Sampling interval. The standard Firmata has a maximum samplig period of 10 ms (0.01 s)"; + constant Integer BaudRate = 57600 "Baud rate used to comunicate with the board"; + equation + when initial() then + BoardId = Internal.ExternalFunctions.getBoardId(board); + end when; + when sample(0, UpdatePeriod) then + OpenModelicaArduino.Internal.ExternalFunctions.updateBoard(BoardId); + end when; + boardConnector = BoardId; + annotation( + Documentation(info = "This component provides a ready-to-use configuration for boards flashed with the StandardFirmata. This component has been tested with chipKIT UNO and Teensy 3.1, but it should work with any board supporting the StandardFirmata.
+When running the simulation, you will get a list of the capabilities of every pin. If you want to stop showing the capabilities every time you simulate, you need to set the property 'ShowCapabilities' to False. If you are not sure about the location of an specific pin in your board, you should check the documentation for your board.
+", revisions = ""), + Icon(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Polygon(origin = {10.56, 9.35}, fillColor = {0, 170, 0}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-85.751, 70.648}, {-102.737, 66.761}, {-105.751, 50.648}, {-105.751, -69.352}, {-99.475, -85.465}, {-85.751, -89.352}, {74.249, -89.352}, {81.746, -83.29}, {84.249, -76.041}, {84.249, 34.141}, {79.249, 43.202}, {54.249, 43.202}, {52.314, 67.486}, {31.729, 70.648}, {-85.751, 70.648}}, smooth = Smooth.Bezier), Rectangle(origin = {-71.211, 40}, fillColor = {106, 108, 116}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-32.24, -20}, {32.24, 20}}, radius = 10), Rectangle(origin = {-79.366, -45.041}, fillPattern = FillPattern.Solid, extent = {{-25.915, -15.041}, {25.915, 15.041}}, radius = 10), Text(origin = {0, -130}, extent = {{-100, -20}, {100, 20}}, textString = "%Port"), Text(origin = {5, -10}, lineColor = {255, 255, 255}, extent = {{-75, 30}, {75, -30}}, textString = "Standard")}), + Diagram(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Polygon(origin = {10.56, 9.35}, fillColor = {0, 170, 0}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-85.751, 70.648}, {-102.737, 66.761}, {-105.751, 50.648}, {-105.751, -69.352}, {-99.475, -85.465}, {-85.751, -89.352}, {74.249, -89.352}, {81.746, -83.29}, {84.249, -76.041}, {84.249, 34.141}, {79.249, 43.202}, {54.249, 43.202}, {52.314, 67.486}, {31.729, 70.648}, {-85.751, 70.648}}, smooth = Smooth.Bezier), Rectangle(origin = {-71.211, 40}, fillColor = {106, 108, 116}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-32.24, -20}, {32.24, 20}}, radius = 10), Rectangle(origin = {-79.366, -45.041}, fillPattern = FillPattern.Solid, extent = {{-25.915, -15.041}, {25.915, 15.041}}, radius = 10), Text(origin = {-5, -15}, lineColor = {255, 255, 255}, extent = {{-75, 25}, {95, -35}}, textString = "Standard", textStyle = {TextStyle.Bold})})); + end StandardFirmata; + + model CustomFirmata "Component that allows custom configuration of the Firmata" + parameter Internal.Types.SerialPort Port = "COM1" "Name of the serial port"; + parameter Boolean ShowPinCapabilities = true "Set to true if you want to see the capabilities of the pins in your board"; + parameter Boolean UseDTR = false "Some boards like Arduino Leonardo require UseDTR=true"; + OpenModelicaArduino.Internal.Interfaces.BoardConnector boardConnector annotation( + Placement(visible = true, transformation(origin = {-90, -14.401}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {0, 0}, extent = {{-100, -100}, {100, 100}}, rotation = 0))); + OpenModelicaArduino.Internal.ExternalFunctions.FirmataBoardObject board = Internal.ExternalFunctions.FirmataBoardObject.constructor(Port, ShowPinCapabilities, integer(UpdatePeriod * 1000), BaudRate, UseDTR); + parameter Modelica.SIunits.Time UpdatePeriod = 0.01 "Sampling interval. The standard Firmata has a maximum samplig period of 10 ms (0.01 s)"; + parameter Integer BaudRate = 57600 "Baud rate used to communicate with the board"; + protected + discrete Integer BoardId(start = -1) "Board Identifier. Initialized automatically keep as -1."; + equation + when initial() then + BoardId = Internal.ExternalFunctions.getBoardId(board); + end when; + when sample(0, UpdatePeriod) then + OpenModelicaArduino.Internal.ExternalFunctions.updateBoard(BoardId); + end when; + boardConnector = BoardId; + annotation( + Documentation(info = "
This component is for advanced users who can modify the Firmata source code or have a non-Arduino board running Firmata. This component allows you to specify your preferred baud rate and sampling interval.
+The baud rate is specified with the 'BaudRate' property. You have to consider that standard serial ports do not support arbitrary baud rates.
+When setting the 'UpdatePeriod' property, it is necessary to change the \"Interval length\" in the simulation settings, to match the update period.
", revisions = ""), + Icon(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Polygon(origin = {10.56, 9.35}, fillColor = {170, 0, 127}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-85.751, 70.648}, {-102.737, 66.761}, {-105.751, 50.648}, {-105.751, -69.352}, {-99.475, -85.465}, {-85.751, -89.352}, {74.249, -89.352}, {81.746, -83.29}, {84.249, -76.041}, {84.249, 34.141}, {79.249, 43.202}, {54.249, 43.202}, {52.314, 67.486}, {31.729, 70.648}, {-85.751, 70.648}}, smooth = Smooth.Bezier), Rectangle(origin = {-71.211, 40}, fillColor = {106, 108, 116}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-32.24, -20}, {32.24, 20}}, radius = 10), Rectangle(origin = {-79.366, -45.041}, fillPattern = FillPattern.Solid, extent = {{-25.915, -15.041}, {25.915, 15.041}}, radius = 10), Text(origin = {0, -130}, extent = {{-100, -20}, {100, 20}}, textString = "%Port"), Text(origin = {5, -10}, lineColor = {255, 255, 255}, extent = {{-75, 30}, {75, -30}}, textString = "Custom")}), + Diagram(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Polygon(origin = {10.56, 9.35}, fillColor = {170, 0, 127}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-85.751, 70.648}, {-102.737, 66.761}, {-105.751, 50.648}, {-105.751, -69.352}, {-99.475, -85.465}, {-85.751, -89.352}, {74.249, -89.352}, {81.746, -83.29}, {84.249, -76.041}, {84.249, 34.141}, {79.249, 43.202}, {54.249, 43.202}, {52.314, 67.486}, {31.729, 70.648}, {-85.751, 70.648}}, smooth = Smooth.Bezier), Rectangle(origin = {-71.211, 40}, fillColor = {106, 108, 116}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-32.24, -20}, {32.24, 20}}, radius = 10), Rectangle(origin = {-79.366, -45.041}, fillPattern = FillPattern.Solid, extent = {{-25.915, -15.041}, {25.915, 15.041}}, radius = 10), Text(origin = {-5, -15}, lineColor = {255, 255, 255}, extent = {{-75, 25}, {95, -35}}, textString = "Custom", textStyle = {TextStyle.Bold})})); + end CustomFirmata; + + model ArduinoLeonardo "Component with configuration for Arduino Leonardo boards" + parameter Internal.Types.SerialPort Port = "COM1" "Name of the serial port"; + parameter Boolean ShowPinCapabilities = true "Set to true if you want to see the capabilities of the pins in your board"; + parameter Boolean UseDTR = true "Some boards like Arduino Leonardo require UseDTR=true"; + OpenModelicaArduino.Internal.ExternalFunctions.FirmataBoardObject board = Internal.ExternalFunctions.FirmataBoardObject.constructor(Port, ShowPinCapabilities, integer(UpdatePeriod * 1000), BaudRate, UseDTR); + OpenModelicaArduino.Internal.Interfaces.BoardConnector boardConnector annotation( + Placement(visible = true, transformation(origin = {-90, -12.256}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {0, 0}, extent = {{-100, -100}, {100, 100}}, rotation = 0))); + protected + discrete Integer BoardId(start = -1) "Board Identifier. Initialized automatically keep as -1."; + constant Modelica.SIunits.Time UpdatePeriod = 0.01 "Sampling interval. The standard Firmata has a maximum samplig period of 10 ms (0.01 s)"; + constant Integer BaudRate = 57600 "Baud rate used to comunicate with the board"; + equation + when initial() then + BoardId = Internal.ExternalFunctions.getBoardId(board); + end when; + when sample(0, UpdatePeriod) then + OpenModelicaArduino.Internal.ExternalFunctions.updateBoard(BoardId); + end when; + boardConnector = BoardId; + annotation( + Documentation(info = "This component provides a ready-to-use configuration for the Arduino Leonardo board. This component works for any board using native USB communication, like the Arduino Esplora.
+When running the simulation, you will get a list of the capabilities of every pin. If you want to stop showing the capabilities every time you simulate, you need to set the property "ShowCapabilities" to false.
", revisions = ""), + Icon(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Polygon(origin = {10.562, 9.352}, fillColor = {42, 85, 94}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-85.751, 70.648}, {-102.737, 66.761}, {-105.751, 50.648}, {-105.751, -69.352}, {-99.475, -85.465}, {-85.751, -89.352}, {74.249, -89.352}, {81.746, -83.29}, {84.249, -76.041}, {84.249, 34.141}, {79.249, 43.202}, {54.249, 43.202}, {52.314, 67.486}, {31.729, 70.648}, {-85.751, 70.648}}, smooth = Smooth.Bezier), Rectangle(origin = {-71.211, 40}, fillColor = {106, 108, 116}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-32.24, -20}, {32.24, 20}}, radius = 10), Rectangle(origin = {-79.366, -45.041}, fillPattern = FillPattern.Solid, extent = {{-25.915, -15.041}, {25.915, 15.041}}, radius = 10), Text(origin = {0, -130}, extent = {{-100, -20}, {100, 20}}, textString = "%Port"), Text(origin = {5, -30}, lineColor = {255, 255, 255}, extent = {{-75, 30}, {75, -30}}, textString = "Leonardo")}), + Diagram(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Polygon(origin = {10.562, 9.352}, fillColor = {42, 85, 94}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-85.751, 70.648}, {-102.737, 66.761}, {-105.751, 50.648}, {-105.751, -69.352}, {-99.475, -85.465}, {-85.751, -89.352}, {74.249, -89.352}, {81.746, -83.29}, {84.249, -76.041}, {84.249, 34.141}, {79.249, 43.202}, {54.249, 43.202}, {52.314, 67.486}, {31.729, 70.648}, {-85.751, 70.648}}, smooth = Smooth.Bezier), Rectangle(origin = {-71.211, 40}, fillColor = {106, 108, 116}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-32.24, -20}, {32.24, 20}}, radius = 10), Rectangle(origin = {-79.366, -45.041}, fillPattern = FillPattern.Solid, extent = {{-25.915, -15.041}, {25.915, 15.041}}, radius = 10), Ellipse(origin = {-8.451, 32.225}, lineColor = {255, 255, 255}, fillColor = {42, 85, 94}, fillPattern = FillPattern.Solid, lineThickness = 5, extent = {{-15, -12.225}, {15, 12.225}}, endAngle = 360), Ellipse(origin = {21.55, 32.22}, lineColor = {255, 255, 255}, fillColor = {42, 85, 94}, fillPattern = FillPattern.Solid, lineThickness = 5, extent = {{-15, -12.23}, {15, 12.23}}, endAngle = 360), Text(origin = {-5, -15}, lineColor = {255, 255, 255}, extent = {{-75, 25}, {95, -35}}, textString = "Leonardo", textStyle = {TextStyle.Bold})}), + Diagram(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {10, 10}), graphics = {Polygon(visible = true, origin = {10.751, 9.352}, fillColor = {42, 85, 94}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-85.751, 70.648}, {-102.737, 66.761}, {-105.751, 50.648}, {-105.751, -69.352}, {-99.475, -85.465}, {-85.751, -89.352}, {74.249, -89.352}, {81.746, -83.29}, {84.249, -76.041}, {84.249, 34.141}, {79.249, 43.202}, {54.249, 43.202}, {52.314, 67.486}, {31.729, 70.648}}, smooth = Smooth.Bezier), Rectangle(visible = true, origin = {-71.211, 40}, fillColor = {106, 108, 116}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-32.24, -20}, {32.24, 20}}, radius = 10), Rectangle(visible = true, origin = {-79.366, -45.041}, fillPattern = FillPattern.Solid, extent = {{-25.915, -15.041}, {25.915, 15.041}}, radius = 10), Rectangle(visible = true, origin = {0.725, 70}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-54.177, -6.186}, {54.177, 6.186}}, radius = 10), Rectangle(visible = true, origin = {22.372, -63.814}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-64.177, -6.186}, {64.177, 6.186}}, radius = 10), Rectangle(visible = true, origin = {25.52, -30}, fillPattern = FillPattern.Solid, extent = {{-51.029, -13.424}, {51.029, 13.424}}, radius = 10), Rectangle(visible = true, origin = {76.549, -63.624}, fillColor = {250, 105, 0}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {66.549, -63.624}, fillColor = {243, 134, 48}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {56.549, -63.624}, fillColor = {250, 105, 0}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {46.549, -63.624}, fillColor = {243, 134, 48}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {36.549, -63.624}, fillColor = {250, 105, 0}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {26.549, -63.624}, fillColor = {243, 134, 48}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {46.549, 70}, fillColor = {167, 219, 216}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {36.549, 70}, fillColor = {105, 210, 231}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {26.549, 70}, fillColor = {167, 219, 216}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {16.549, 70}, fillColor = {105, 210, 231}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {6.549, 70}, fillColor = {167, 219, 216}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {-3.451, 70}, fillColor = {105, 210, 231}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {-13.451, 70}, fillColor = {167, 219, 216}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {-23.451, 70}, fillColor = {105, 210, 231}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {-33.451, 70}, fillColor = {167, 219, 216}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {-43.451, 70}, fillColor = {105, 210, 231}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {-33.451, -63.624}, fillColor = {204, 208, 224}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {-23.451, -63.624}, fillColor = {204, 208, 224}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {-13.451, -63.624}, fillColor = {204, 208, 224}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {-3.451, -63.624}, fillColor = {204, 208, 224}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Ellipse(visible = true, origin = {-8.451, 43.801}, lineColor = {255, 255, 255}, fillColor = {42, 85, 94}, fillPattern = FillPattern.Solid, lineThickness = 5, extent = {{-15, -12.225}, {15, 12.225}}), Ellipse(visible = true, origin = {21.549, 43.801}, lineColor = {255, 255, 255}, fillColor = {42, 85, 94}, fillPattern = FillPattern.Solid, lineThickness = 5, extent = {{-15, -12.225}, {15, 12.225}}), Text(visible = true, origin = {10, 23.151}, extent = {{-40, -10}, {40, 10}}, textString = "Leonardo")})); + end ArduinoLeonardo; + + model customBoard + parameter Internal.Types.SerialPort Port = "COM1" "Name of the serial port"; + parameter Boolean ShowPinCapabilities = true "Set to true if you want to see the capabilities of the pins in your board"; + parameter Boolean UseDTR = false "Some boards like Arduino Leonardo require UseDTR=true"; + parameter String BoardName = "[Board Name]" "Name of the development board/Microcontroller you are using"; + OpenModelicaEmbedded.Internal.ExternalFunctions.FirmataBoardObject board = Internal.ExternalFunctions.FirmataBoardObject.constructor(Port, ShowPinCapabilities, integer(UpdatePeriod * 1000), BaudRate, UseDTR); + OpenModelicaEmbedded.Internal.Interfaces.BoardConnector boardConnector annotation( + Placement(visible = true, transformation(origin = {-90, -12.256}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {0, 0}, extent = {{-100, -100}, {100, 100}}, rotation = 0))); + protected + discrete Integer BoardId(start = -1) "Board Identifier. Initialized automatically keep as -1."; + constant Modelica.SIunits.Time UpdatePeriod = 0.01 "Sampling interval. The standard Firmata has a maximum sampling period of 10 ms (0.01 s)"; + constant Integer BaudRate = 57600 "Baud rate used to communicate with the board"; + equation + when initial() then + BoardId = Internal.ExternalFunctions.getBoardId(board); + end when; + when sample(0, UpdatePeriod) then + OpenModelicaEmbedded.Internal.ExternalFunctions.updateBoard(BoardId); + end when; + boardConnector = BoardId; + annotation( + Icon(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(fillColor = {0, 85, 0}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-95, 90}, {95, -70}}, radius = 10), Text(origin = {0, 20}, lineColor = {255, 255, 255}, extent = {{-85, 40}, {85, -40}}, textString = "%BoardName"), Text(origin = {0, -80}, extent = {{-50, 20}, {50, -20}}, textString = "Port: %Port")}), + Diagram(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(fillColor = {0, 85, 0}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-95, 80}, {95, -80}}, radius = 10), Text(lineColor = {255, 255, 255}, extent = {{-85, 35}, {85, -35}}, textString = "%BoardName")})); + end customBoard; + + + + + + annotation( + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {10, 10}), graphics = {Polygon(visible = true, origin = {12.096, 9.352}, fillColor = {0, 128, 0}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-85.75100000000001, 70.648}, {-102.737, 66.761}, {-105.751, 50.648}, {-105.751, -69.352}, {-99.47499999999999, -85.465}, {-85.75100000000001, -89.352}, {74.249, -89.352}, {81.746, -83.29000000000001}, {86.32899999999999, -74.352}, {84.249, 34.141}, {82.185, 50.648}, {74.732, 67.486}, {52.373, 70.648}, {31.729, 70.648}}, smooth = Smooth.Bezier), Rectangle(visible = true, origin = {-69.67700000000001, 40}, fillColor = {106, 108, 116}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-32.24, -20}, {32.24, 20}}, radius = 10), Rectangle(visible = true, origin = {-77.83199999999999, -45.041}, fillPattern = FillPattern.Solid, extent = {{-25.915, -15.041}, {25.915, 15.041}}, radius = 10), Rectangle(visible = true, origin = {24.177, 70}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-54.177, -6.186}, {54.177, 6.186}}, radius = 10), Rectangle(visible = true, origin = {23.906, -63.814}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-64.17700000000001, -6.186}, {64.17700000000001, 6.186}}, radius = 10), Rectangle(visible = true, origin = {21.91, 0}, fillPattern = FillPattern.Solid, extent = {{-28.09, -25}, {28.09, 25}}, radius = 10), Rectangle(visible = true, origin = {78.083, -63.624}, fillColor = {250, 105, 0}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {68.083, -63.624}, fillColor = {243, 134, 48}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {58.083, -63.624}, fillColor = {250, 105, 0}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {48.083, -63.624}, fillColor = {243, 134, 48}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {38.083, -63.624}, fillColor = {250, 105, 0}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {28.083, -63.624}, fillColor = {243, 134, 48}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {70.00100000000001, 70}, fillColor = {167, 219, 216}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {60.001, 70}, fillColor = {105, 210, 231}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {50.001, 70}, fillColor = {167, 219, 216}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {40.001, 70}, fillColor = {105, 210, 231}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {30.001, 70}, fillColor = {167, 219, 216}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {20.001, 70}, fillColor = {105, 210, 231}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {10.001, 70}, fillColor = {167, 219, 216}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {0.001, 70}, fillColor = {105, 210, 231}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {-9.999000000000001, 70}, fillColor = {167, 219, 216}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {-19.999, 70}, fillColor = {105, 210, 231}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {-31.917, -63.624}, fillColor = {204, 208, 224}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {-21.917, -63.624}, fillColor = {204, 208, 224}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {-11.917, -63.624}, fillColor = {204, 208, 224}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {-1.917, -63.624}, fillColor = {204, 208, 224}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50)}), + Diagram(coordinateSystem(extent = {{-148.5, -105}, {148.5, 105}}, preserveAspectRatio = true, initialScale = 0.1, grid = {5, 5}))); + end Boards; + + package Examples "A collection of examples to help you get started" + extends Modelica.Icons.ExamplesPackage; + + model BlinkLed "Basic example of blinking an LED" + extends Modelica.Icons.Example; + replaceable OpenModelicaArduino.Boards.Arduino arduino(Port = "/dev/ttyACM0", ShowPinCapabilities = true, UseDTR = false) annotation( + Placement(visible = true, transformation(origin = {30, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaArduino.Pins.DigitalOutput digitalOutput(Pin = 30) annotation( + Placement(visible = true, transformation(origin = {0, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {35, 15}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Sources.BooleanPulse booleanPulse annotation( + Placement(visible = true, transformation(origin = {-30, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + equation + connect(digitalOutput.pinConnector, arduino.boardConnector) annotation( + Line(points = {{10, -10}, {30, -10}}, color = {72, 73, 79})); + connect(booleanPulse.y, digitalOutput.u) annotation( + Line(points = {{-19, -10}, {-10, -10}}, color = {255, 0, 255})); + annotation( + experiment(StopTime = 10, Interval = 0.001), + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = false, initialScale = 0.1, grid = {10, 10})), + preferredView = "diagram", + Documentation(info = "This example uses the DigitalOutput component to control the LED attached to the Arduino board on pin 13. It uses a BooleanPulse from the Modelica library to produce an On/Off signal that is fed into the DigitalOutput component. This will make the LED attached to the pin blink.
+You can go ahead and add more LEDs to the board as shown in the following figure. This will require you to add one more DigitalOutput component to control the LED on pin 9.
+", revisions = ""), + Diagram(coordinateSystem(extent = {{-50, -50}, {50, 50}}, initialScale = 0.1, grid = {5, 5}))); + end BlinkLed; + + model DimmingLed "Changing the intensity of an LED" + extends Modelica.Icons.Example; + OpenModelicaArduino.Boards.Arduino arduino(Port = "/dev/ttyACM0", ShowPinCapabilities = true) annotation( + Placement(visible = true, transformation(origin = {30, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Pins.AnalogOutput analogOutput(MaxValue = 512, MinValue = -512, Pin = 30) annotation( + Placement(visible = true, transformation(origin = {0, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {35, 25}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaArduino.Pins.AnalogInput analogInput1(MaxValue = 512, MinValue = -512, Pin = 23) annotation( + Placement(visible = true, transformation(origin = {-30, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + equation + connect(analogInput1.pinConnector, arduino.boardConnector) annotation( + Line(points = {{-40, -10}, {-45, -10}, {-45, -40}, {30, -40}, {30, -10}, {30, -10}})); + connect(analogInput1.y, analogOutput.u) annotation( + Line(points = {{-20, -10}, {-10, -10}, {-10, -10}, {-10, -10}}, color = {0, 0, 127})); + connect(analogOutput.pinConnector, arduino.boardConnector) annotation( + Line(visible = true, origin = {20, -10}, points = {{-10, -0}, {10, 0}})); + annotation( + experiment(Interval = 0.001, __Wolfram_SynchronizeWithRealTime = true), + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = false, initialScale = 0.1, grid = {10, 10})), + preferredView = "diagram", + Documentation(info = "This example uses the AnalogOutput component to change the light intensity of an LED. AnalogOutput uses the Arduino function 'analogWrite', which produces a PWM (Pulse-Width Modulated) signal. This type of signal can be used to directly control the LED intensity. The following figure shows the connections.
+ +You can check the Arduino Playground to know more about PWM outputs.
", revisions = ""), + Diagram(coordinateSystem(extent = {{-50, -50}, {50, 50}}, initialScale = 0.1, grid = {5, 5}))); + end DimmingLed; + + model ReadSensor "Reading analog signals" + extends Modelica.Icons.Example; + OpenModelicaArduino.Boards.Arduino arduino(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {0, 15}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaArduino.Pins.DigitalOutput digitalOutput(Pin = 10) annotation( + Placement(visible = true, transformation(origin = {-30, 15}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaArduino.Pins.AnalogInput analogInput1(Pin = 16) annotation( + Placement(visible = true, transformation(origin = {30, 15}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Logical.Greater greater1 annotation( + Placement(visible = true, transformation(origin = {-10, -15}, extent = {{10, -10}, {-10, 10}}, rotation = 0))); + Modelica.Blocks.Sources.Constant Reference(k = 0.5) annotation( + Placement(visible = true, transformation(origin = {30, -30}, extent = {{-10, -10}, {10, 10}}, rotation = -180))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-30, -40}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + equation + connect(greater1.y, digitalOutput.u) annotation( + Line(visible = true, origin = {-38.744, -2.5}, points = {{17.744, -12.5}, {-6.256, -12.5}, {-6.256, 17.5}, {-1.256, 17.5}}, color = {255, 0, 255})); + connect(analogInput1.y, greater1.u1) annotation( + Line(visible = true, origin = {33.994, -5}, points = {{6.006, 20}, {11.006, 20}, {11.006, 0}, {-23.994, 0}, {-23.994, -10}, {-31.994, -10}}, color = {0, 0, 127})); + connect(analogInput1.pinConnector, arduino.boardConnector) annotation( + Line(visible = true, origin = {10, 15}, points = {{10, 0}, {-10, 0}}, color = {72, 73, 79})); + connect(digitalOutput.pinConnector, arduino.boardConnector) annotation( + Line(visible = true, origin = {-10, 15}, points = {{-10, 0}, {10, 0}}, color = {72, 73, 79})); + connect(Reference.y, greater1.u2) annotation( + Line(visible = true, origin = {12.75, -29}, points = {{6.25, -1}, {-2.75, -1}, {-2.75, 6}, {-10.75, 6}}, color = {0, 0, 127})); + annotation( + experiment(StartTime = 0.0, StopTime = 10.0, Interval = 0.001, __Wolfram_Algorithm = "dassl", Tolerance = 1e-006, __Wolfram_SynchronizeWithRealTime = true), + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = false, initialScale = 0.1, grid = {10, 10})), + preferredView = "diagram", + Documentation(info = "This example shows how to read an analog voltage using the AnalogInput component. The analog signal is then compared to a reference, and if the signal is above the reference, it will turn on an LED. You can see in the following figure how to build this example.
+ +You can see that pin A0 for the Arduino corresponds to pin number 14 for the Firmata. For other boards, the pin numbering may vary.
+Run the simulation and move the potentiometer. You should see that when the position of the shaft is near the middle, the LED changes state.
+The AnalogInput component returns a signal between 0 and 1. This value represents the voltage between 0 and the reference voltage. If you prefer to get the signal directly in volts, you need to change the 'MaxValue' property to the reference voltage, but generally it is either 5 V or 3.3 V.
", revisions = ""), + Diagram(coordinateSystem(extent = {{-50, -50}, {50, 50}}, initialScale = 0.1, grid = {5, 5}))); + end ReadSensor; + + model MoveServo "Using servos" + extends Modelica.Icons.Example; + Boards.Arduino arduino(Port = "COM1") annotation( + Placement(visible = true, transformation(origin = {30, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Pins.Servo servo(Pin = 10) annotation( + Placement(visible = true, transformation(origin = {0, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Sources.ExpSine expSine(offset = 0.5, amplitude = 0.5, freqHz = 0.4, damping = 0.1) annotation( + Placement(visible = true, transformation(origin = {-30, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-25, 35}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + equation + connect(expSine.y, servo.u) annotation( + Line(visible = true, origin = {-14.5, -10}, points = {{-4.5, -0}, {4.5, 0}}, color = {0, 0, 127})); + connect(servo.pinConnector, arduino.boardConnector) annotation( + Line(visible = true, origin = {20, -10}, points = {{-10, 0}, {10, -0}}, color = {72, 73, 79})); + annotation( + experiment(Interval = 0.001, __Wolfram_SynchronizeWithRealTime = true), + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = false, initialScale = 0.1, grid = {10, 10})), + preferredView = "diagram", + Documentation(info = "This example shows how to control a servo by using the Servo component. You can find the diagram in the following figure.
+For this example, it is recommended to use an external power source to provide voltage for the servo. This is because the power from the Arduino may not be enough to supply the servo. If you are not sure how to connect your servo, take a look at the reference in the Arduino Playground (http://playground.arduino.cc).
+ +Servos are controlled with a signal in the range of 0 to 1, where 0 corresponds to 0 degrees of rotation and 1 to 180 degrees. This example makes the servo bounce from 0 to 180 degrees until it gets stable around 90 degrees.
", revisions = ""), + Diagram(coordinateSystem(extent = {{-50, -50}, {50, 50}}, initialScale = 0.1, grid = {5, 5}))); + end MoveServo; + + model SimpleONOFF "A simple On/Off controller" + extends Modelica.Icons.Example; + OpenModelicaArduino.Boards.Arduino arduino(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {0, 15}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaArduino.Pins.AnalogInput analogInput1(MaxValue = 3.3 * 100, Pin = 23, adcResolution = 12) annotation( + Placement(visible = true, transformation(origin = {30, 15}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Sources.Constant Reference(k = 40) annotation( + Placement(visible = true, transformation(origin = {35, -25}, extent = {{-10, -10}, {10, 10}}, rotation = -180))); + Modelica.Blocks.Math.Add add1(k2 = +1, k1 = -1) annotation( + Placement(visible = true, transformation(origin = {-0, -25}, extent = {{10, -10}, {-10, 10}}, rotation = 0))); + Pins.DigitalOutput digitalOutput(Pin = 30) annotation( + Placement(visible = true, transformation(origin = {-30, 15}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Logical.Hysteresis hysteresis(uLow = -1, uHigh = 1) annotation( + Placement(visible = true, transformation(origin = {-30, -25}, extent = {{10, -10}, {-10, 10}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {42.5, 42.5}, extent = {{-7.5, -7.5}, {7.5, 7.5}}, rotation = 0))); + equation + connect(hysteresis.u, add1.y) annotation( + Line(visible = true, origin = {-14.5, -25}, points = {{-3.5, -0}, {3.5, 0}}, color = {0, 0, 127})); + connect(digitalOutput.u, hysteresis.y) annotation( + Line(visible = true, origin = {-43.25, 5}, points = {{3.25, 10}, {-1.75, 10}, {-1.75, -30}, {2.25, -30}}, color = {255, 0, 255})); + connect(digitalOutput.pinConnector, arduino.boardConnector) annotation( + Line(visible = true, origin = {-10, 15}, points = {{-10, 0}, {10, 0}})); + connect(add1.u2, Reference.y) annotation( + Line(visible = true, origin = {18.5, -23}, points = {{-6.5, -8}, {1.5, -8}, {1.5, -2}, {5.5, -2}}, color = {0, 0, 127})); + connect(analogInput1.y, add1.u1) annotation( + Line(visible = true, origin = {33.506, 12}, points = {{6.494, 3}, {11.494, 3}, {11.494, -17}, {-13.506, -17}, {-13.506, -31}, {-21.506, -31}}, color = {0, 0, 127})); + connect(arduino.boardConnector, analogInput1.pinConnector) annotation( + Line(visible = true, origin = {10, 15}, points = {{-10, 0}, {10, 0}})); + annotation( + experiment(Interval = 0.001, __Wolfram_SynchronizeWithRealTime = true), + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = false, initialScale = 0.1, grid = {10, 10})), + preferredView = "diagram", + Documentation(info = "This example is a simple ON/OFF controller and can be used for either heating or cooling. It uses an LM35 to read the temperature, and based on that temperature, the controller switches a relay on or off. You can attach a fan or a heater to the relay, depending on the operation you want to perform. You can find the diagram in the following figure.
Note: You need to be careful when using relays that control electrical equipment using AC voltage, because an incorrect connection may damage your board.
The target temperature is set by a constant component. The measured temperature is subtracted from the reference in order to obtain the error. The error signal is fed into the hysteresis component, which will send a Boolean signal to control the relay. If you want cooling instead of heating, you need to invert the logic of this signal.
"), + Diagram(coordinateSystem(extent = {{-50, -50}, {50, 50}}, initialScale = 0.1, grid = {5, 5}))); + end SimpleONOFF; + + model UsingArduinoLeonardo "Basic example of blinking an LED" + extends OpenModelicaArduino.Examples.BlinkLed(redeclare ModelPlug.Boards.ArduinoLeonardo arduino); + annotation( + experiment(StopTime = 10, Interval = 0.001, __Wolfram_SynchronizeWithRealTime = true), + Documentation(info = "This example shows how the + Blink Led can be used with an Arduino Leonardo.
", revisions = "")); + end UsingArduinoLeonardo; + + model UsingCustomBoard "Using a Firmata-compatible board" + extends Modelica.Icons.Example; + Modelica.Blocks.Sources.BooleanPulse booleanPulse(period = 1) annotation( + Placement(visible = true, transformation(origin = {-30, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Pins.DigitalOutput digitalOutput(Pin = 13) annotation( + Placement(visible = true, transformation(origin = {-0, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Boards.CustomFirmata customFirmata(Port = "COM1", BaudRate = 115200, UpdatePeriod = 0.001) annotation( + Placement(visible = true, transformation(origin = {30, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-30, 30}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + equation + connect(digitalOutput.pinConnector, customFirmata.boardConnector) annotation( + Line(visible = true, origin = {20, -10}, points = {{-10, 0}, {10, -0}})); + connect(booleanPulse.y, digitalOutput.u) annotation( + Line(visible = true, origin = {-14.5, -10}, points = {{-4.5, 0}, {4.5, 0}}, color = {255, 0, 255})); + annotation( + experiment(Interval = 0.001, __Wolfram_SynchronizeWithRealTime = true), + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = false, initialScale = 0.1, grid = {10, 10})), + preferredView = "diagram", + Documentation(info = "- 1 Teensy 3.1 board
+This example shows how to use a board with a custom version of Firmata. The Teensy board works perfectly with the StandardFirmata, but in this example it is modified in order get a faster data transfer speed.
+ +
The main difference of the CustomFirmata component is that it allows you to set the baud rate to the sampling interval that you want to use. In this case the oce of the StandardFirmata is modified to use a baud rate of 115200. You can perform this modification in the source code. Search for the line:
Firmata.Begin(57600);
+and changing it to
+Firmata.Begin(115200);
+This initializes the serial port at the given speed. The next change that you can make is reducing the minimum sampling interval. You can find this tweak by searching in the code the text:
+#define MINIMUM_SAMPLING_INTERVAL 10
+and changing it to
+#define MINIMUM_SAMPLING_INTERVAL 1
+This changes the sampling interval limit from 10 ms to 1ms. You have to consider that this change is possible because the Teensy board can run up to 96 MHz. If you change the sampling interval, it is necessary to change the simulation setting in SimulationCenter to 1 ms, as shown in the following figure.
+ ", revisions = ""), + Diagram(coordinateSystem(extent = {{-50, -50}, {50, 50}}, initialScale = 0.1, grid = {5, 5}))); + end UsingCustomBoard; + + model UsingStandardFirmata "Using a standard Firmata board" + extends Modelica.Icons.Example; + Boards.StandardFirmata standardFirmata(Port = "COM1", ShowPinCapabilities = true) annotation( + Placement(visible = true, transformation(origin = {30, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaArduino.Pins.DigitalOutput digitalOutput(Pin = 13) annotation( + Placement(visible = true, transformation(origin = {-0, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Sources.BooleanPulse booleanPulse(period = 1) annotation( + Placement(visible = true, transformation(origin = {-30, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-35, 40}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + equation + connect(digitalOutput.pinConnector, standardFirmata.boardConnector) annotation( + Line(visible = true, origin = {20, -10}, points = {{-10, 0}, {10, 0}}, color = {72, 73, 79})); + connect(booleanPulse.y, digitalOutput.u) annotation( + Line(visible = true, origin = {-14.5, -10}, points = {{-4.5, 0}, {4.5, 0}}, color = {255, 0, 255})); + annotation( + experiment(StopTime = 10, Interval = 0.001, __Wolfram_SynchronizeWithRealTime = true), + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = false, initialScale = 0.1, grid = {10, 10})), + preferredView = "diagram", + Documentation(info = "This example uses the DigitalOutput component to control the LED attached to a standard Firmata board on pin 13. It uses a BooleanPulse from the Modelica library to produce an On/Off signal that is fed into the DigitalOutput component. This will make the LED attached to the pin blink.
+You can go ahead and add more LEDs to the board as shown in the following figure. This will require you to add one more DigitalOutput component to control the LED on pin 9.
+ ", revisions = ""), + Diagram(coordinateSystem(extent = {{-50, -50}, {50, 50}}, initialScale = 0.1, grid = {5, 5}))); + end UsingStandardFirmata; + + model DCMotorWithPWM + extends Modelica.Icons.Example; + OpenModelicaArduino.Boards.customBoard customBoard1(BoardName = "Arduino UNO", Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {13, 29}, extent = {{-25, -25}, {25, 25}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {54, 78}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaArduino.Pins.AnalogOutput analogOutput1(MaxValue = 255, Pin = 30) annotation( + Placement(visible = true, transformation(origin = {-57, 29}, extent = {{-15, -15}, {15, 15}}, rotation = 0))); + OpenModelicaArduino.Pins.DigitalOutput digitalOutput1(Pin = 8) annotation( + Placement(visible = true, transformation(origin = {-45, -23}, extent = {{-13, -13}, {13, 13}}, rotation = 90))); + OpenModelicaArduino.Pins.DigitalOutput digitalOutput2(Pin = 9) annotation( + Placement(visible = true, transformation(origin = {50, -28}, extent = {{-10, -10}, {10, 10}}, rotation = 90))); + Modelica.Blocks.Sources.BooleanConstant booleanConstant1(k = true) annotation( + Placement(visible = true, transformation(origin = {-70, -70}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Sources.BooleanConstant booleanConstant2(k = false) annotation( + Placement(visible = true, transformation(origin = {14, -74}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaArduino.Pins.AnalogInput analogInput1(MaxValue = 1024, Pin = 23) annotation( + Placement(visible = true, transformation(origin = {-56, 74}, extent = {{-14, -14}, {14, 14}}, rotation = 0))); + equation + connect(analogInput1.y, analogOutput1.u) annotation( + Line(points = {{-42, 74}, {-20, 74}, {-20, 52}, {-90, 52}, {-90, 28}, {-72, 28}, {-72, 30}}, color = {0, 0, 127})); + connect(analogInput1.pinConnector, customBoard1.boardConnector) annotation( + Line(points = {{-70, 74}, {-88, 74}, {-88, 92}, {12, 92}, {12, 30}, {14, 30}})); + connect(digitalOutput1.pinConnector, customBoard1.boardConnector) annotation( + Line(points = {{-45, -10}, {-44.75, -10}, {-44.75, -2}, {14, -2}, {14, 30}})); + connect(booleanConstant1.y, digitalOutput1.u) annotation( + Line(points = {{-58, -70}, {-46, -70}, {-46, -36}, {-45, -36}}, color = {255, 0, 255})); + connect(booleanConstant2.y, digitalOutput2.u) annotation( + Line(points = {{26, -74}, {50, -74}, {50, -40}, {49, -40}, {49, -38}, {50, -38}}, color = {255, 0, 255})); + connect(digitalOutput2.pinConnector, customBoard1.boardConnector) annotation( + Line(points = {{50, -18}, {50, 30}, {14, 30}})); + connect(analogOutput1.pinConnector, customBoard1.boardConnector) annotation( + Line(points = {{-42, 30}, {13, 30}, {13, 29}})); + annotation( + uses(OpenModelicaArduino(version = "1.2"), Modelica(version = "3.2.2"), Modelica_DeviceDrivers(version = "1.5.0"))); + end DCMotorWithPWM; + + model DCMotorWithPID + extends Modelica.Icons.Example; + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1(priority = "High", setPriority = true) annotation( + Placement(visible = true, transformation(origin = {92, 88}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Mechanics.Rotational.Components.Inertia inertia1(J = 1, a(start = 0), phi(start = 0), w(start = 0)) annotation( + Placement(visible = true, transformation(origin = {-22, -86}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Mechanics.Rotational.Components.Inertia inertia2(J = 1, a(start = 0), phi(start = 0), w(start = 0)) annotation( + Placement(visible = true, transformation(origin = {56, -86}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Mechanics.Rotational.Components.SpringDamper springDamper1(c = 20, d = 10, phi_rel0 = 0) annotation( + Placement(visible = true, transformation(origin = {16, -86}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Mechanics.Rotational.Sources.Torque torque1 annotation( + Placement(visible = true, transformation(origin = {-64, -86}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Mechanics.Rotational.Sources.ConstantTorque constantTorque1(tau_constant = 10) annotation( + Placement(visible = true, transformation(origin = {98, -86}, extent = {{10, -10}, {-10, 10}}, rotation = 0))); + Modelica.Mechanics.Rotational.Sensors.SpeedSensor speedSensor1 annotation( + Placement(visible = true, transformation(origin = {88, -36}, extent = {{-10, -10}, {10, 10}}, rotation = 90))); + OpenModelicaArduino.Boards.CustomFirmata customFirmata1(BaudRate = 57600, Port = "/dev/ttyACM0", ShowPinCapabilities = true, UpdatePeriod = 0.02, UseDTR = true) annotation( + Placement(visible = true, transformation(origin = {-10, 4}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaArduino.Pins.AnalogOutput analogOutput1(MaxValue = 512, MinValue = -512, Pin = 5) annotation( + Placement(visible = true, transformation(origin = {46, 2}, extent = {{10, -10}, {-10, 10}}, rotation = 0))); + OpenModelicaArduino.Pins.AnalogInput analogInput1(InitValue = 0, MaxValue = 512, MinValue = -512, Pin = 15) annotation( + Placement(visible = true, transformation(origin = {-64, 2}, extent = {{10, -10}, {-10, 10}}, rotation = 0))); + OpenModelicaArduino.Pins.AnalogOutput analogOutput2(MaxValue = 512, MinValue = -512, Pin = 6) annotation( + Placement(visible = true, transformation(origin = {-54, 58}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Sources.Sine sine1(amplitude = 512, freqHz = 0.5) annotation( + Placement(visible = true, transformation(origin = {-122, 58}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + equation + connect(sine1.y, analogOutput2.u) annotation( + Line(points = {{-110, 58}, {-64, 58}, {-64, 58}, {-64, 58}}, color = {0, 0, 127})); + connect(analogOutput2.pinConnector, customFirmata1.boardConnector) annotation( + Line(points = {{-44, 58}, {-10, 58}, {-10, 4}})); + connect(analogInput1.y, torque1.tau) annotation( + Line(points = {{-74, 2}, {-84, 2}, {-84, 2}, {-94, 2}, {-94, -86}, {-76, -86}}, color = {0, 0, 127})); + connect(analogInput1.pinConnector, customFirmata1.boardConnector) annotation( + Line(points = {{-54, 2}, {-10, 2}, {-10, 4}})); + connect(speedSensor1.w, analogOutput1.u) annotation( + Line(points = {{88, -25}, {89, -25}, {89, -23}, {88, -23}, {88, 3}, {56, 3}, {56, 1}}, color = {0, 0, 127})); + connect(analogOutput1.pinConnector, customFirmata1.boardConnector) annotation( + Line(points = {{36, 2}, {35.5, 2}, {35.5, 2}, {35, 2}, {35, 4}, {-10, 4}})); + connect(speedSensor1.flange, constantTorque1.flange) annotation( + Line(points = {{88, -46}, {88, -86}})); + connect(inertia2.flange_b, constantTorque1.flange) annotation( + Line(points = {{66, -86}, {88, -86}, {88, -86}, {88, -86}, {88, -86}, {88, -86}})); + connect(torque1.flange, inertia1.flange_a) annotation( + Line(points = {{-54, -86}, {-37, -86}, {-37, -86}, {-32, -86}, {-32, -86}, {-31, -86}, {-31, -86}, {-32, -86}})); + connect(springDamper1.flange_b, inertia2.flange_a) annotation( + Line(points = {{26, -86}, {36, -86}, {36, -86}, {46, -86}, {46, -86}, {46, -86}})); + connect(inertia1.flange_b, springDamper1.flange_a) annotation( + Line(points = {{-12, -86}, {-3, -86}, {-3, -86}, {6, -86}, {6, -86}, {6, -86}})); + annotation( + uses(OpenModelicaArduino(version = "1.2"), Modelica(version = "3.2.2"), Modelica_DeviceDrivers(version = "1.5.0"))); + end DCMotorWithPID; + annotation( + Diagram(coordinateSystem(extent = {{-148.5, -105}, {148.5, 105}}, preserveAspectRatio = true, initialScale = 0.1, grid = {5, 5}))); + end Examples; + + package Internal "Internal classes that should not be used directly by the user" + extends Modelica.Icons.Package; + + package Icons "Icons used in ModelPlug" + extends Modelica.Icons.IconsPackage; + + partial model Block "Icon for blocks" + annotation( + experiment(NumberOfIntervals = -1), + preferredView = "icon", + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(visible = true, fillColor = {128, 128, 128}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -80}, {100, 80}}, radius = 40), Rectangle(visible = true, origin = {5, -5}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-95, -75}, {95, 75}}, radius = 40), Rectangle(visible = true, fillColor = {64, 64, 64}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-90, -70}, {90, 70}}, radius = 30)}), + Diagram(coordinateSystem(extent = {{-148.5, -105}, {148.5, 105}}, preserveAspectRatio = true, initialScale = 0.1, grid = {5, 5}))); + end Block; + annotation( + Diagram(coordinateSystem(extent = {{-148.5, -105}, {148.5, 105}}, preserveAspectRatio = true, initialScale = 0.1, grid = {5, 5}))); + end Icons; + + package ExternalFunctions "External functions used to communicate with the boards" + extends Modelica.Icons.Package; + + function readAnalogPin + input Integer pin; + input Real min; + input Real max; + input Real init; + input Integer board; + input Integer adcResolution; + output Real value; + + external "C" value = readAnalogPin(pin, min, max, init, board, adcResolution) annotation( + Include = "#include \"modelPlugFirmata.h\"", + Library = "modelPlugFirmata", + IncludeDirectory = "modelica://OpenModelicaArduino/Resources/Include", + LibraryDirectory = "modelica://OpenModelicaArduino/Resources/Library"); + end readAnalogPin; + + class FirmataBoardObject + extends ExternalObject; + + function constructor "Function that call the external constructor" + input String port; + input Boolean showCapabilities; + input Integer samplingMs; + input Integer BaudRate; + input Boolean UseDTR; + output FirmataBoardObject board; + + external "C" board = boardConstructor(port, showCapabilities, samplingMs, BaudRate, UseDTR) annotation( + Include = "#include \"modelPlugFirmata.h\"", + Library = "modelPlugFirmata", + IncludeDirectory = "modelica://OpenModelicaArduino/Resources/Include", + LibraryDirectory = "modelica://OpenModelicaArduino/Resources/Library"); + end constructor; + + function destructor "Function to destroy the object" + input FirmataBoardObject board; + + external "C" boardDestructor(board) annotation( + Include = "#include \"modelPlugFirmata.h\"", + Library = "modelPlugFirmata", + IncludeDirectory = "modelica://OpenModelicaArduino/Resources/Include", + LibraryDirectory = "modelica://OpenModelicaArduino/Resources/Library"); + end destructor; + end FirmataBoardObject; + + function getBoardId + input FirmataBoardObject board; + output Integer id; + + external "C" id = getBoardId(board) annotation( + Include = "#include \"modelPlugFirmata.h\"", + Library = "modelPlugFirmata", + IncludeDirectory = "modelica://OpenModelicaArduino/Resources/Include", + LibraryDirectory = "modelica://OpenModelicaArduino/Resources/Library"); + end getBoardId; + + function readDigitalPin + input Integer pin; + input Boolean init; + input Integer board; + output Boolean value; + + external "C" value = readDigitalPin(pin, init, board) annotation( + Include = "#include \"modelPlugFirmata.h\"", + Library = "modelPlugFirmata", + IncludeDirectory = "modelica://OpenModelicaArduino/Resources/Include", + LibraryDirectory = "modelica://OpenModelicaArduino/Resources/Library"); + end readDigitalPin; + + function writeAnalogPin + input Integer pin; + input Integer board; + input Real value; + + external "C" writeAnalogPin(pin, board, value) annotation( + Include = "#include \"modelPlugFirmata.h\"", + Library = "modelPlugFirmata", + IncludeDirectory = "modelica://OpenModelicaArduino/Resources/Include", + LibraryDirectory = "modelica://OpenModelicaArduino/Resources/Library"); + end writeAnalogPin; + + function writeDigitalPin + input Integer pin; + input Integer board; + input Boolean value; + + external "C" writeDigitalPin(pin, board, value) annotation( + Include = "#include \"modelPlugFirmata.h\"", + Library = "modelPlugFirmata", + IncludeDirectory = "modelica://OpenModelicaArduino/Resources/Include", + LibraryDirectory = "modelica://OpenModelicaArduino/Resources/Library"); + end writeDigitalPin; + + function updateBoard + input Integer board; + + external "C" updateBoard(board) annotation( + Include = "#include \"modelPlugFirmata.h\"", + Library = "modelPlugFirmata", + IncludeDirectory = "modelica://OpenModelicaArduino/Resources/Include", + LibraryDirectory = "modelica://OpenModelicaArduino/Resources/Library"); + end updateBoard; + + function writeServoPin + input Integer pin; + input Integer board; + input Real value; + input Integer MinPulse; + input Integer MaxPulse; + + external "C" writeServoPin(pin, board, value, MinPulse, MaxPulse) annotation( + Include = "#include \"modelPlugFirmata.h\"", + Library = "modelPlugFirmata", + IncludeDirectory = "modelica://OpenModelicaArduino/Resources/Include", + LibraryDirectory = "modelica://OpenModelicaArduino/Resources/Library"); + end writeServoPin; + annotation( + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {10, 10}), graphics = {Text(visible = true, origin = {11.425, 9.596}, extent = {{-101.424, -59.596}, {78.57599999999999, 40.404}}, textString = "EF")}), + Documentation(info = "", revisions = ""), + Diagram(coordinateSystem(extent = {{-148.5, 105}, {148.5, -105}}, preserveAspectRatio = true, initialScale = 0.1, grid = {10, 10})), + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}), graphics = {Rectangle(visible = true, fillColor = {209, 209, 209}, fillPattern = FillPattern.Solid, extent = {{-100, -100}, {75, 75}}), Polygon(visible = true, fillColor = {236, 236, 236}, fillPattern = FillPattern.Solid, points = {{-100, 75}, {-75, 100}, {100, 100}, {75, 75}}), Polygon(visible = true, fillColor = {177, 177, 177}, fillPattern = FillPattern.Solid, points = {{75, -100}, {75, 75}, {100, 100}, {100, -75}}), Text(visible = true, extent = {{-95.95, -91.88}, {63.97, 71.52}}, textString = "C")})); + end ExternalFunctions; + + package Types "Type and unit definitions" + extends Modelica.Icons.TypesPackage; + type ServoUnit = enumeration(None, Degrees, Radians); + type SerialPort = String annotation( + Dialog(__Wolfram_serialPortSelector = true)); + annotation( + Diagram(coordinateSystem(extent = {{-148.5, -105}, {148.5, 105}}, preserveAspectRatio = true, initialScale = 0.1, grid = {5, 5}))); + end Types; + + package Interfaces "Package with connectors and partial models" + extends Modelica.Icons.InterfacesPackage; + connector BoardConnector = output Integer annotation( + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {10, 10}), graphics = {Ellipse(visible = true, origin = {-0, 0.74}, fillColor = {64, 64, 64}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-10, -9.26}, {10, 9.26}})}), + Diagram(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {10, 10}), graphics = {Ellipse(visible = true, origin = {-0, 0.74}, fillColor = {64, 64, 64}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-10, -9.26}, {10, 9.26}})})); + connector PinConnector = input Integer annotation( + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {10, 10}), graphics = {Ellipse(visible = true, fillColor = {64, 64, 64}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -100}, {100, 100}}), Ellipse(visible = true, fillColor = {128, 128, 128}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-70, -70}, {70, 70}})}), + Diagram(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {10, 10}), graphics = {Ellipse(visible = true, fillColor = {64, 64, 64}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -100}, {100, 100}}), Ellipse(visible = true, fillColor = {128, 128, 128}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-70, -70}, {70, 70}})})); + end Interfaces; + annotation( + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {10, 10}), graphics = {Polygon(visible = true, origin = {1.383, -4.142}, rotation = 45, fillColor = {64, 64, 64}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-15, 93.333}, {-15, 68.333}, {0, 58.333}, {15, 68.333}, {15, 93.333}, {20, 93.333}, {25, 83.333}, {25, 58.333}, {10, 43.333}, {10, -41.667}, {25, -56.667}, {25, -76.667}, {10, -91.667}, {0, -91.667}, {0, -81.667}, {5, -81.667}, {15, -71.667}, {15, -61.667}, {5, -51.667}, {-5, -51.667}, {-15, -61.667}, {-15, -71.667}, {-5, -81.667}, {0, -81.667}, {0, -91.667}, {-10, -91.667}, {-25, -76.667}, {-25, -56.667}, {-10, -41.667}, {-10, 43.333}, {-25, 58.333}, {-25, 83.333}, {-20, 93.333}}), Polygon(visible = true, origin = {10.102, 5.218}, rotation = -45, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, points = {{-15, 87.273}, {15, 87.273}, {20, 82.273}, {20, 27.273}, {10, 17.273}, {10, 7.273}, {20, 2.273}, {20, -2.727}, {5, -2.727}, {5, -77.727}, {10, -87.727}, {5, -112.727}, {-5, -112.727}, {-10, -87.727}, {-5, -77.727}, {-5, -2.727}, {-20, -2.727}, {-20, 2.273}, {-10, 7.273}, {-10, 17.273}, {-20, 27.273}, {-20, 82.273}})})); + end Internal; + + package ArduinoExamples + extends Modelica.Icons.ExamplesPackage; + + package Led + extends Modelica.Icons.ExamplesPackage; + + model ex1_led_blue + extends Modelica.Icons.Example; + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-60, 60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.DigitalOutput digitalOutput1(Pin = 9) annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, -20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Sources.BooleanConstant booleanConstant1(k = true) annotation( + Placement(visible = true, transformation(origin = {-60, -20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Boards.customBoard customBoard1(BoardName = "Arduino UNO", Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {61, -21}, extent = {{-21, -21}, {21, 21}}, rotation = 0))); + equation + connect(digitalOutput1.pinConnector, customBoard1.boardConnector) annotation( + Line(points = {{20, -20}, {60, -20}, {60, -20}, {62, -20}})); + connect(booleanConstant1.y, digitalOutput1.u) annotation( + Line(points = {{-38, -20}, {-20, -20}, {-20, -20}, {-20, -20}}, color = {255, 0, 255})); + end ex1_led_blue; + + + + model ex2_led_blue_delay + extends Modelica.Icons.Example; + OpenModelicaArduino.Boards.Arduino arduino1(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {60, -20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.DigitalOutput digitalOutput1(Pin = 9) annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, -20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1(enableRealTimeScaling = false) annotation( + Placement(visible = true, transformation(origin = {-60, 60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Sources.BooleanPulse booleanPulse1(period = 20, startTime = 5, width = 10) annotation( + Placement(visible = true, transformation(origin = {-60, -20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + equation + connect(booleanPulse1.y, digitalOutput1.u) annotation( + Line(points = {{-38, -20}, {-20, -20}, {-20, -20}, {-20, -20}}, color = {255, 0, 255})); + connect(digitalOutput1.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{20, -20}, {60, -20}, {60, -20}, {60, -20}})); + end ex2_led_blue_delay; + + model ex3_led_blue_red + extends Modelica.Icons.Example; + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-60, 60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.DigitalOutput digitalOutput1(Pin = 9) annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, 3.55271e-15}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.DigitalOutput digitalOutput2(Pin = 11) annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, -60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Sources.BooleanPulse booleanPulse1(period = 20, startTime = 5, width = 25) annotation( + Placement(visible = true, transformation(origin = {-60, 3.55271e-15}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Sources.BooleanPulse booleanPulse2(period = 20, startTime = 5, width = 40) annotation( + Placement(visible = true, transformation(origin = {-60, -60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Boards.customBoard customBoard1(BoardName = "Arduino UNO", Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {60, -20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + equation + connect(digitalOutput1.pinConnector, customBoard1.boardConnector) annotation( + Line(points = {{20, 0}, {60, 0}, {60, -20}, {60, -20}})); + connect(digitalOutput2.pinConnector, customBoard1.boardConnector) annotation( + Line(points = {{20, -60}, {60, -60}, {60, -20}, {60, -20}})); + connect(booleanPulse2.y, digitalOutput2.u) annotation( + Line(points = {{-38, -60}, {-20, -60}, {-20, -60}, {-20, -60}}, color = {255, 0, 255})); + connect(booleanPulse1.y, digitalOutput1.u) annotation( + Line(points = {{-38, 0}, {-20, 0}, {-20, 0}, {-20, 0}}, color = {255, 0, 255})); + end ex3_led_blue_red; + + model ex4_led_blink + extends Modelica.Icons.Example; + OpenModelicaArduino.Boards.Arduino arduino1(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {42, -6}, extent = {{-14, -14}, {14, 14}}, rotation = 0))); + OpenModelicaArduino.Pins.DigitalOutput digitalOutput1(Pin = 10) annotation( + Placement(visible = true, transformation(origin = {-9, -7}, extent = {{-13, -13}, {13, 13}}, rotation = 0))); + Modelica.Blocks.Sources.BooleanPulse booleanPulse1(period = 2, startTime = 4, width = 50) annotation( + Placement(visible = true, transformation(origin = {-68, -12}, extent = {{-14, -14}, {14, 14}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-19, 51}, extent = {{-13, -13}, {13, 13}}, rotation = 0))); + equation + connect(booleanPulse1.y, digitalOutput1.u) annotation( + Line(points = {{-53, -12}, {-24, -12}, {-24, -7}, {-22, -7}}, color = {255, 0, 255})); + connect(digitalOutput1.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{4, -7}, {22, -7}, {22, -6}, {42, -6}})); + annotation( + uses(OpenModelicaArduino(version = "1.2"), Modelica(version = "3.2.2"), Modelica_DeviceDrivers(version = "1.5.0"))); + end ex4_led_blink; + end Led; + + package Push_button + extends Modelica.Icons.ExamplesPackage; + + model ex1_push_button_status + extends Modelica.Icons.Example; + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-70, 70}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaArduino.Boards.Arduino arduino1(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {-60, 3.55271e-15}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.DigitalInput digitalInput1(Pin = 12) annotation( + Placement(visible = true, transformation(origin = {0, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Interaction.Show.BooleanValue booleanValue1 annotation( + Placement(visible = true, transformation(origin = {80, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + equation + connect(digitalInput1.y, booleanValue1.activePort) annotation( + Line(points = {{20, 0}, {54, 0}, {54, 0}, {58, 0}}, color = {255, 0, 255})); + connect(arduino1.boardConnector, digitalInput1.pinConnector) annotation( + Line(points = {{-60, 0}, {-20, 0}})); + Modelica.Utilities.Streams.print(String(booleanValue1.activePort)); + end ex1_push_button_status; + + model ex2_led_push_button + extends Modelica.Icons.Example; + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-60, 60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.DigitalOutput digitalOutput1(Pin = 9) annotation( + Placement(visible = true, transformation(origin = {-60, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.DigitalInput digitalInput1(Pin = 12) annotation( + Placement(visible = true, transformation(origin = {62, 3.55271e-15}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Boards.customBoard customBoard1(BoardName = "Arduino UNO", Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, 3.55271e-15}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + equation + connect(customBoard1.boardConnector, digitalInput1.pinConnector) annotation( + Line(points = {{0, 0}, {44, 0}, {44, 0}, {42, 0}})); + connect(digitalOutput1.pinConnector, customBoard1.boardConnector) annotation( + Line(points = {{-40, 0}, {0, 0}, {0, 0}, {0, 0}})); + connect(digitalInput1.y, digitalOutput1.u) annotation( + Line(points = {{82, 0}, {94, 0}, {94, -40}, {-92, -40}, {-92, 0}, {-80, 0}, {-80, 0}}, color = {255, 0, 255})); + end ex2_led_push_button; + end Push_button; + + package Ldr + extends Modelica.Icons.ExamplesPackage; + + model ex1_ldr_read + extends Modelica.Icons.Example; + OpenModelicaArduino.Boards.Arduino arduino1(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {-60, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.AnalogInput analogInput1(MaxValue = 1024, MinValue = 0, Pin = 23, adcResolution = 12) annotation( + Placement(visible = true, transformation(origin = {-4.44089e-16, 4.44089e-16}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-60, 60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Interaction.Show.RealValue realValue1(use_numberPort = true) annotation( + Placement(visible = true, transformation(origin = {60, -8.88178e-16}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + equation + connect(analogInput1.y, realValue1.numberPort) annotation( + Line(points = {{20, 0}, {37, 0}}, color = {0, 0, 127})); + connect(arduino1.boardConnector, analogInput1.pinConnector) annotation( + Line(points = {{-60, 0}, {-20, 0}, {-20, 0}, {-20, 0}})); + Modelica.Utilities.Streams.print(String(realValue1.numberPort)); + annotation( + uses(Modelica(version = "3.2.2"))); + end ex1_ldr_read; + + model ex2_ldr_led + extends Modelica.Icons.Example; + OpenModelicaArduino.Pins.DigitalOutput digitalOutput1(Pin = 9) annotation( + Placement(visible = true, transformation(origin = {-60, 20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.AnalogInput analogInput1(MaxValue = 1023, MinValue = 0, Pin = 19) annotation( + Placement(visible = true, transformation(origin = {60, 20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-70, 68}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Sources.Constant const(k = 300) annotation( + Placement(visible = true, transformation(origin = {60, -70}, extent = {{20, -20}, {-20, 20}}, rotation = 0))); + Modelica.Blocks.Logical.Less less1 annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, -40}, extent = {{20, -20}, {-20, 20}}, rotation = 0))); + OpenModelicaArduino.Boards.customBoard customBoard1(BoardName = "Arduino UNO", Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, 20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + equation + connect(customBoard1.boardConnector, analogInput1.pinConnector) annotation( + Line(points = {{0, 20}, {40, 20}, {40, 20}, {40, 20}})); + connect(digitalOutput1.pinConnector, customBoard1.boardConnector) annotation( + Line(points = {{-40, 20}, {0, 20}, {0, 20}, {0, 20}})); + connect(const.y, less1.u2) annotation( + Line(points = {{38, -70}, {32, -70}, {32, -56}, {24, -56}}, color = {0, 0, 127})); + connect(less1.y, digitalOutput1.u) annotation( + Line(points = {{-22, -40}, {-92, -40}, {-92, 20}, {-80, 20}}, color = {255, 0, 255})); + connect(analogInput1.y, less1.u1) annotation( + Line(points = {{80, 20}, {90, 20}, {90, -40}, {24, -40}}, color = {0, 0, 127})); + end ex2_ldr_led; + end Ldr; + + package DC_motor + extends Modelica.Icons.ExamplesPackage; + + model ex1_dcmotor_clock + extends Modelica.Icons.Example; + OpenModelicaArduino.Boards.Arduino arduino1(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {60, 4.21885e-15}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.AnalogOutput analogOutput1(MaxValue = 255, MinValue = 0, Pin = 9) annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, 20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.AnalogOutput analogOutput2(MaxValue = 255, MinValue = 0, Pin = 10) annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, -40}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {60, 60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Sources.Constant const(k = 0) annotation( + Placement(visible = true, transformation(origin = {-60, -40}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Sources.Pulse pulse1(amplitude = 255, period = 20, startTime = 5, width = 15) annotation( + Placement(visible = true, transformation(origin = {-60, 20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + equation + connect(analogOutput2.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{20, -40}, {60, -40}, {60, 0}, {60, 0}})); + connect(analogOutput1.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{20, 20}, {60, 20}, {60, 0}, {60, 0}, {60, 0}})); + connect(const.y, analogOutput2.u) annotation( + Line(points = {{-38, -40}, {-22, -40}, {-22, -40}, {-20, -40}}, color = {0, 0, 127})); + connect(pulse1.y, analogOutput1.u) annotation( + Line(points = {{-38, 20}, {-22, 20}, {-22, 20}, {-20, 20}}, color = {0, 0, 127})); + end ex1_dcmotor_clock; + + model ex2_dcmotor_both + extends Modelica.Icons.Example; + OpenModelicaArduino.Boards.Arduino arduino1(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {60, 4.21885e-15}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {60, 60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.DigitalOutput digitalOutput1(Pin = 8) annotation( + Placement(visible = true, transformation(origin = {1.33227e-15, 26}, extent = {{-14, -14}, {14, 14}}, rotation = 0))); + OpenModelicaArduino.Pins.DigitalOutput digitalOutput2(Pin = 9) annotation( + Placement(visible = true, transformation(origin = {4, -40}, extent = {{-14, -14}, {14, 14}}, rotation = 0))); + Modelica.Blocks.Sources.BooleanPulse booleanPulse1(period = 20) annotation( + Placement(visible = true, transformation(origin = {-65, 25}, extent = {{-13, -13}, {13, 13}}, rotation = 0))); + Modelica.Blocks.Sources.BooleanPulse booleanPulse2(period = 20, startTime = 10) annotation( + Placement(visible = true, transformation(origin = {-60, -40}, extent = {{-14, -14}, {14, 14}}, rotation = 0))); + equation + connect(booleanPulse1.y, digitalOutput1.u) annotation( + Line(points = {{-50, 26}, {-14, 26}}, color = {255, 0, 255})); + connect(digitalOutput1.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{14, 26}, {60, 26}, {60, 0}})); + connect(booleanPulse2.y, digitalOutput2.u) annotation( + Line(points = {{-44, -40}, {-10, -40}}, color = {255, 0, 255})); + connect(digitalOutput2.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{18, -40}, {60, -40}, {60, 0}})); + end ex2_dcmotor_both; + + model ex3_dcmotor_loop + extends Modelica.Icons.Example; + OpenModelicaArduino.Boards.Arduino arduino1(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {60, 4.21885e-15}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.AnalogOutput analogOutput1(MaxValue = 255, MinValue = 0, Pin = 9) annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, 18}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.AnalogOutput analogOutput2(MaxValue = 255, MinValue = 0, Pin = 10) annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, -40}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {60, 60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Sources.Pulse pulse1(amplitude = 255, period = 10, startTime = 5, width = 30) annotation( + Placement(visible = true, transformation(origin = {-60, 20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Sources.Pulse pulse2(amplitude = 255, period = 10, startTime = 10, width = 20) annotation( + Placement(visible = true, transformation(origin = {-60, -40}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + equation + connect(pulse1.y, analogOutput1.u) annotation( + Line(points = {{-38, 20}, {-20, 20}, {-20, 18}}, color = {0, 0, 127})); + connect(analogOutput1.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{20, 18}, {20, 39}, {60, 39}, {60, 0}})); + connect(pulse2.y, analogOutput2.u) annotation( + Line(points = {{-38, -40}, {-20, -40}, {-20, -40}, {-20, -40}}, color = {0, 0, 127})); + connect(analogOutput2.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{20, -40}, {60, -40}, {60, 0}, {60, 0}})); + end ex3_dcmotor_loop; + end DC_motor; + + package Potentiometer + extends Modelica.Icons.ExamplesPackage; + + model ex1_pot_threshold + extends Modelica.Icons.Example; + OpenModelicaArduino.Pins.AnalogInput analogInput1(MaxValue = 1023, MinValue = 0, Pin = 23, adcResolution = 12) annotation( + Placement(visible = true, transformation(origin = {28, 50}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaArduino.Pins.DigitalOutput digitalOutput1(Pin = 9) annotation( + Placement(visible = true, transformation(origin = {-50, 90}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {70, 70}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaArduino.Pins.DigitalOutput digitalOutput2(Pin = 10) annotation( + Placement(visible = true, transformation(origin = {-50, 50}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Logical.GreaterEqualThreshold greaterEqualThreshold1(threshold = 0) annotation( + Placement(visible = true, transformation(origin = {70, 10}, extent = {{10, -10}, {-10, 10}}, rotation = 0))); + Modelica.Blocks.Logical.GreaterEqualThreshold greaterEqualThreshold2(threshold = 320) annotation( + Placement(visible = true, transformation(origin = {70, -30}, extent = {{10, -10}, {-10, 10}}, rotation = 0))); + Modelica.Blocks.Logical.GreaterEqualThreshold greaterEqualThreshold3(threshold = 900) annotation( + Placement(visible = true, transformation(origin = {70, -70}, extent = {{10, -10}, {-10, 10}}, rotation = 0))); + Modelica.Blocks.Logical.Xor xor1 annotation( + Placement(visible = true, transformation(origin = {30, -10}, extent = {{10, -10}, {-10, 10}}, rotation = 0))); + Modelica.Blocks.Logical.Xor xor2 annotation( + Placement(visible = true, transformation(origin = {30, -50}, extent = {{10, -10}, {-10, 10}}, rotation = 0))); + OpenModelicaArduino.Pins.DigitalOutput digitalOutput3(Pin = 11) annotation( + Placement(visible = true, transformation(origin = {-50, 10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaArduino.Boards.customBoard customBoard1(BoardName = "Arduino UNO", Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {-10, 50}, extent = {{-14, -14}, {14, 14}}, rotation = 0))); + equation + connect(analogInput1.pinConnector, customBoard1.boardConnector) annotation( + Line(points = {{18, 50}, {-10, 50}})); + connect(digitalOutput1.pinConnector, customBoard1.boardConnector) annotation( + Line(points = {{-40, 90}, {-10, 90}, {-10, 50}})); + connect(digitalOutput2.pinConnector, customBoard1.boardConnector) annotation( + Line(points = {{-40, 50}, {-10, 50}})); + connect(digitalOutput3.pinConnector, customBoard1.boardConnector) annotation( + Line(points = {{-40, 10}, {-10, 10}, {-10, 50}})); + connect(xor1.y, digitalOutput3.u) annotation( + Line(points = {{20, -10}, {-72, -10}, {-72, 10}, {-60, 10}, {-60, 10}}, color = {255, 0, 255})); + connect(xor2.y, digitalOutput2.u) annotation( + Line(points = {{20, -50}, {-80, -50}, {-80, 50}, {-60, 50}, {-60, 50}}, color = {255, 0, 255})); + connect(greaterEqualThreshold3.y, digitalOutput1.u) annotation( + Line(points = {{60, -70}, {-90, -70}, {-90, 90}, {-60, 90}, {-60, 90}}, color = {255, 0, 255})); + connect(greaterEqualThreshold3.y, xor2.u2) annotation( + Line(points = {{60, -70}, {52, -70}, {52, -58}, {42, -58}, {42, -58}, {42, -58}}, color = {255, 0, 255})); + connect(greaterEqualThreshold2.y, xor2.u1) annotation( + Line(points = {{60, -30}, {52, -30}, {52, -50}, {42, -50}, {42, -50}}, color = {255, 0, 255})); + connect(greaterEqualThreshold2.y, xor1.u2) annotation( + Line(points = {{60, -30}, {52, -30}, {52, -18}, {42, -18}, {42, -18}}, color = {255, 0, 255})); + connect(greaterEqualThreshold1.y, xor1.u1) annotation( + Line(points = {{60, 10}, {50, 10}, {50, -10}, {42, -10}, {42, -10}}, color = {255, 0, 255})); + connect(analogInput1.y, greaterEqualThreshold1.u) annotation( + Line(points = {{38, 50}, {94, 50}, {94, 10}, {82, 10}, {82, 10}}, color = {0, 0, 127})); + connect(analogInput1.y, greaterEqualThreshold2.u) annotation( + Line(points = {{38, 50}, {94, 50}, {94, -30}, {82, -30}, {82, -30}, {82, -30}}, color = {0, 0, 127})); + connect(analogInput1.y, greaterEqualThreshold3.u) annotation( + Line(points = {{38, 50}, {94, 50}, {94, -70}, {82, -70}, {82, -70}}, color = {0, 0, 127})); + annotation( + uses(OpenModelicaArduino(version = "1.2"))); + end ex1_pot_threshold; + end Potentiometer; + + package Thermistor + extends Modelica.Icons.ExamplesPackage; + + model ex1_therm_read + extends Modelica.Icons.Example; + OpenModelicaArduino.Pins.AnalogInput analogInput1(MaxValue = 1023, MinValue = 0, Pin = 18) annotation( + Placement(visible = true, transformation(origin = {-4.44089e-16, 4.44089e-16}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-60, 60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Boards.customBoard customBoard1(BoardName = "Arduino UNO", Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {-59, -1}, extent = {{-21, -21}, {21, 21}}, rotation = 0))); + equation + connect(customBoard1.boardConnector, analogInput1.pinConnector) annotation( + Line(points = {{-58, 0}, {-20, 0}, {-20, 0}, {-20, 0}})); + Modelica.Utilities.Streams.print(String(analogInput1.y)); + end ex1_therm_read; + + model ex2_therm_buzzer + extends Modelica.Icons.Example; + OpenModelicaArduino.Boards.Arduino arduino1(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, 20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.DigitalOutput digitalOutput1(Pin = 3) annotation( + Placement(visible = true, transformation(origin = {-60, 20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.AnalogInput analogInput1(MaxValue = 1023, MinValue = 0, Pin = 18) annotation( + Placement(visible = true, transformation(origin = {60, 20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-70, 68}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Sources.Constant const(k = 500) annotation( + Placement(visible = true, transformation(origin = {60, -70}, extent = {{20, -20}, {-20, 20}}, rotation = 0))); + Modelica.Blocks.Logical.Greater greater1 annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, -40}, extent = {{20, -20}, {-20, 20}}, rotation = 0))); + Modelica.Blocks.Interaction.Show.RealValue realValue1 annotation( + Placement(visible = true, transformation(origin = {40, 60}, extent = {{20, -20}, {-20, 20}}, rotation = 0))); + equation + connect(analogInput1.y, realValue1.numberPort) annotation( + Line(points = {{80, 20}, {90, 20}, {90, 60}, {64, 60}, {64, 60}}, color = {0, 0, 127})); + connect(greater1.y, digitalOutput1.u) annotation( + Line(points = {{-22, -40}, {-94, -40}, {-94, 20}, {-80, 20}, {-80, 20}}, color = {255, 0, 255})); + connect(analogInput1.y, greater1.u1) annotation( + Line(points = {{80, 20}, {92, 20}, {92, -40}, {24, -40}, {24, -40}}, color = {0, 0, 127})); + connect(greater1.u2, const.y) annotation( + Line(points = {{24, -56}, {32, -56}, {32, -70}, {38, -70}, {38, -70}}, color = {0, 0, 127})); + connect(arduino1.boardConnector, analogInput1.pinConnector) annotation( + Line(points = {{0, 20}, {40, 20}})); + connect(digitalOutput1.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{-40, 20}, {0, 20}})); + Modelica.Utilities.Streams.print(String(realValue1.numberPort)); + annotation( + uses(Modelica(version = "3.2.2"))); + end ex2_therm_buzzer; + end Thermistor; + + package Servo_motor + extends Modelica.Icons.ExamplesPackage; + + model ex1_servo_init + extends Modelica.Icons.Example; + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {70, 70}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaArduino.Boards.Arduino arduino1(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {78, 20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.Servo servo1(InputUnit = OpenModelicaArduino.Internal.Types.ServoUnit.None, MaxPulse = 1000000, MinPulse = 500000, Pin = 23) annotation( + Placement(visible = true, transformation(origin = {20, 20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Sources.Constant const(k = 0.1667) annotation( + Placement(visible = true, transformation(origin = {-40, 20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + equation + connect(const.y, servo1.u) annotation( + Line(points = {{-18, 20}, {-4, 20}, {-4, 20}, {0, 20}}, color = {0, 0, 127})); + connect(servo1.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{40, 20}, {76, 20}, {76, 18}, {78, 18}, {78, 20}})); + annotation( + uses(Modelica_DeviceDrivers(version = "1.5.0"), OpenModelicaArduino(version = "1.2"), Modelica(version = "3.2.2"))); + end ex1_servo_init; + + model ex2_servo_reverse + extends Modelica.Icons.Example; + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {70, 70}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaArduino.Boards.Arduino arduino1(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {78, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.Servo servo1(InputUnit = OpenModelicaArduino.Internal.Types.ServoUnit.None, MaxPulse = 1000000, MinPulse = 500000, Pin = 3) annotation( + Placement(visible = true, transformation(origin = {20, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Sources.Pulse pulse2(amplitude = 0.5, offset = 0.5, period = 2, startTime = 6, width = 50) annotation( + Placement(visible = true, transformation(origin = {-80, -60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Math.Product product1 annotation( + Placement(visible = true, transformation(origin = {-40, 1.77636e-15}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Sources.Constant const(k = 0.5) annotation( + Placement(visible = true, transformation(origin = {-80, 60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + equation + connect(const.y, product1.u1) annotation( + Line(points = {{-58, 60}, {-36, 60}, {-36, 24}, {-80, 24}, {-80, 10}, {-64, 10}, {-64, 12}}, color = {0, 0, 127})); + connect(pulse2.y, product1.u2) annotation( + Line(points = {{-58, -60}, {-48, -60}, {-48, -24}, {-80, -24}, {-80, -12}, {-64, -12}, {-64, -12}}, color = {0, 0, 127})); + connect(product1.y, servo1.u) annotation( + Line(points = {{-18, 0}, {0, 0}, {0, 0}, {0, 0}}, color = {0, 0, 127})); + connect(servo1.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{40, 0}, {78, 0}})); + annotation( + uses(Modelica_DeviceDrivers(version = "1.5.0"), OpenModelicaArduino(version = "1.2"), Modelica(version = "3.2.2"))); + end ex2_servo_reverse; + + model ex3_servo_loop + extends Modelica.Icons.Example; + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {70, 70}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaArduino.Boards.Arduino arduino1(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {78, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.Servo servo1(InputUnit = OpenModelicaArduino.Internal.Types.ServoUnit.None, MaxPulse = 1000000, MinPulse = 500000, Pin = 23) annotation( + Placement(visible = true, transformation(origin = {20, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Sources.Ramp ramp1(duration = 10, height = 10, startTime = 5) annotation( + Placement(visible = true, transformation(origin = {-90, -70}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Math.RealToInteger realToInteger1 annotation( + Placement(visible = true, transformation(origin = {-50, -70}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Sources.Constant const(k = 0.11) annotation( + Placement(visible = true, transformation(origin = {-70, 68}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Math.Product product1 annotation( + Placement(visible = true, transformation(origin = {-28, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Math.IntegerToReal integerToReal1 annotation( + Placement(visible = true, transformation(origin = {-10, -70}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + equation + connect(integerToReal1.y, product1.u2) annotation( + Line(points = {{2, -70}, {14, -70}, {14, -36}, {-56, -36}, {-56, -6}, {-40, -6}, {-40, -6}}, color = {0, 0, 127})); + connect(realToInteger1.y, integerToReal1.u) annotation( + Line(points = {{-38, -70}, {-22, -70}, {-22, -70}, {-22, -70}}, color = {255, 127, 0})); + connect(ramp1.y, realToInteger1.u) annotation( + Line(points = {{-78, -70}, {-62, -70}}, color = {0, 0, 127})); + connect(const.y, product1.u1) annotation( + Line(points = {{-58, 68}, {-52, 68}, {-52, 6}, {-40, 6}, {-40, 6}}, color = {0, 0, 127})); + connect(product1.y, servo1.u) annotation( + Line(points = {{-16, 0}, {0, 0}, {0, 0}, {0, 0}}, color = {0, 0, 127})); + connect(servo1.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{40, 0}, {78, 0}})); + annotation( + uses(Modelica_DeviceDrivers(version = "1.5.0"), OpenModelicaArduino(version = "1.2"), Modelica(version = "3.2.2"))); + end ex3_servo_loop; + + model ex4_servo_pot + extends Modelica.Icons.Example; + OpenModelicaArduino.Boards.Arduino arduino1(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {60, 3.10862e-15}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.Servo servo1(InputUnit = OpenModelicaArduino.Internal.Types.ServoUnit.None, MaxPulse = 1000000, MinPulse = 500000, Pin = 9) annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, 3.55271e-15}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Pins.AnalogInput analogInput1(MaxValue = 1, MinValue = 0, Pin = 16) annotation( + Placement(visible = true, transformation(origin = {-60, 3.55271e-15}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-60, 60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + equation + connect(analogInput1.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{-80, 0}, {-92, 0}, {-92, -52}, {60, -52}, {60, 0}, {60, 0}})); + connect(servo1.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{20, 0}, {62, 0}, {62, 0}, {60, 0}, {60, 0}})); + connect(analogInput1.y, servo1.u) annotation( + Line(points = {{-40, 0}, {-16, 0}, {-16, 0}, {-20, 0}}, color = {0, 0, 127})); + annotation( + uses(OpenModelicaArduino(version = "1.2"), Modelica_DeviceDrivers(version = "1.5.0"))); + end ex4_servo_pot; + end Servo_motor; + end ArduinoExamples; + annotation( + preferredView = "info", + Diagram(coordinateSystem(extent = {{-148.5, -105}, {148.5, 105}}, preserveAspectRatio = true, initialScale = 0.1, grid = {5, 5})), + Documentation(info = "ModelPlug is a library that allows you to connect your simulations with the real world. It uses an Arduino board (or compatible) to send analog and digital signals to physical devices and receive signals from them.
+ ++
With ModelPlug, you can combine simulation models and real hardware. For example, you can get data from your hardware, design a control, and test it in real time.
++ +
You can build a real control panel and use it to control your simulation models.
+ +ModelPlug provides the following components:
++ | Inputs | ++ |
Analog input | +Reads analog values from the pins | ++ |
Digital input | +Reads digital values from the pins | ++ |
+ | Output | ++ |
Analog output | +Writes analog values to the pins | ++ |
Digital output | +Writes digital values to the pins | ++ |
Servo control | +Writes the angle to servo motors | ++ |
+ | Board Handlers | ++ |
Arduino | +Connects to Arduino boards like Arduino Uno, Arduino Mega 2560 | ++ |
Arduino Leonardo | +Connects to Arduino Leonardo boards and boards using native USB | ++ |
StandardFirmata | +Connects to Arduino-compatible boards | ++ |
CustomFirmata | +Connects to any board supporting Firmata | ++ |
ModelPlug connects with the boards using USB serial communication. In order to configure, read, and write to the board, ModelPlug uses the Firmata protocol v2.3 (http://www.firmata.org). This protocol allows you to connect not only to Arduinos, but also to many boards compatible with Arduino. Examples of other boards supporting the Firmata protocol are:
+ModelPlug wraps the functionality of Firmata by providing easy-to-use Modelica models that you can connect in your simulations.
+ModelPlug requires a board with Firmata Version 2.3 or higher.
+Currently ModelPlug does not support sensors that communicate through I2C or SPI with the board.
+The minimum synchronization interval is 1 ms; therefore, ModelPlug cannot have a sampling interval smaller than that. The standard Firmata allows a minimum sampling interval of 10 ms.
ModelPlug uses a serial protocol; therefore, the transfer speed is constrained by the serial port speed. This can be problematic when reading or writing too many inputs/outputs with a small sampling interval.
Ask questions about SystemModeler and ModelPlug
+ +Find out how to connect sensors and actuators to the Arduino
+ +Get details about the Firmata protocol
+ +The breadboard diagrams were created using Fritzing
+ ++
+
", revisions = ""), + version = "1.2", + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {5, 5}), graphics = {Rectangle(visible = true, fillColor = {190, 53, 19}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -100}, {100, 100}}, radius = 25), Polygon(visible = true, origin = {-17.857, -4.643}, fillColor = {128, 128, 128}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{42.857, 59.643}, {42.857, 64.643}, {37.857, 69.643}, {32.857, 69.643}, {-17.143, 69.643}, {-42.143, 54.643}, {-57.143, 34.643}, {-65.22199999999999, 4.643}, {-57.143, -25.357}, {-42.143, -45.357}, {-17.143, -60.357}, {32.857, -60.357}, {37.857, -60.357}, {42.857, -55.357}, {42.857, -50.357}}, smooth = Smooth.Bezier), Polygon(visible = true, origin = {-17.857, -4.643}, fillColor = {255, 255, 255}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{42.857, 59.643}, {42.857, 64.643}, {37.857, 69.643}, {30.028, 54.643}, {-12.143, 59.643}, {-37.143, 44.643}, {-50.141, 26.339}, {-55.168, 4.643}, {-52.143, -20.357}, {-42.143, -42.453}, {-17.143, -60.357}, {32.857, -60.357}, {37.857, -60.357}, {42.857, -55.357}, {42.857, -50.357}}, smooth = Smooth.Bezier), Rectangle(visible = true, origin = {50, 27.5}, lineColor = {128, 128, 128}, fillColor = {255, 255, 255}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-25, -12.5}, {25, 12.5}}), Rectangle(visible = true, origin = {50, -27.5}, lineColor = {128, 128, 128}, fillColor = {255, 255, 255}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-25, -12.5}, {25, 12.5}}), Polygon(visible = true, origin = {-23.077, -0.385}, fillColor = {191, 191, 191}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{38.077, 50.385}, {38.077, 55.385}, {33.077, 55.385}, {-6.923, 55.385}, {-26.923, 45.385}, {-41.923, 30.385}, {-50.213, 0.385}, {-41.923, -29.615}, {-26.923, -44.615}, {-6.923, -54.615}, {33.077, -54.615}, {38.077, -54.615}, {38.077, -49.615}}, smooth = Smooth.Bezier), Polygon(visible = true, origin = {-17.857, -4.643}, lineColor = {128, 128, 128}, fillColor = {128, 128, 128}, points = {{42.857, 59.643}, {42.857, 64.643}, {37.857, 69.643}, {32.857, 69.643}, {-17.143, 69.643}, {-42.143, 54.643}, {-57.143, 34.643}, {-65.22199999999999, 4.643}, {-57.143, -25.357}, {-42.143, -45.357}, {-17.143, -60.357}, {32.857, -60.357}, {37.857, -60.357}, {42.857, -55.357}, {42.857, -50.357}}, smooth = Smooth.Bezier)}), + Diagram(coordinateSystem(extent = {{-148.5, -105}, {148.5, 105}}, preserveAspectRatio = true, initialScale = 0.1, grid = {5, 5})), + uses(Modelica_DeviceDrivers(version = "1.5.0"), Modelica(version = "3.2.2"))); +end OpenModelicaEmbedded; diff --git a/Examples.mo b/Examples.mo new file mode 100644 index 0000000..28a3f29 --- /dev/null +++ b/Examples.mo @@ -0,0 +1,374 @@ + package Examples "A collection of examples to help you get started" + extends Modelica.Icons.ExamplesPackage; + + model BlinkLed "Basic example of blinking an LED" + extends Modelica.Icons.Example; + replaceable OpenModelicaArduino.Boards.Arduino arduino(Port = "/dev/ttyACM0", ShowPinCapabilities = true, UseDTR = false) annotation( + Placement(visible = true, transformation(origin = {30, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaArduino.Pins.DigitalOutput digitalOutput(Pin = 30) annotation( + Placement(visible = true, transformation(origin = {0, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {35, 15}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Sources.BooleanPulse booleanPulse annotation( + Placement(visible = true, transformation(origin = {-30, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + equation + connect(digitalOutput.pinConnector, arduino.boardConnector) annotation( + Line(points = {{10, -10}, {30, -10}}, color = {72, 73, 79})); + connect(booleanPulse.y, digitalOutput.u) annotation( + Line(points = {{-19, -10}, {-10, -10}}, color = {255, 0, 255})); + annotation( + experiment(StopTime = 10, Interval = 0.001), + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = false, initialScale = 0.1, grid = {10, 10})), + preferredView = "diagram", + Documentation(info = "
This example uses the DigitalOutput component to control the LED attached to the Arduino board on pin 13. It uses a BooleanPulse from the Modelica library to produce an On/Off signal that is fed into the DigitalOutput component. This will make the LED attached to the pin blink.
+You can go ahead and add more LEDs to the board as shown in the following figure. This will require you to add one more DigitalOutput component to control the LED on pin 9.
+", revisions = ""), + Diagram(coordinateSystem(extent = {{-50, -50}, {50, 50}}, initialScale = 0.1, grid = {5, 5}))); + end BlinkLed; + + model DimmingLed "Changing the intensity of an LED" + extends Modelica.Icons.Example; + OpenModelicaArduino.Boards.Arduino arduino(Port = "/dev/ttyACM0", ShowPinCapabilities = true) annotation( + Placement(visible = true, transformation(origin = {30, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Pins.AnalogOutput analogOutput(MaxValue = 512, MinValue = -512, Pin = 30) annotation( + Placement(visible = true, transformation(origin = {0, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {35, 25}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaArduino.Pins.AnalogInput analogInput1(MaxValue = 512, MinValue = -512, Pin = 23) annotation( + Placement(visible = true, transformation(origin = {-30, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + equation + connect(analogInput1.pinConnector, arduino.boardConnector) annotation( + Line(points = {{-40, -10}, {-45, -10}, {-45, -40}, {30, -40}, {30, -10}, {30, -10}})); + connect(analogInput1.y, analogOutput.u) annotation( + Line(points = {{-20, -10}, {-10, -10}, {-10, -10}, {-10, -10}}, color = {0, 0, 127})); + connect(analogOutput.pinConnector, arduino.boardConnector) annotation( + Line(visible = true, origin = {20, -10}, points = {{-10, -0}, {10, 0}})); + annotation( + experiment(Interval = 0.001, __Wolfram_SynchronizeWithRealTime = true), + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = false, initialScale = 0.1, grid = {10, 10})), + preferredView = "diagram", + Documentation(info = "This example uses the AnalogOutput component to change the light intensity of an LED. AnalogOutput uses the Arduino function 'analogWrite', which produces a PWM (Pulse-Width Modulated) signal. This type of signal can be used to directly control the LED intensity. The following figure shows the connections.
+ +You can check the Arduino Playground to know more about PWM outputs.
", revisions = ""), + Diagram(coordinateSystem(extent = {{-50, -50}, {50, 50}}, initialScale = 0.1, grid = {5, 5}))); + end DimmingLed; + + model ReadSensor "Reading analog signals" + extends Modelica.Icons.Example; + OpenModelicaArduino.Boards.Arduino arduino(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {0, 15}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaArduino.Pins.DigitalOutput digitalOutput(Pin = 10) annotation( + Placement(visible = true, transformation(origin = {-30, 15}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaArduino.Pins.AnalogInput analogInput1(Pin = 16) annotation( + Placement(visible = true, transformation(origin = {30, 15}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Logical.Greater greater1 annotation( + Placement(visible = true, transformation(origin = {-10, -15}, extent = {{10, -10}, {-10, 10}}, rotation = 0))); + Modelica.Blocks.Sources.Constant Reference(k = 0.5) annotation( + Placement(visible = true, transformation(origin = {30, -30}, extent = {{-10, -10}, {10, 10}}, rotation = -180))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-30, -40}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + equation + connect(greater1.y, digitalOutput.u) annotation( + Line(visible = true, origin = {-38.744, -2.5}, points = {{17.744, -12.5}, {-6.256, -12.5}, {-6.256, 17.5}, {-1.256, 17.5}}, color = {255, 0, 255})); + connect(analogInput1.y, greater1.u1) annotation( + Line(visible = true, origin = {33.994, -5}, points = {{6.006, 20}, {11.006, 20}, {11.006, 0}, {-23.994, 0}, {-23.994, -10}, {-31.994, -10}}, color = {0, 0, 127})); + connect(analogInput1.pinConnector, arduino.boardConnector) annotation( + Line(visible = true, origin = {10, 15}, points = {{10, 0}, {-10, 0}}, color = {72, 73, 79})); + connect(digitalOutput.pinConnector, arduino.boardConnector) annotation( + Line(visible = true, origin = {-10, 15}, points = {{-10, 0}, {10, 0}}, color = {72, 73, 79})); + connect(Reference.y, greater1.u2) annotation( + Line(visible = true, origin = {12.75, -29}, points = {{6.25, -1}, {-2.75, -1}, {-2.75, 6}, {-10.75, 6}}, color = {0, 0, 127})); + annotation( + experiment(StartTime = 0.0, StopTime = 10.0, Interval = 0.001, __Wolfram_Algorithm = "dassl", Tolerance = 1e-006, __Wolfram_SynchronizeWithRealTime = true), + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = false, initialScale = 0.1, grid = {10, 10})), + preferredView = "diagram", + Documentation(info = "This example shows how to read an analog voltage using the AnalogInput component. The analog signal is then compared to a reference, and if the signal is above the reference, it will turn on an LED. You can see in the following figure how to build this example.
+ +You can see that pin A0 for the Arduino corresponds to pin number 14 for the Firmata. For other boards, the pin numbering may vary.
+Run the simulation and move the potentiometer. You should see that when the position of the shaft is near the middle, the LED changes state.
+The AnalogInput component returns a signal between 0 and 1. This value represents the voltage between 0 and the reference voltage. If you prefer to get the signal directly in volts, you need to change the 'MaxValue' property to the reference voltage, but generally it is either 5 V or 3.3 V.
", revisions = ""), + Diagram(coordinateSystem(extent = {{-50, -50}, {50, 50}}, initialScale = 0.1, grid = {5, 5}))); + end ReadSensor; + + model MoveServo "Using servos" + extends Modelica.Icons.Example; + Boards.Arduino arduino(Port = "COM1") annotation( + Placement(visible = true, transformation(origin = {30, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Pins.Servo servo(Pin = 10) annotation( + Placement(visible = true, transformation(origin = {0, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Sources.ExpSine expSine(offset = 0.5, amplitude = 0.5, freqHz = 0.4, damping = 0.1) annotation( + Placement(visible = true, transformation(origin = {-30, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-25, 35}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + equation + connect(expSine.y, servo.u) annotation( + Line(visible = true, origin = {-14.5, -10}, points = {{-4.5, -0}, {4.5, 0}}, color = {0, 0, 127})); + connect(servo.pinConnector, arduino.boardConnector) annotation( + Line(visible = true, origin = {20, -10}, points = {{-10, 0}, {10, -0}}, color = {72, 73, 79})); + annotation( + experiment(Interval = 0.001, __Wolfram_SynchronizeWithRealTime = true), + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = false, initialScale = 0.1, grid = {10, 10})), + preferredView = "diagram", + Documentation(info = "This example shows how to control a servo by using the Servo component. You can find the diagram in the following figure.
+For this example, it is recommended to use an external power source to provide voltage for the servo. This is because the power from the Arduino may not be enough to supply the servo. If you are not sure how to connect your servo, take a look at the reference in the Arduino Playground (http://playground.arduino.cc).
+ +Servos are controlled with a signal in the range of 0 to 1, where 0 corresponds to 0 degrees of rotation and 1 to 180 degrees. This example makes the servo bounce from 0 to 180 degrees until it gets stable around 90 degrees.
", revisions = ""), + Diagram(coordinateSystem(extent = {{-50, -50}, {50, 50}}, initialScale = 0.1, grid = {5, 5}))); + end MoveServo; + + model SimpleONOFF "A simple On/Off controller" + extends Modelica.Icons.Example; + OpenModelicaArduino.Boards.Arduino arduino(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {0, 15}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaArduino.Pins.AnalogInput analogInput1(MaxValue = 3.3 * 100, Pin = 23, adcResolution = 12) annotation( + Placement(visible = true, transformation(origin = {30, 15}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Sources.Constant Reference(k = 40) annotation( + Placement(visible = true, transformation(origin = {35, -25}, extent = {{-10, -10}, {10, 10}}, rotation = -180))); + Modelica.Blocks.Math.Add add1(k2 = +1, k1 = -1) annotation( + Placement(visible = true, transformation(origin = {-0, -25}, extent = {{10, -10}, {-10, 10}}, rotation = 0))); + Pins.DigitalOutput digitalOutput(Pin = 30) annotation( + Placement(visible = true, transformation(origin = {-30, 15}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Logical.Hysteresis hysteresis(uLow = -1, uHigh = 1) annotation( + Placement(visible = true, transformation(origin = {-30, -25}, extent = {{10, -10}, {-10, 10}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {42.5, 42.5}, extent = {{-7.5, -7.5}, {7.5, 7.5}}, rotation = 0))); + equation + connect(hysteresis.u, add1.y) annotation( + Line(visible = true, origin = {-14.5, -25}, points = {{-3.5, -0}, {3.5, 0}}, color = {0, 0, 127})); + connect(digitalOutput.u, hysteresis.y) annotation( + Line(visible = true, origin = {-43.25, 5}, points = {{3.25, 10}, {-1.75, 10}, {-1.75, -30}, {2.25, -30}}, color = {255, 0, 255})); + connect(digitalOutput.pinConnector, arduino.boardConnector) annotation( + Line(visible = true, origin = {-10, 15}, points = {{-10, 0}, {10, 0}})); + connect(add1.u2, Reference.y) annotation( + Line(visible = true, origin = {18.5, -23}, points = {{-6.5, -8}, {1.5, -8}, {1.5, -2}, {5.5, -2}}, color = {0, 0, 127})); + connect(analogInput1.y, add1.u1) annotation( + Line(visible = true, origin = {33.506, 12}, points = {{6.494, 3}, {11.494, 3}, {11.494, -17}, {-13.506, -17}, {-13.506, -31}, {-21.506, -31}}, color = {0, 0, 127})); + connect(arduino.boardConnector, analogInput1.pinConnector) annotation( + Line(visible = true, origin = {10, 15}, points = {{-10, 0}, {10, 0}})); + annotation( + experiment(Interval = 0.001, __Wolfram_SynchronizeWithRealTime = true), + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = false, initialScale = 0.1, grid = {10, 10})), + preferredView = "diagram", + Documentation(info = "This example is a simple ON/OFF controller and can be used for either heating or cooling. It uses an LM35 to read the temperature, and based on that temperature, the controller switches a relay on or off. You can attach a fan or a heater to the relay, depending on the operation you want to perform. You can find the diagram in the following figure.
Note: You need to be careful when using relays that control electrical equipment using AC voltage, because an incorrect connection may damage your board.
The target temperature is set by a constant component. The measured temperature is subtracted from the reference in order to obtain the error. The error signal is fed into the hysteresis component, which will send a Boolean signal to control the relay. If you want cooling instead of heating, you need to invert the logic of this signal.
"), + Diagram(coordinateSystem(extent = {{-50, -50}, {50, 50}}, initialScale = 0.1, grid = {5, 5}))); + end SimpleONOFF; + + model UsingArduinoLeonardo "Basic example of blinking an LED" + extends OpenModelicaArduino.Examples.BlinkLed(redeclare ModelPlug.Boards.ArduinoLeonardo arduino); + annotation( + experiment(StopTime = 10, Interval = 0.001, __Wolfram_SynchronizeWithRealTime = true), + Documentation(info = "This example shows how the + Blink Led can be used with an Arduino Leonardo.
", revisions = "")); + end UsingArduinoLeonardo; + + model UsingCustomBoard "Using a Firmata-compatible board" + extends Modelica.Icons.Example; + Modelica.Blocks.Sources.BooleanPulse booleanPulse(period = 1) annotation( + Placement(visible = true, transformation(origin = {-30, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Pins.DigitalOutput digitalOutput(Pin = 13) annotation( + Placement(visible = true, transformation(origin = {-0, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Boards.CustomFirmata customFirmata(Port = "COM1", BaudRate = 115200, UpdatePeriod = 0.001) annotation( + Placement(visible = true, transformation(origin = {30, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-30, 30}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + equation + connect(digitalOutput.pinConnector, customFirmata.boardConnector) annotation( + Line(visible = true, origin = {20, -10}, points = {{-10, 0}, {10, -0}})); + connect(booleanPulse.y, digitalOutput.u) annotation( + Line(visible = true, origin = {-14.5, -10}, points = {{-4.5, 0}, {4.5, 0}}, color = {255, 0, 255})); + annotation( + experiment(Interval = 0.001, __Wolfram_SynchronizeWithRealTime = true), + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = false, initialScale = 0.1, grid = {10, 10})), + preferredView = "diagram", + Documentation(info = "- 1 Teensy 3.1 board
+This example shows how to use a board with a custom version of Firmata. The Teensy board works perfectly with the StandardFirmata, but in this example it is modified in order get a faster data transfer speed.
+ +
The main difference of the CustomFirmata component is that it allows you to set the baud rate to the sampling interval that you want to use. In this case the oce of the StandardFirmata is modified to use a baud rate of 115200. You can perform this modification in the source code. Search for the line:
Firmata.Begin(57600);
+and changing it to
+Firmata.Begin(115200);
+This initializes the serial port at the given speed. The next change that you can make is reducing the minimum sampling interval. You can find this tweak by searching in the code the text:
+#define MINIMUM_SAMPLING_INTERVAL 10
+and changing it to
+#define MINIMUM_SAMPLING_INTERVAL 1
+This changes the sampling interval limit from 10 ms to 1ms. You have to consider that this change is possible because the Teensy board can run up to 96 MHz. If you change the sampling interval, it is necessary to change the simulation setting in SimulationCenter to 1 ms, as shown in the following figure.
+ ", revisions = ""), + Diagram(coordinateSystem(extent = {{-50, -50}, {50, 50}}, initialScale = 0.1, grid = {5, 5}))); + end UsingCustomBoard; + + model UsingStandardFirmata "Using a standard Firmata board" + extends Modelica.Icons.Example; + Boards.StandardFirmata standardFirmata(Port = "COM1", ShowPinCapabilities = true) annotation( + Placement(visible = true, transformation(origin = {30, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaArduino.Pins.DigitalOutput digitalOutput(Pin = 13) annotation( + Placement(visible = true, transformation(origin = {-0, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Sources.BooleanPulse booleanPulse(period = 1) annotation( + Placement(visible = true, transformation(origin = {-30, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-35, 40}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + equation + connect(digitalOutput.pinConnector, standardFirmata.boardConnector) annotation( + Line(visible = true, origin = {20, -10}, points = {{-10, 0}, {10, 0}}, color = {72, 73, 79})); + connect(booleanPulse.y, digitalOutput.u) annotation( + Line(visible = true, origin = {-14.5, -10}, points = {{-4.5, 0}, {4.5, 0}}, color = {255, 0, 255})); + annotation( + experiment(StopTime = 10, Interval = 0.001, __Wolfram_SynchronizeWithRealTime = true), + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = false, initialScale = 0.1, grid = {10, 10})), + preferredView = "diagram", + Documentation(info = "This example uses the DigitalOutput component to control the LED attached to a standard Firmata board on pin 13. It uses a BooleanPulse from the Modelica library to produce an On/Off signal that is fed into the DigitalOutput component. This will make the LED attached to the pin blink.
+You can go ahead and add more LEDs to the board as shown in the following figure. This will require you to add one more DigitalOutput component to control the LED on pin 9.
+ ", revisions = ""), + Diagram(coordinateSystem(extent = {{-50, -50}, {50, 50}}, initialScale = 0.1, grid = {5, 5}))); + end UsingStandardFirmata; + + model DCMotorWithPWM + extends Modelica.Icons.Example; + OpenModelicaArduino.Boards.customBoard customBoard1(BoardName = "Arduino UNO", Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {13, 29}, extent = {{-25, -25}, {25, 25}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {54, 78}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaArduino.Pins.AnalogOutput analogOutput1(MaxValue = 255, Pin = 30) annotation( + Placement(visible = true, transformation(origin = {-57, 29}, extent = {{-15, -15}, {15, 15}}, rotation = 0))); + OpenModelicaArduino.Pins.DigitalOutput digitalOutput1(Pin = 8) annotation( + Placement(visible = true, transformation(origin = {-45, -23}, extent = {{-13, -13}, {13, 13}}, rotation = 90))); + OpenModelicaArduino.Pins.DigitalOutput digitalOutput2(Pin = 9) annotation( + Placement(visible = true, transformation(origin = {50, -28}, extent = {{-10, -10}, {10, 10}}, rotation = 90))); + Modelica.Blocks.Sources.BooleanConstant booleanConstant1(k = true) annotation( + Placement(visible = true, transformation(origin = {-70, -70}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Sources.BooleanConstant booleanConstant2(k = false) annotation( + Placement(visible = true, transformation(origin = {14, -74}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaArduino.Pins.AnalogInput analogInput1(MaxValue = 1024, Pin = 23) annotation( + Placement(visible = true, transformation(origin = {-56, 74}, extent = {{-14, -14}, {14, 14}}, rotation = 0))); + equation + connect(analogInput1.y, analogOutput1.u) annotation( + Line(points = {{-42, 74}, {-20, 74}, {-20, 52}, {-90, 52}, {-90, 28}, {-72, 28}, {-72, 30}}, color = {0, 0, 127})); + connect(analogInput1.pinConnector, customBoard1.boardConnector) annotation( + Line(points = {{-70, 74}, {-88, 74}, {-88, 92}, {12, 92}, {12, 30}, {14, 30}})); + connect(digitalOutput1.pinConnector, customBoard1.boardConnector) annotation( + Line(points = {{-45, -10}, {-44.75, -10}, {-44.75, -2}, {14, -2}, {14, 30}})); + connect(booleanConstant1.y, digitalOutput1.u) annotation( + Line(points = {{-58, -70}, {-46, -70}, {-46, -36}, {-45, -36}}, color = {255, 0, 255})); + connect(booleanConstant2.y, digitalOutput2.u) annotation( + Line(points = {{26, -74}, {50, -74}, {50, -40}, {49, -40}, {49, -38}, {50, -38}}, color = {255, 0, 255})); + connect(digitalOutput2.pinConnector, customBoard1.boardConnector) annotation( + Line(points = {{50, -18}, {50, 30}, {14, 30}})); + connect(analogOutput1.pinConnector, customBoard1.boardConnector) annotation( + Line(points = {{-42, 30}, {13, 30}, {13, 29}})); + annotation( + uses(OpenModelicaArduino(version = "1.2"), Modelica(version = "3.2.2"), Modelica_DeviceDrivers(version = "1.5.0"))); + end DCMotorWithPWM; + + model DCMotorWithPID + extends Modelica.Icons.Example; + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1(priority = "High", setPriority = true) annotation( + Placement(visible = true, transformation(origin = {92, 88}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Mechanics.Rotational.Components.Inertia inertia1(J = 1, a(start = 0), phi(start = 0), w(start = 0)) annotation( + Placement(visible = true, transformation(origin = {-22, -86}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Mechanics.Rotational.Components.Inertia inertia2(J = 1, a(start = 0), phi(start = 0), w(start = 0)) annotation( + Placement(visible = true, transformation(origin = {56, -86}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Mechanics.Rotational.Components.SpringDamper springDamper1(c = 20, d = 10, phi_rel0 = 0) annotation( + Placement(visible = true, transformation(origin = {16, -86}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Mechanics.Rotational.Sources.Torque torque1 annotation( + Placement(visible = true, transformation(origin = {-64, -86}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Mechanics.Rotational.Sources.ConstantTorque constantTorque1(tau_constant = 10) annotation( + Placement(visible = true, transformation(origin = {98, -86}, extent = {{10, -10}, {-10, 10}}, rotation = 0))); + Modelica.Mechanics.Rotational.Sensors.SpeedSensor speedSensor1 annotation( + Placement(visible = true, transformation(origin = {88, -36}, extent = {{-10, -10}, {10, 10}}, rotation = 90))); + OpenModelicaArduino.Boards.CustomFirmata customFirmata1(BaudRate = 57600, Port = "/dev/ttyACM0", ShowPinCapabilities = true, UpdatePeriod = 0.02, UseDTR = true) annotation( + Placement(visible = true, transformation(origin = {-10, 4}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaArduino.Pins.AnalogOutput analogOutput1(MaxValue = 512, MinValue = -512, Pin = 5) annotation( + Placement(visible = true, transformation(origin = {46, 2}, extent = {{10, -10}, {-10, 10}}, rotation = 0))); + OpenModelicaArduino.Pins.AnalogInput analogInput1(InitValue = 0, MaxValue = 512, MinValue = -512, Pin = 15) annotation( + Placement(visible = true, transformation(origin = {-64, 2}, extent = {{10, -10}, {-10, 10}}, rotation = 0))); + OpenModelicaArduino.Pins.AnalogOutput analogOutput2(MaxValue = 512, MinValue = -512, Pin = 6) annotation( + Placement(visible = true, transformation(origin = {-54, 58}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Sources.Sine sine1(amplitude = 512, freqHz = 0.5) annotation( + Placement(visible = true, transformation(origin = {-122, 58}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + equation + connect(sine1.y, analogOutput2.u) annotation( + Line(points = {{-110, 58}, {-64, 58}, {-64, 58}, {-64, 58}}, color = {0, 0, 127})); + connect(analogOutput2.pinConnector, customFirmata1.boardConnector) annotation( + Line(points = {{-44, 58}, {-10, 58}, {-10, 4}})); + connect(analogInput1.y, torque1.tau) annotation( + Line(points = {{-74, 2}, {-84, 2}, {-84, 2}, {-94, 2}, {-94, -86}, {-76, -86}}, color = {0, 0, 127})); + connect(analogInput1.pinConnector, customFirmata1.boardConnector) annotation( + Line(points = {{-54, 2}, {-10, 2}, {-10, 4}})); + connect(speedSensor1.w, analogOutput1.u) annotation( + Line(points = {{88, -25}, {89, -25}, {89, -23}, {88, -23}, {88, 3}, {56, 3}, {56, 1}}, color = {0, 0, 127})); + connect(analogOutput1.pinConnector, customFirmata1.boardConnector) annotation( + Line(points = {{36, 2}, {35.5, 2}, {35.5, 2}, {35, 2}, {35, 4}, {-10, 4}})); + connect(speedSensor1.flange, constantTorque1.flange) annotation( + Line(points = {{88, -46}, {88, -86}})); + connect(inertia2.flange_b, constantTorque1.flange) annotation( + Line(points = {{66, -86}, {88, -86}, {88, -86}, {88, -86}, {88, -86}, {88, -86}})); + connect(torque1.flange, inertia1.flange_a) annotation( + Line(points = {{-54, -86}, {-37, -86}, {-37, -86}, {-32, -86}, {-32, -86}, {-31, -86}, {-31, -86}, {-32, -86}})); + connect(springDamper1.flange_b, inertia2.flange_a) annotation( + Line(points = {{26, -86}, {36, -86}, {36, -86}, {46, -86}, {46, -86}, {46, -86}})); + connect(inertia1.flange_b, springDamper1.flange_a) annotation( + Line(points = {{-12, -86}, {-3, -86}, {-3, -86}, {6, -86}, {6, -86}, {6, -86}})); + annotation( + uses(OpenModelicaArduino(version = "1.2"), Modelica(version = "3.2.2"), Modelica_DeviceDrivers(version = "1.5.0"))); + end DCMotorWithPID; + annotation( + Diagram(coordinateSystem(extent = {{-148.5, -105}, {148.5, 105}}, preserveAspectRatio = true, initialScale = 0.1, grid = {5, 5}))); + end Examples; \ No newline at end of file diff --git a/Firmware/Arduino/pidmata3/pidmata3.ino b/Firmware/Arduino/pidmata3/pidmata3.ino new file mode 100644 index 0000000..01a4710 --- /dev/null +++ b/Firmware/Arduino/pidmata3/pidmata3.ino @@ -0,0 +1,904 @@ +/* + Firmata is a generic protocol for communicating with microcontrollers + from software on a host computer. It is intended to work with + any host computer software package. + + To download a host software package, please click on the following link + to open the list of Firmata client libraries in your default browser. + + https://github.com/firmata/arduino#firmata-client-libraries + + Copyright (C) 2006-2008 Hans-Christoph Steiner. All rights reserved. + Copyright (C) 2010-2011 Paul Stoffregen. All rights reserved. + Copyright (C) 2009 Shigeru Kobayashi. All rights reserved. + Copyright (C) 2009-2016 Jeff Hoefs. All rights reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + See file LICENSE.txt for further informations on licensing terms. + + Last updated August 17th, 2017 +*/ + +#include.
+.
+The first thing you need to do is upload the Firmware code to your board .
+ +Figure 1. Location of the Firmware sketch.
+If you wish to use PID(Proportional-integral-derivative) then use another firmware provided with the package. To open an firmware through Arduino IDE click on “Open“ and Browse to the location where you extracted the package. Insdie the package folder look for folder named “Firmware“ which contains a file named “pidmata3.ino“. Select that file and click open to load firmware in Arduino IDE.
+ Important instructions for using above mentioned firmware “pidmata3.ino“:
+
Once the the Firmware code is in the board, you need to write down the serial port that it is using. This is important because you need to give the port name to OpenModelicaArduino in order to communicate with the board. You can find the serial port in Tools->Serial Port or in the bottom-right corner of the Arduino software window (see Figure 2). In Windows the serial port name is something like “COM5”, while in OS X and Linux the name will be something like “/dev/ttyACM0”. Now you are ready to make your first model.
+ +Figure 2. Finding the serial port being used.
+As a first exercise, you are going to reproduce with OpenModelicaArduino the blinking LED example. You can either open the prebuilt example (OpenModelicaArduino.Examples.BlinkLed) or build it by yourself. To build the model, locate the components:
+Connect the components as in Figure 3. One thing to notice is that the DigitalOutput model is connected to the Arduino component to specify that the pin belongs to that board. This connection is necessary because OpenModelicaArduino can use multiple boards with multiple pins at the same time.
+ +Figure 3. Diagram of the blinking LED.
+Next you need to specify the serial port that the board is using. This is done by selecting the Arduino component and showing its parameters. In the parameter view, you can find the Port parameter. Write the port name that you got in the section “Preparing your board”. Important: the name must be have quotation marks as shown in Figure 4.
+ +Figure 4. Specifying the serial port name.
+Now you need to set the pin number that you are going to use in the DigitalOutput component. Usually, the Arduino boards have an LED attached to pin 13. Set that number in the Pin parameter as shown in Figure 5.
+ +Figure 5. Specifying the pin to use.
+For the BooleanPulse component, set the 'period' parameter to 1. The model is ready to simulate. Press the simulate button and wait to see the results.
+The first time you run the model, it is probably simulated so fast that you do not have time to react. The reason is that OpenModelica simulates the model as fast as possible. In order to interact with your models using OpenModelicaArduino, it is necessary to synchronize the simulation time with real time. This is done in by using Synchronisation block in ModelicaDeviceDriver library. After simulating the model one time, you need to check in the checkbox “Synchronize with real-time” as shown in Figure 6.
+ //+ //
Figure 6. Synchronizing your simulation with real time.
+ //If you are building many models with the OpenModelicaArduino library, you should set the “Synchronize with real-time” option as a default simulation setting in SimulationCenter under the menu Tools->Options in the section SimulationCenter->Default Experiment (see Figure 7).
+ //+ //
Figure 7. Setting \"Synchronize with real-time\" as default.
+ //Now run the simulation again and you should see the LED blinking until the simulation reaches the stop time. If you want to keep the simulation running continuously, you need to change the stop time to “infinite” as shown in Figure 8.
+ // + //Figure 8. Setting the stop time to infinite.
+ //If you run the simulation again, you should see the LED blinking continuously.
+One thing that you may have noticed is that OpenModelicaArduino prints status messages in the simulation log (see Figure 9). The first thing it prints is a list of the available ports. In that list, you should see your current port (A). After that, it prints the current port and the speed used (B). Once the port is opened, you receive a notification that the board is initialized (C). Usually the boards report the version of Firmata that you are running. Then you set the sampling interval that the board uses (D). In this example, you can see that you are setting pin 13 to be an output because you have used the DigitalOutput component (E). Finally you will see that the board will send you a list of all the pins available and thier capabilities (F). This list contains the number of the pin and the modes in which it can be used, for example: DigitalInput, DigitalOutput, AnalogInput, AnalogOutput, and Servo.
+ +Figure 9. Messages shown by OpenModelicaArduino.
+This is a checklist that you can follow in order to solve most of the problems that can occur when using the ModelPlug library:
+If you are still having problems, you can go to http://community.wolfram.com and ask a question.
+OpenModelicaArduino contains a series of basic examples showing the functionality of the components. You can check the Examples under ModelPlug.Examples. Once you have learned how to use the basic components of OpenModelicaArduino, you can check the Arduino Playground to learn how to connect other sensors and actuators (http://playground.arduino.cc).
", revisions = ""), + Diagram(coordinateSystem(extent = {{-148.5, -105}, {148.5, 105}}, preserveAspectRatio = true, initialScale = 0.1, grid = {5, 5}))); + end GettingStarted; \ No newline at end of file diff --git a/Internal.mo b/Internal.mo new file mode 100644 index 0000000..f118d8f --- /dev/null +++ b/Internal.mo @@ -0,0 +1,164 @@ + package Internal "Internal classes that should not be used directly by the user" + extends Modelica.Icons.Package; + + package Icons "Icons used in ModelPlug" + extends Modelica.Icons.IconsPackage; + + partial model Block "Icon for blocks" + annotation( + experiment(NumberOfIntervals = -1), + preferredView = "icon", + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(visible = true, fillColor = {128, 128, 128}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -80}, {100, 80}}, radius = 40), Rectangle(visible = true, origin = {5, -5}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-95, -75}, {95, 75}}, radius = 40), Rectangle(visible = true, fillColor = {64, 64, 64}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-90, -70}, {90, 70}}, radius = 30)}), + Diagram(coordinateSystem(extent = {{-148.5, -105}, {148.5, 105}}, preserveAspectRatio = true, initialScale = 0.1, grid = {5, 5}))); + end Block; + annotation( + Diagram(coordinateSystem(extent = {{-148.5, -105}, {148.5, 105}}, preserveAspectRatio = true, initialScale = 0.1, grid = {5, 5}))); + end Icons; + + package ExternalFunctions "External functions used to communicate with the boards" + extends Modelica.Icons.Package; + + function readAnalogPin + input Integer pin; + input Real min; + input Real max; + input Real init; + input Integer board; + input Integer adcResolution; + output Real value; + + external "C" value = readAnalogPin(pin, min, max, init, board, adcResolution) annotation( + Include = "#include \"modelPlugFirmata.h\"", + Library = "modelPlugFirmata", + IncludeDirectory = "modelica://OpenModelicaArduino/Resources/Include", + LibraryDirectory = "modelica://OpenModelicaArduino/Resources/Library"); + end readAnalogPin; + + class FirmataBoardObject + extends ExternalObject; + + function constructor "Function that call the external constructor" + input String port; + input Boolean showCapabilities; + input Integer samplingMs; + input Integer BaudRate; + input Boolean UseDTR; + output FirmataBoardObject board; + + external "C" board = boardConstructor(port, showCapabilities, samplingMs, BaudRate, UseDTR) annotation( + Include = "#include \"modelPlugFirmata.h\"", + Library = "modelPlugFirmata", + IncludeDirectory = "modelica://OpenModelicaArduino/Resources/Include", + LibraryDirectory = "modelica://OpenModelicaArduino/Resources/Library"); + end constructor; + + function destructor "Function to destroy the object" + input FirmataBoardObject board; + + external "C" boardDestructor(board) annotation( + Include = "#include \"modelPlugFirmata.h\"", + Library = "modelPlugFirmata", + IncludeDirectory = "modelica://OpenModelicaArduino/Resources/Include", + LibraryDirectory = "modelica://OpenModelicaArduino/Resources/Library"); + end destructor; + end FirmataBoardObject; + + function getBoardId + input FirmataBoardObject board; + output Integer id; + + external "C" id = getBoardId(board) annotation( + Include = "#include \"modelPlugFirmata.h\"", + Library = "modelPlugFirmata", + IncludeDirectory = "modelica://OpenModelicaArduino/Resources/Include", + LibraryDirectory = "modelica://OpenModelicaArduino/Resources/Library"); + end getBoardId; + + function readDigitalPin + input Integer pin; + input Boolean init; + input Integer board; + output Boolean value; + + external "C" value = readDigitalPin(pin, init, board) annotation( + Include = "#include \"modelPlugFirmata.h\"", + Library = "modelPlugFirmata", + IncludeDirectory = "modelica://OpenModelicaArduino/Resources/Include", + LibraryDirectory = "modelica://OpenModelicaArduino/Resources/Library"); + end readDigitalPin; + + function writeAnalogPin + input Integer pin; + input Integer board; + input Real value; + + external "C" writeAnalogPin(pin, board, value) annotation( + Include = "#include \"modelPlugFirmata.h\"", + Library = "modelPlugFirmata", + IncludeDirectory = "modelica://OpenModelicaArduino/Resources/Include", + LibraryDirectory = "modelica://OpenModelicaArduino/Resources/Library"); + end writeAnalogPin; + + function writeDigitalPin + input Integer pin; + input Integer board; + input Boolean value; + + external "C" writeDigitalPin(pin, board, value) annotation( + Include = "#include \"modelPlugFirmata.h\"", + Library = "modelPlugFirmata", + IncludeDirectory = "modelica://OpenModelicaArduino/Resources/Include", + LibraryDirectory = "modelica://OpenModelicaArduino/Resources/Library"); + end writeDigitalPin; + + function updateBoard + input Integer board; + + external "C" updateBoard(board) annotation( + Include = "#include \"modelPlugFirmata.h\"", + Library = "modelPlugFirmata", + IncludeDirectory = "modelica://OpenModelicaArduino/Resources/Include", + LibraryDirectory = "modelica://OpenModelicaArduino/Resources/Library"); + end updateBoard; + + function writeServoPin + input Integer pin; + input Integer board; + input Real value; + input Integer MinPulse; + input Integer MaxPulse; + + external "C" writeServoPin(pin, board, value, MinPulse, MaxPulse) annotation( + Include = "#include \"modelPlugFirmata.h\"", + Library = "modelPlugFirmata", + IncludeDirectory = "modelica://OpenModelicaArduino/Resources/Include", + LibraryDirectory = "modelica://OpenModelicaArduino/Resources/Library"); + end writeServoPin; + annotation( + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {10, 10}), graphics = {Text(visible = true, origin = {11.425, 9.596}, extent = {{-101.424, -59.596}, {78.57599999999999, 40.404}}, textString = "EF")}), + Documentation(info = "", revisions = ""), + Diagram(coordinateSystem(extent = {{-148.5, 105}, {148.5, -105}}, preserveAspectRatio = true, initialScale = 0.1, grid = {10, 10})), + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}), graphics = {Rectangle(visible = true, fillColor = {209, 209, 209}, fillPattern = FillPattern.Solid, extent = {{-100, -100}, {75, 75}}), Polygon(visible = true, fillColor = {236, 236, 236}, fillPattern = FillPattern.Solid, points = {{-100, 75}, {-75, 100}, {100, 100}, {75, 75}}), Polygon(visible = true, fillColor = {177, 177, 177}, fillPattern = FillPattern.Solid, points = {{75, -100}, {75, 75}, {100, 100}, {100, -75}}), Text(visible = true, extent = {{-95.95, -91.88}, {63.97, 71.52}}, textString = "C")})); + end ExternalFunctions; + + package Types "Type and unit definitions" + extends Modelica.Icons.TypesPackage; + type ServoUnit = enumeration(None, Degrees, Radians); + type SerialPort = String annotation( + Dialog(__Wolfram_serialPortSelector = true)); + annotation( + Diagram(coordinateSystem(extent = {{-148.5, -105}, {148.5, 105}}, preserveAspectRatio = true, initialScale = 0.1, grid = {5, 5}))); + end Types; + + package Interfaces "Package with connectors and partial models" + extends Modelica.Icons.InterfacesPackage; + connector BoardConnector = output Integer annotation( + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {10, 10}), graphics = {Ellipse(visible = true, origin = {-0, 0.74}, fillColor = {64, 64, 64}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-10, -9.26}, {10, 9.26}})}), + Diagram(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {10, 10}), graphics = {Ellipse(visible = true, origin = {-0, 0.74}, fillColor = {64, 64, 64}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-10, -9.26}, {10, 9.26}})})); + connector PinConnector = input Integer annotation( + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {10, 10}), graphics = {Ellipse(visible = true, fillColor = {64, 64, 64}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -100}, {100, 100}}), Ellipse(visible = true, fillColor = {128, 128, 128}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-70, -70}, {70, 70}})}), + Diagram(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {10, 10}), graphics = {Ellipse(visible = true, fillColor = {64, 64, 64}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -100}, {100, 100}}), Ellipse(visible = true, fillColor = {128, 128, 128}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-70, -70}, {70, 70}})})); + end Interfaces; + annotation( + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {10, 10}), graphics = {Polygon(visible = true, origin = {1.383, -4.142}, rotation = 45, fillColor = {64, 64, 64}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-15, 93.333}, {-15, 68.333}, {0, 58.333}, {15, 68.333}, {15, 93.333}, {20, 93.333}, {25, 83.333}, {25, 58.333}, {10, 43.333}, {10, -41.667}, {25, -56.667}, {25, -76.667}, {10, -91.667}, {0, -91.667}, {0, -81.667}, {5, -81.667}, {15, -71.667}, {15, -61.667}, {5, -51.667}, {-5, -51.667}, {-15, -61.667}, {-15, -71.667}, {-5, -81.667}, {0, -81.667}, {0, -91.667}, {-10, -91.667}, {-25, -76.667}, {-25, -56.667}, {-10, -41.667}, {-10, 43.333}, {-25, 58.333}, {-25, 83.333}, {-20, 93.333}}), Polygon(visible = true, origin = {10.102, 5.218}, rotation = -45, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, points = {{-15, 87.273}, {15, 87.273}, {20, 82.273}, {20, 27.273}, {10, 17.273}, {10, 7.273}, {20, 2.273}, {20, -2.727}, {5, -2.727}, {5, -77.727}, {10, -87.727}, {5, -112.727}, {-5, -112.727}, {-10, -87.727}, {-5, -77.727}, {-5, -2.727}, {-20, -2.727}, {-20, 2.273}, {-10, 7.273}, {-10, 17.273}, {-20, 27.273}, {-20, 82.273}})})); + end Internal; \ No newline at end of file diff --git a/Pins.mo b/Pins.mo new file mode 100644 index 0000000..556188d --- /dev/null +++ b/Pins.mo @@ -0,0 +1,117 @@ + package Pins "Components to access the board I/O" + extends Internal.Icons.Block; + + model AnalogInput "Reads an analog signal from the specified pin" + extends OpenModelicaArduino.Internal.Icons.Block; + Modelica.Blocks.Interfaces.RealOutput y annotation( + Placement(visible = true, transformation(origin = {110, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {100, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + parameter Integer Pin = 0 "Number of the analog pin"; + OpenModelicaArduino.Internal.Interfaces.PinConnector pinConnector annotation( + Placement(visible = true, transformation(origin = {-100, -0}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-100, -0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + parameter Real InitValue = 0 "Initial value until the board responds" annotation( + Dialog(group = "Initialization")); + parameter Real MinValue = 0 "Minimum value of ADC" annotation( + Dialog(group = "Scaling")); + parameter Real MaxValue = 1 "Maximum value of ADC" annotation( + Dialog(group = "Scaling")); + parameter Integer adcResolution = 10 "Resolution of the ADC in your microcontroller" annotation( + Dialog(group = "Scaling")); + equation + y = OpenModelicaArduino.Internal.ExternalFunctions.readAnalogPin(Pin, MinValue, MaxValue, InitValue, pinConnector, adcResolution); + annotation( + Documentation(info = "Reads an analog signal from the specified pin. This component uses the 'analogRead' function of Arduino.
+Signal Range: By default, the signal goes from 0 to 1 where 0 represents no voltage and 1 the voltage reference of the ADC in the board. This signal can be scaled by setting the 'MinValue' and 'MaxValue' parameters.
+Not all pins support analog input. Check the documentation of your board to find the pin capabilities.
+", revisions = ""), + Icon(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -85}, {100, 85}}, radius = 40), Rectangle(fillColor = {243, 134, 48}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-90, -60}, {90, 60}}, radius = 40), Text(origin = {0, -130}, extent = {{-100, -20}, {100, 20}}, textString = "Pin %Pin"), Text(origin = {0, 10}, extent = {{-75, -15}, {75, 25}}, textString = "Analog", textStyle = {TextStyle.Bold}), Text(origin = {0, -20}, extent = {{-75, -15}, {75, 25}}, textString = "Input", textStyle = {TextStyle.Bold})}), + Diagram(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -75}, {100, 75}}, radius = 40), Rectangle(fillColor = {243, 134, 48}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-90, -50}, {90, 50}}, radius = 40), Text(origin = {0, 20}, extent = {{-75, -15}, {75, 25}}, textString = "Analog", textStyle = {TextStyle.Bold}), Text(origin = {0, -20}, extent = {{-75, -15}, {75, 25}}, textString = "Input", textStyle = {TextStyle.Bold})})); + end AnalogInput; + + model AnalogOutput "Writes an analog signal to the specified pin" + extends OpenModelicaArduino.Internal.Icons.Block; + Modelica.Blocks.Interfaces.RealInput u annotation( + Placement(visible = true, transformation(origin = {-110, -0}, extent = {{-25, -25}, {25, 25}}, rotation = 0), iconTransformation(origin = {-100, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + parameter Integer Pin = 0 "Number of the PWM/DAC pin"; + OpenModelicaArduino.Internal.Interfaces.PinConnector pinConnector annotation( + Placement(visible = true, transformation(origin = {100, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {100, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + parameter Real MinValue = 0 "Value considered as minimum by the PWM/DAC" annotation( + Dialog(group = "Scaling")); + parameter Real MaxValue = 1 "Value considered as maximum by the PWM/DAC" annotation( + Dialog(group = "Scaling")); + protected + Real scaled_u = (u - MinValue) / (MaxValue - MinValue); + equation + OpenModelicaArduino.Internal.ExternalFunctions.writeAnalogPin(Pin, pinConnector, scaled_u); + annotation( + Documentation(info = "
Writes an analog signal to the specified pin. This component uses the 'analogWrite' function of Arduino.
+Signal Range: By default, the signal goes from 0 to 1, where 0 represents no voltage and 1 the maximum voltage that PWM/DAC of your board can provide. This signal can be scaled by setting the 'MinValue' and 'MaxValue' parameters.
+Analog outputs use the PWM capabilities of the pins, therefore, they do not provide a continuous signal. If you want to get a continuous signal, you need to add a lowpass filter. Check the Arduino Playground (http://playground.arduino.cc) for more information on PWM.
+Not all pins support analog output. Check the documentation of your board to find the pin capabilities.
+", revisions = ""), + Icon(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -85}, {100, 85}}, radius = 40), Rectangle(fillColor = {243, 134, 48}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-90, -60}, {90, 60}}, radius = 40), Text(origin = {0, -130}, extent = {{-100, -20}, {100, 20}}, textString = "Pin %Pin"), Text(origin = {0, 10}, extent = {{-75, -15}, {75, 25}}, textString = "Analog", textStyle = {TextStyle.Bold}), Text(origin = {0, -20}, extent = {{-75, -15}, {75, 25}}, textString = "Output", textStyle = {TextStyle.Bold})}), + Diagram(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -75}, {100, 75}}, radius = 40), Rectangle(fillColor = {243, 134, 48}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-90, -50}, {90, 50}}, radius = 40), Text(origin = {0, 20}, extent = {{-75, -15}, {75, 25}}, textString = "Analog", textStyle = {TextStyle.Bold}), Text(origin = {0, -20}, extent = {{-75, -15}, {75, 25}}, textString = "Output", textStyle = {TextStyle.Bold})})); + end AnalogOutput; + + model DigitalInput "Reads a digital signal from the specified pin" + extends OpenModelicaArduino.Internal.Icons.Block; + Modelica.Blocks.Interfaces.BooleanOutput y annotation( + Placement(visible = true, transformation(origin = {110, 1.643}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {101.75, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + parameter Integer Pin = 0 "Number of the digital pin"; + parameter Boolean InitValue = false "Initial value until the board responds" annotation( + Dialog(group = "Initialization")); + OpenModelicaArduino.Internal.Interfaces.PinConnector pinConnector annotation( + Placement(visible = true, transformation(origin = {-100, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-100, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + equation + y = OpenModelicaArduino.Internal.ExternalFunctions.readDigitalPin(Pin, InitValue, pinConnector); + annotation( + Documentation(info = "
Reads a digital signal from the specified pin. This component uses the 'digitalRead' function of Arduino.
+Signal Range: This component accepts only Boolean signals (true/false).
", revisions = ""), + Icon(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -85}, {100, 85}}, radius = 40), Rectangle(fillColor = {0, 170, 255}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-90, -60}, {90, 60}}, radius = 40), Text(origin = {0, -130}, extent = {{-100, -20}, {100, 20}}, textString = "Pin %Pin"), Text(origin = {0, 10}, extent = {{-75, -15}, {75, 25}}, textString = "Digital", textStyle = {TextStyle.Bold}), Text(origin = {0, -20}, extent = {{-75, -15}, {75, 25}}, textString = "Input", textStyle = {TextStyle.Bold})}), + Diagram(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -75}, {100, 75}}, radius = 40), Rectangle(fillColor = {0, 170, 255}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-90, -50}, {90, 50}}, radius = 40), Text(origin = {0, 20}, extent = {{-75, -15}, {75, 25}}, textString = "Digital", textStyle = {TextStyle.Bold}), Text(origin = {0, -20}, extent = {{-75, -15}, {75, 25}}, textString = "Input", textStyle = {TextStyle.Bold})})); + end DigitalInput; + + model DigitalOutput "Writes a digital signal to the specified pin" + extends OpenModelicaArduino.Internal.Icons.Block; + Modelica.Blocks.Interfaces.BooleanInput u annotation( + Placement(visible = true, transformation(origin = {-110, -0}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-100, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + parameter Integer Pin = 0 "Number of the digital pin"; + OpenModelicaArduino.Internal.Interfaces.PinConnector pinConnector annotation( + Placement(visible = true, transformation(origin = {100, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {100, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + equation + OpenModelicaArduino.Internal.ExternalFunctions.writeDigitalPin(Pin, pinConnector, u); + annotation( + Documentation(info = "Writes a digital signal to the specified pin. This component uses the 'digitalWrite' function of Arduino.
+Signal Range: This component accepts only Boolean signals (true/false).
", revisions = ""), + Icon(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -85}, {100, 85}}, radius = 40), Rectangle(fillColor = {0, 170, 255}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-90, -60}, {90, 60}}, radius = 40), Text(origin = {0, -130}, extent = {{-100, -20}, {100, 20}}, textString = "Pin %Pin"), Text(origin = {0, 10}, extent = {{-75, -15}, {75, 25}}, textString = "Digital", textStyle = {TextStyle.Bold}), Text(origin = {0, -20}, extent = {{-75, -15}, {75, 25}}, textString = "Output", textStyle = {TextStyle.Bold})}), + Diagram(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -75}, {100, 75}}, radius = 40), Rectangle(fillColor = {0, 170, 255}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-90, -50}, {90, 50}}, radius = 40), Text(origin = {0, 20}, extent = {{-75, -15}, {75, 25}}, textString = "Digital", textStyle = {TextStyle.Bold}), Text(origin = {0, -20}, extent = {{-75, -15}, {75, 25}}, textString = "Input", textStyle = {TextStyle.Bold})})); + end DigitalOutput; + + model Servo "Controls a servo motor attached to the specified pin" + extends OpenModelicaArduino.Internal.Icons.Block; + Modelica.Blocks.Interfaces.RealInput u annotation( + Placement(visible = true, transformation(origin = {-110, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-100, -0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaArduino.Internal.Interfaces.PinConnector pinConnector annotation( + Placement(visible = true, transformation(origin = {100, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {100, -0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + parameter Integer Pin = 0 "Pin number of the servo"; + parameter OpenModelicaArduino.Internal.Types.ServoUnit InputUnit "if None (Default) the servo receives a signal between 0 and 1. If Degrees the control signal is from 0 to 180. If Radians the signal is from 0 to Pi."; + parameter Integer MinPulse = 544 "The pulse width, in microseconds, corresponding to the minimum (0-degree) angle on the servo. + (Ignore this parameter if using Tiva C board)" annotation( + Dialog(group = "Advanced")); + parameter Integer MaxPulse = 2400 "The pulse width, in microseconds, corresponding to the maximum (180-degree) angle on the servo. + (Ignore this parameter if using Tiva C board)" annotation( + Dialog(group = "Advanced")); + Real outputSignal; + equation + outputSignal = if InputUnit == OpenModelicaArduino.Internal.Types.ServoUnit.None then u else if InputUnit == OpenModelicaArduino.Internal.Types.ServoUnit.Degrees then u / 180 else if InputUnit == OpenModelicaArduino.Internal.Types.ServoUnit.Radians then u / Modelica.Constants.pi else u; + OpenModelicaArduino.Internal.ExternalFunctions.writeServoPin(Pin, pinConnector, u, MinPulse, MaxPulse); + annotation( + Documentation(info = "Controls a servo motor attached to the specified pin. This component uses the 'Servo' library of Arduino.
+Signal Range: By default, the range goes from 0 to 1, which corresponds to 0 to 180 degrees. If you want to input values in radians, you can change the parameter 'InputUnit' from 'Degrees' to 'Radians'.
+If your servo does not work correctly with the default settings, you can set the parameters 'MinPulse' and 'MaxPulse'. To get more information on how to configure a servo, you can check the documentation of the Servo library, http://arduino.cc/en/reference/servo.
", revisions = ""), + Icon(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -85}, {100, 85}}, radius = 40), Rectangle(fillColor = {0, 255, 127}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-90, -60}, {90, 60}}, radius = 40), Text(origin = {0, -130}, extent = {{-100, -20}, {100, 20}}, textString = "Pin %Pin"), Text(extent = {{-75, -25}, {75, 25}}, textString = "Servo", textStyle = {TextStyle.Bold})}), + Diagram(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -75}, {100, 75}}, radius = 40), Rectangle(fillColor = {0, 255, 127}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-90, -50}, {90, 50}}, radius = 40), Text(extent = {{-75, -25}, {75, 25}}, textString = "Servo", textStyle = {TextStyle.Bold})})); + end Servo; + annotation( + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(visible = true, origin = {-30, 30}, fillColor = {250, 105, 0}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-25, -25}, {25, 25}}, radius = 50), Rectangle(visible = true, origin = {30, 30}, fillColor = {243, 134, 48}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-25, -25}, {25, 25}}, radius = 50), Rectangle(visible = true, origin = {-30, -30}, fillColor = {167, 219, 216}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-25, -25}, {25, 25}}, radius = 50), Rectangle(visible = true, origin = {30, -30}, fillColor = {105, 210, 231}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-25, -25}, {25, 25}}, radius = 50)}), + Diagram(coordinateSystem(extent = {{-148.5, -105}, {148.5, 105}}, preserveAspectRatio = true, initialScale = 0.1, grid = {5, 5}))); + end Pins; \ No newline at end of file diff --git a/Resources/Images/Blink.png b/Resources/Images/Blink.png new file mode 100644 index 0000000..b91cc80 Binary files /dev/null and b/Resources/Images/Blink.png differ diff --git a/Resources/Images/BlinkingLEDModel.png b/Resources/Images/BlinkingLEDModel.png new file mode 100644 index 0000000..90c28f5 Binary files /dev/null and b/Resources/Images/BlinkingLEDModel.png differ diff --git a/Resources/Images/CustomExample.png b/Resources/Images/CustomExample.png new file mode 100644 index 0000000..1abb907 Binary files /dev/null and b/Resources/Images/CustomExample.png differ diff --git a/Resources/Images/DefaultSynchronize.png b/Resources/Images/DefaultSynchronize.png new file mode 100644 index 0000000..8dfbc8f Binary files /dev/null and b/Resources/Images/DefaultSynchronize.png differ diff --git a/Resources/Images/Dimming.png b/Resources/Images/Dimming.png new file mode 100644 index 0000000..52ef935 Binary files /dev/null and b/Resources/Images/Dimming.png differ diff --git a/Resources/Images/FirmataLocation.png b/Resources/Images/FirmataLocation.png new file mode 100644 index 0000000..e10a08f Binary files /dev/null and b/Resources/Images/FirmataLocation.png differ diff --git a/Resources/Images/Interval.png b/Resources/Images/Interval.png new file mode 100644 index 0000000..514bff0 Binary files /dev/null and b/Resources/Images/Interval.png differ diff --git a/Resources/Images/ModelPlugDocumentation-1.png b/Resources/Images/ModelPlugDocumentation-1.png new file mode 100644 index 0000000..fcd3938 Binary files /dev/null and b/Resources/Images/ModelPlugDocumentation-1.png differ diff --git a/Resources/Images/ModelPlugDocumentation-2.png b/Resources/Images/ModelPlugDocumentation-2.png new file mode 100644 index 0000000..4c23aa2 Binary files /dev/null and b/Resources/Images/ModelPlugDocumentation-2.png differ diff --git a/Resources/Images/ModelPlugDocumentation-3.png b/Resources/Images/ModelPlugDocumentation-3.png new file mode 100644 index 0000000..073a73f Binary files /dev/null and b/Resources/Images/ModelPlugDocumentation-3.png differ diff --git a/Resources/Images/ModelPlugLog-nomarkers.png b/Resources/Images/ModelPlugLog-nomarkers.png new file mode 100644 index 0000000..ea0e7df Binary files /dev/null and b/Resources/Images/ModelPlugLog-nomarkers.png differ diff --git a/Resources/Images/ModelPlugLog-withmarkers.png b/Resources/Images/ModelPlugLog-withmarkers.png new file mode 100644 index 0000000..9549bd2 Binary files /dev/null and b/Resources/Images/ModelPlugLog-withmarkers.png differ diff --git a/Resources/Images/PinNumber.png b/Resources/Images/PinNumber.png new file mode 100644 index 0000000..1aff89a Binary files /dev/null and b/Resources/Images/PinNumber.png differ diff --git a/Resources/Images/QuotedSerialPort.png b/Resources/Images/QuotedSerialPort.png new file mode 100644 index 0000000..8702a59 Binary files /dev/null and b/Resources/Images/QuotedSerialPort.png differ diff --git a/Resources/Images/ReadAnalog.png b/Resources/Images/ReadAnalog.png new file mode 100644 index 0000000..ad56ad7 Binary files /dev/null and b/Resources/Images/ReadAnalog.png differ diff --git a/Resources/Images/SerialPortLocation.png b/Resources/Images/SerialPortLocation.png new file mode 100644 index 0000000..f999f7e Binary files /dev/null and b/Resources/Images/SerialPortLocation.png differ diff --git a/Resources/Images/ServoExample.png b/Resources/Images/ServoExample.png new file mode 100644 index 0000000..643f646 Binary files /dev/null and b/Resources/Images/ServoExample.png differ diff --git a/Resources/Images/SimpleONOFF.png b/Resources/Images/SimpleONOFF.png new file mode 100644 index 0000000..3bc1c5e Binary files /dev/null and b/Resources/Images/SimpleONOFF.png differ diff --git a/Resources/Images/StandardFirmata.png b/Resources/Images/StandardFirmata.png new file mode 100644 index 0000000..292b82c Binary files /dev/null and b/Resources/Images/StandardFirmata.png differ diff --git a/Resources/Images/StopTime.png b/Resources/Images/StopTime.png new file mode 100644 index 0000000..c7d1662 Binary files /dev/null and b/Resources/Images/StopTime.png differ diff --git a/Resources/Images/SynchronizeSetting.png b/Resources/Images/SynchronizeSetting.png new file mode 100644 index 0000000..8dfbc8f Binary files /dev/null and b/Resources/Images/SynchronizeSetting.png differ diff --git a/Resources/Images/Thumbs.db b/Resources/Images/Thumbs.db new file mode 100644 index 0000000..fd49c68 Binary files /dev/null and b/Resources/Images/Thumbs.db differ diff --git a/Resources/Images/analogInput.png b/Resources/Images/analogInput.png new file mode 100644 index 0000000..c4f5284 Binary files /dev/null and b/Resources/Images/analogInput.png differ diff --git a/Resources/Images/analogOutput.png b/Resources/Images/analogOutput.png new file mode 100644 index 0000000..525fbca Binary files /dev/null and b/Resources/Images/analogOutput.png differ diff --git a/Resources/Images/arduino.png b/Resources/Images/arduino.png new file mode 100644 index 0000000..e285285 Binary files /dev/null and b/Resources/Images/arduino.png differ diff --git a/Resources/Images/arduinoLeonardo.png b/Resources/Images/arduinoLeonardo.png new file mode 100644 index 0000000..faa3aec Binary files /dev/null and b/Resources/Images/arduinoLeonardo.png differ diff --git a/Resources/Images/custom.png b/Resources/Images/custom.png new file mode 100644 index 0000000..8a7ed5b Binary files /dev/null and b/Resources/Images/custom.png differ diff --git a/Resources/Images/digitalInput.png b/Resources/Images/digitalInput.png new file mode 100644 index 0000000..1038625 Binary files /dev/null and b/Resources/Images/digitalInput.png differ diff --git a/Resources/Images/digitalOutput.png b/Resources/Images/digitalOutput.png new file mode 100644 index 0000000..b6c5946 Binary files /dev/null and b/Resources/Images/digitalOutput.png differ diff --git a/Resources/Images/example1.png b/Resources/Images/example1.png new file mode 100644 index 0000000..67297b1 Binary files /dev/null and b/Resources/Images/example1.png differ diff --git a/Resources/Images/example2.png b/Resources/Images/example2.png new file mode 100644 index 0000000..544afef Binary files /dev/null and b/Resources/Images/example2.png differ diff --git a/Resources/Images/features.png b/Resources/Images/features.png new file mode 100644 index 0000000..b2ca1e0 Binary files /dev/null and b/Resources/Images/features.png differ diff --git a/Resources/Images/front.png b/Resources/Images/front.png new file mode 100644 index 0000000..63d5c31 Binary files /dev/null and b/Resources/Images/front.png differ diff --git a/Resources/Images/servo.png b/Resources/Images/servo.png new file mode 100644 index 0000000..4ec4cfb Binary files /dev/null and b/Resources/Images/servo.png differ diff --git a/Resources/Images/standard.png b/Resources/Images/standard.png new file mode 100644 index 0000000..229067e Binary files /dev/null and b/Resources/Images/standard.png differ diff --git a/Resources/Include/modelPlugFirmata.h b/Resources/Include/modelPlugFirmata.h new file mode 100755 index 0000000..8fd513b --- /dev/null +++ b/Resources/Include/modelPlugFirmata.h @@ -0,0 +1,33 @@ +#ifndef MODELPLUG_H +#define MODELPLUG_H + +typedef unsigned char bool; + +#if defined(_MSC_VER) + // Microsoft VC++ + #define EXPORT __declspec(dllexport) +#else + // GCC + #define EXPORT __attribute__((visibility("default"))) +#endif + +#ifdef _cplusplus +extern "C" { +#endif + +EXPORT void* boardConstructor(char* port,bool showCapabilitites,int samplingMs,int baudRate,bool dtr); +EXPORT void boardDestructor(void* object); + +EXPORT void updateBoard(int id); +EXPORT int getBoardId(void* object); + + +EXPORT double readAnalogPin (int pin, double min, double max, double init, int id, int adcResolution); +EXPORT int readDigitalPin (int pin, int init, int id); +EXPORT void writeAnalogPin (int pin, int id,double value); +EXPORT void writeDigitalPin(int pin, int id,int value); +EXPORT void writeServoPin (int pin, int id,double value, int min, int max); +#ifdef _cplusplus +} +#endif +#endif diff --git a/Resources/Include/modelPlugFirmata.h~ b/Resources/Include/modelPlugFirmata.h~ new file mode 100755 index 0000000..8fd513b --- /dev/null +++ b/Resources/Include/modelPlugFirmata.h~ @@ -0,0 +1,33 @@ +#ifndef MODELPLUG_H +#define MODELPLUG_H + +typedef unsigned char bool; + +#if defined(_MSC_VER) + // Microsoft VC++ + #define EXPORT __declspec(dllexport) +#else + // GCC + #define EXPORT __attribute__((visibility("default"))) +#endif + +#ifdef _cplusplus +extern "C" { +#endif + +EXPORT void* boardConstructor(char* port,bool showCapabilitites,int samplingMs,int baudRate,bool dtr); +EXPORT void boardDestructor(void* object); + +EXPORT void updateBoard(int id); +EXPORT int getBoardId(void* object); + + +EXPORT double readAnalogPin (int pin, double min, double max, double init, int id, int adcResolution); +EXPORT int readDigitalPin (int pin, int init, int id); +EXPORT void writeAnalogPin (int pin, int id,double value); +EXPORT void writeDigitalPin(int pin, int id,int value); +EXPORT void writeServoPin (int pin, int id,double value, int min, int max); +#ifdef _cplusplus +} +#endif +#endif diff --git a/Resources/Library/linux64/libmodelPlugFirmata.so b/Resources/Library/linux64/libmodelPlugFirmata.so new file mode 100755 index 0000000..22d3c01 Binary files /dev/null and b/Resources/Library/linux64/libmodelPlugFirmata.so differ diff --git a/Source/CMakeCache.txt b/Source/CMakeCache.txt new file mode 100755 index 0000000..6fd94a2 --- /dev/null +++ b/Source/CMakeCache.txt @@ -0,0 +1,307 @@ +# This is the CMakeCache file. +# For build in directory: /home/sumeet/OpenModelicaArduino/Source +# It was generated by CMake: /usr/bin/cmake +# You can edit this file to change values found and used by cmake. +# If you do not want to change any of the values, simply exit the editor. +# If you do want to change a value, simply edit, save, and exit the editor. +# The syntax for the file is as follows: +# KEY:TYPE=VALUE +# KEY is the name of a variable in the cache. +# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. +# VALUE is the current value for the KEY. + +######################## +# EXTERNAL cache entries +######################## + +//Path to a program. +CMAKE_AR:FILEPATH=/usr/bin/ar + +//Choose the type of build, options are: None(CMAKE_CXX_FLAGS or +// CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel. +CMAKE_BUILD_TYPE:STRING= + +//Enable/Disable color output during build. +CMAKE_COLOR_MAKEFILE:BOOL=ON + +//CXX compiler +CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/c++ + +//Flags used by the compiler during all build types. +CMAKE_CXX_FLAGS:STRING= + +//Flags used by the compiler during debug builds. +CMAKE_CXX_FLAGS_DEBUG:STRING=-g + +//Flags used by the compiler during release builds for minimum +// size. +CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG + +//Flags used by the compiler during release builds. +CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG + +//Flags used by the compiler during release builds with debug info. +CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG + +//C compiler +CMAKE_C_COMPILER:FILEPATH=/usr/bin/cc + +//Flags used by the compiler during all build types. +CMAKE_C_FLAGS:STRING= + +//Flags used by the compiler during debug builds. +CMAKE_C_FLAGS_DEBUG:STRING=-g + +//Flags used by the compiler during release builds for minimum +// size. +CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG + +//Flags used by the compiler during release builds. +CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG + +//Flags used by the compiler during release builds with debug info. +CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG + +//Flags used by the linker. +CMAKE_EXE_LINKER_FLAGS:STRING= + +//Flags used by the linker during debug builds. +CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during release minsize builds. +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during release builds. +CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Enable/Disable output of compile commands during generation. +CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF + +//Install path prefix, prepended onto install directories. +CMAKE_INSTALL_PREFIX:PATH=/usr/local + +//Path to a program. +CMAKE_LINKER:FILEPATH=/usr/bin/ld + +//Path to a program. +CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make + +//Flags used by the linker during the creation of modules. +CMAKE_MODULE_LINKER_FLAGS:STRING= + +//Flags used by the linker during debug builds. +CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during release minsize builds. +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during release builds. +CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Path to a program. +CMAKE_NM:FILEPATH=/usr/bin/nm + +//Path to a program. +CMAKE_OBJCOPY:FILEPATH=/usr/bin/objcopy + +//Path to a program. +CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump + +//Value Computed by CMake +CMAKE_PROJECT_NAME:STATIC=Project + +//Path to a program. +CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib + +//Flags used by the linker during the creation of dll's. +CMAKE_SHARED_LINKER_FLAGS:STRING= + +//Flags used by the linker during debug builds. +CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during release minsize builds. +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during release builds. +CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//If set, runtime paths are not added when installing shared libraries, +// but are added when building. +CMAKE_SKIP_INSTALL_RPATH:BOOL=NO + +//If set, runtime paths are not added when using shared libraries. +CMAKE_SKIP_RPATH:BOOL=NO + +//Flags used by the linker during the creation of static libraries. +CMAKE_STATIC_LINKER_FLAGS:STRING= + +//Flags used by the linker during debug builds. +CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during release minsize builds. +CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during release builds. +CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Path to a program. +CMAKE_STRIP:FILEPATH=/usr/bin/strip + +//If this value is on, makefiles will be generated without the +// .SILENT directive, and all commands will be echoed to the console +// during the make. This is useful for debugging only. With Visual +// Studio IDE projects all commands are done without /nologo. +CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE + +//Value Computed by CMake +Project_BINARY_DIR:STATIC=/home/sumeet/OpenModelicaArduino/Source + +//Value Computed by CMake +Project_SOURCE_DIR:STATIC=/home/sumeet/OpenModelicaArduino/Source + +//Dependencies for target +modelPlugFirmata_LIB_DEPENDS:STATIC= + + +######################## +# INTERNAL cache entries +######################## + +//ADVANCED property for variable: CMAKE_AR +CMAKE_AR-ADVANCED:INTERNAL=1 +//This is the directory where this CMakeCache.txt was created +CMAKE_CACHEFILE_DIR:INTERNAL=/home/sumeet/OpenModelicaArduino/Source +//Major version of cmake used to create the current loaded cache +CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 +//Minor version of cmake used to create the current loaded cache +CMAKE_CACHE_MINOR_VERSION:INTERNAL=5 +//Patch version of cmake used to create the current loaded cache +CMAKE_CACHE_PATCH_VERSION:INTERNAL=1 +//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE +CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1 +//Path to CMake executable. +CMAKE_COMMAND:INTERNAL=/usr/bin/cmake +//Path to cpack program executable. +CMAKE_CPACK_COMMAND:INTERNAL=/usr/bin/cpack +//Path to ctest program executable. +CMAKE_CTEST_COMMAND:INTERNAL=/usr/bin/ctest +//ADVANCED property for variable: CMAKE_CXX_COMPILER +CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS +CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG +CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL +CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE +CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO +CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_COMPILER +CMAKE_C_COMPILER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS +CMAKE_C_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG +CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL +CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE +CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO +CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//Executable file format +CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS +CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG +CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE +CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS +CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 +//Name of external makefile project generator. +CMAKE_EXTRA_GENERATOR:INTERNAL= +//Name of generator. +CMAKE_GENERATOR:INTERNAL=Unix Makefiles +//Name of generator platform. +CMAKE_GENERATOR_PLATFORM:INTERNAL= +//Name of generator toolset. +CMAKE_GENERATOR_TOOLSET:INTERNAL= +//Source directory with the top level CMakeLists.txt file for this +// project +CMAKE_HOME_DIRECTORY:INTERNAL=/home/sumeet/OpenModelicaArduino/Source +//Install .so files without execute permission. +CMAKE_INSTALL_SO_NO_EXE:INTERNAL=1 +//ADVANCED property for variable: CMAKE_LINKER +CMAKE_LINKER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MAKE_PROGRAM +CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS +CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG +CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE +CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_NM +CMAKE_NM-ADVANCED:INTERNAL=1 +//number of local generators +CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1 +//ADVANCED property for variable: CMAKE_OBJCOPY +CMAKE_OBJCOPY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_OBJDUMP +CMAKE_OBJDUMP-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_RANLIB +CMAKE_RANLIB-ADVANCED:INTERNAL=1 +//Path to CMake installation. +CMAKE_ROOT:INTERNAL=/usr/share/cmake-3.5 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS +CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG +CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE +CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH +CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_RPATH +CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS +CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG +CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL +CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE +CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STRIP +CMAKE_STRIP-ADVANCED:INTERNAL=1 +//uname command +CMAKE_UNAME:INTERNAL=/bin/uname +//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE +CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 + diff --git a/Source/CMakeCache.txt~ b/Source/CMakeCache.txt~ new file mode 100755 index 0000000..04be850 --- /dev/null +++ b/Source/CMakeCache.txt~ @@ -0,0 +1,307 @@ +# This is the CMakeCache file. +# For build in directory: /home/sumeet/OpenModelicaArduino/Source +# It was generated by CMake: /usr/bin/cmake +# You can edit this file to change values found and used by cmake. +# If you do not want to change any of the values, simply exit the editor. +# If you do want to change a value, simply edit, save, and exit the editor. +# The syntax for the file is as follows: +# KEY:TYPE=VALUE +# KEY is the name of a variable in the cache. +# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. +# VALUE is the current value for the KEY. + +######################## +# EXTERNAL cache entries +######################## + +//Path to a program. +CMAKE_AR:FILEPATH=/usr/bin/ar + +//Choose the type of build, options are: None(CMAKE_CXX_FLAGS or +// CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel. +CMAKE_BUILD_TYPE:STRING= + +//Enable/Disable color output during build. +CMAKE_COLOR_MAKEFILE:BOOL=ON + +//CXX compiler +CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/c++ + +//Flags used by the compiler during all build types. +CMAKE_CXX_FLAGS:STRING= + +//Flags used by the compiler during debug builds. +CMAKE_CXX_FLAGS_DEBUG:STRING=-g + +//Flags used by the compiler during release builds for minimum +// size. +CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG + +//Flags used by the compiler during release builds. +CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG + +//Flags used by the compiler during release builds with debug info. +CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG + +//C compiler +CMAKE_C_COMPILER:FILEPATH=/usr/bin/cc + +//Flags used by the compiler during all build types. +CMAKE_C_FLAGS:STRING= + +//Flags used by the compiler during debug builds. +CMAKE_C_FLAGS_DEBUG:STRING=-g + +//Flags used by the compiler during release builds for minimum +// size. +CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG + +//Flags used by the compiler during release builds. +CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG + +//Flags used by the compiler during release builds with debug info. +CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG + +//Flags used by the linker. +CMAKE_EXE_LINKER_FLAGS:STRING= + +//Flags used by the linker during debug builds. +CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during release minsize builds. +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during release builds. +CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Enable/Disable output of compile commands during generation. +CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF + +//Install path prefix, prepended onto install directories. +CMAKE_INSTALL_PREFIX:PATH=/usr/local + +//Path to a program. +CMAKE_LINKER:FILEPATH=/usr/bin/ld + +//Path to a program. +CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make + +//Flags used by the linker during the creation of modules. +CMAKE_MODULE_LINKER_FLAGS:STRING= + +//Flags used by the linker during debug builds. +CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during release minsize builds. +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during release builds. +CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Path to a program. +CMAKE_NM:FILEPATH=/usr/bin/nm + +//Path to a program. +CMAKE_OBJCOPY:FILEPATH=/usr/bin/objcopy + +//Path to a program. +CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump + +//Value Computed by CMake +CMAKE_PROJECT_NAME:STATIC=Project + +//Path to a program. +CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib + +//Flags used by the linker during the creation of dll's. +CMAKE_SHARED_LINKER_FLAGS:STRING= + +//Flags used by the linker during debug builds. +CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during release minsize builds. +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during release builds. +CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//If set, runtime paths are not added when installing shared libraries, +// but are added when building. +CMAKE_SKIP_INSTALL_RPATH:BOOL=NO + +//If set, runtime paths are not added when using shared libraries. +CMAKE_SKIP_RPATH:BOOL=NO + +//Flags used by the linker during the creation of static libraries. +CMAKE_STATIC_LINKER_FLAGS:STRING= + +//Flags used by the linker during debug builds. +CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during release minsize builds. +CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during release builds. +CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Path to a program. +CMAKE_STRIP:FILEPATH=/usr/bin/strip + +//If this value is on, makefiles will be generated without the +// .SILENT directive, and all commands will be echoed to the console +// during the make. This is useful for debugging only. With Visual +// Studio IDE projects all commands are done without /nologo. +CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE + +//Value Computed by CMake +Project_BINARY_DIR:STATIC=/home/sumeet/OpenModelicaArduino/Source + +//Value Computed by CMake +Project_SOURCE_DIR:STATIC=/home/sumeet/OpenModelicaArduino/Source + +//Dependencies for target +modelPlugFirmata_LIB_DEPENDS:STATIC= + + +######################## +# INTERNAL cache entries +######################## + +//ADVANCED property for variable: CMAKE_AR +CMAKE_AR-ADVANCED:INTERNAL=1 +//This is the directory where this CMakeCache.txt was created +CMAKE_CACHEFILE_DIR:INTERNAL=/home/sumeet/OpenModelicaArduino/Source +//Major version of cmake used to create the current loaded cache +CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 +//Minor version of cmake used to create the current loaded cache +CMAKE_CACHE_MINOR_VERSION:INTERNAL=5 +//Patch version of cmake used to create the current loaded cache +CMAKE_CACHE_PATCH_VERSION:INTERNAL=1 +//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE +CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1 +//Path to CMake executable. +CMAKE_COMMAND:INTERNAL=/usr/bin/cmake +//Path to cpack program executable. +CMAKE_CPACK_COMMAND:INTERNAL=/usr/bin/cpack +//Path to ctest program executable. +CMAKE_CTEST_COMMAND:INTERNAL=/usr/bin/ctest +//ADVANCED property for variable: CMAKE_CXX_COMPILER +CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS +CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG +CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL +CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE +CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO +CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_COMPILER +CMAKE_C_COMPILER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS +CMAKE_C_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG +CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL +CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE +CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO +CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//Executable file format +CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS +CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG +CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE +CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS +CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 +//Name of external makefile project generator. +CMAKE_EXTRA_GENERATOR:INTERNAL= +//Name of generator. +CMAKE_GENERATOR:INTERNAL=Unix Makefiles +//Name of generator platform. +CMAKE_GENERATOR_PLATFORM:INTERNAL= +//Name of generator toolset. +CMAKE_GENERATOR_TOOLSET:INTERNAL= +//Source directory with the top level CMakeLists.txt file for this +// project +CMAKE_HOME_DIRECTORY:INTERNAL=/home/user/Downloads/libs/Source +//Install .so files without execute permission. +CMAKE_INSTALL_SO_NO_EXE:INTERNAL=1 +//ADVANCED property for variable: CMAKE_LINKER +CMAKE_LINKER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MAKE_PROGRAM +CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS +CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG +CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE +CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_NM +CMAKE_NM-ADVANCED:INTERNAL=1 +//number of local generators +CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1 +//ADVANCED property for variable: CMAKE_OBJCOPY +CMAKE_OBJCOPY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_OBJDUMP +CMAKE_OBJDUMP-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_RANLIB +CMAKE_RANLIB-ADVANCED:INTERNAL=1 +//Path to CMake installation. +CMAKE_ROOT:INTERNAL=/usr/share/cmake-3.5 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS +CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG +CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE +CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH +CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_RPATH +CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS +CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG +CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL +CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE +CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STRIP +CMAKE_STRIP-ADVANCED:INTERNAL=1 +//uname command +CMAKE_UNAME:INTERNAL=/bin/uname +//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE +CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 + diff --git a/Source/CMakeFiles/3.5.1/CMakeCCompiler.cmake b/Source/CMakeFiles/3.5.1/CMakeCCompiler.cmake new file mode 100755 index 0000000..f40522e --- /dev/null +++ b/Source/CMakeFiles/3.5.1/CMakeCCompiler.cmake @@ -0,0 +1,67 @@ +set(CMAKE_C_COMPILER "/usr/bin/cc") +set(CMAKE_C_COMPILER_ARG1 "") +set(CMAKE_C_COMPILER_ID "GNU") +set(CMAKE_C_COMPILER_VERSION "5.4.0") +set(CMAKE_C_COMPILER_WRAPPER "") +set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11") +set(CMAKE_C_COMPILE_FEATURES "c_function_prototypes;c_restrict;c_variadic_macros;c_static_assert") +set(CMAKE_C90_COMPILE_FEATURES "c_function_prototypes") +set(CMAKE_C99_COMPILE_FEATURES "c_restrict;c_variadic_macros") +set(CMAKE_C11_COMPILE_FEATURES "c_static_assert") + +set(CMAKE_C_PLATFORM_ID "Linux") +set(CMAKE_C_SIMULATE_ID "") +set(CMAKE_C_SIMULATE_VERSION "") + +set(CMAKE_AR "/usr/bin/ar") +set(CMAKE_RANLIB "/usr/bin/ranlib") +set(CMAKE_LINKER "/usr/bin/ld") +set(CMAKE_COMPILER_IS_GNUCC 1) +set(CMAKE_C_COMPILER_LOADED 1) +set(CMAKE_C_COMPILER_WORKS TRUE) +set(CMAKE_C_ABI_COMPILED TRUE) +set(CMAKE_COMPILER_IS_MINGW ) +set(CMAKE_COMPILER_IS_CYGWIN ) +if(CMAKE_COMPILER_IS_CYGWIN) + set(CYGWIN 1) + set(UNIX 1) +endif() + +set(CMAKE_C_COMPILER_ENV_VAR "CC") + +if(CMAKE_COMPILER_IS_MINGW) + set(MINGW 1) +endif() +set(CMAKE_C_COMPILER_ID_RUN 1) +set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) +set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) +set(CMAKE_C_LINKER_PREFERENCE 10) + +# Save compiler ABI information. +set(CMAKE_C_SIZEOF_DATA_PTR "8") +set(CMAKE_C_COMPILER_ABI "ELF") +set(CMAKE_C_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") + +if(CMAKE_C_SIZEOF_DATA_PTR) + set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") +endif() + +if(CMAKE_C_COMPILER_ABI) + set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") +endif() + +if(CMAKE_C_LIBRARY_ARCHITECTURE) + set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") +endif() + +set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") +if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) + set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") +endif() + + + + +set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "c") +set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/5;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib") +set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") diff --git a/Source/CMakeFiles/3.5.1/CMakeCXXCompiler.cmake b/Source/CMakeFiles/3.5.1/CMakeCXXCompiler.cmake new file mode 100755 index 0000000..013ee92 --- /dev/null +++ b/Source/CMakeFiles/3.5.1/CMakeCXXCompiler.cmake @@ -0,0 +1,68 @@ +set(CMAKE_CXX_COMPILER "/usr/bin/c++") +set(CMAKE_CXX_COMPILER_ARG1 "") +set(CMAKE_CXX_COMPILER_ID "GNU") +set(CMAKE_CXX_COMPILER_VERSION "5.4.0") +set(CMAKE_CXX_COMPILER_WRAPPER "") +set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "98") +set(CMAKE_CXX_COMPILE_FEATURES "cxx_template_template_parameters;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") +set(CMAKE_CXX98_COMPILE_FEATURES "cxx_template_template_parameters") +set(CMAKE_CXX11_COMPILE_FEATURES "cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") +set(CMAKE_CXX14_COMPILE_FEATURES "cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") + +set(CMAKE_CXX_PLATFORM_ID "Linux") +set(CMAKE_CXX_SIMULATE_ID "") +set(CMAKE_CXX_SIMULATE_VERSION "") + +set(CMAKE_AR "/usr/bin/ar") +set(CMAKE_RANLIB "/usr/bin/ranlib") +set(CMAKE_LINKER "/usr/bin/ld") +set(CMAKE_COMPILER_IS_GNUCXX 1) +set(CMAKE_CXX_COMPILER_LOADED 1) +set(CMAKE_CXX_COMPILER_WORKS TRUE) +set(CMAKE_CXX_ABI_COMPILED TRUE) +set(CMAKE_COMPILER_IS_MINGW ) +set(CMAKE_COMPILER_IS_CYGWIN ) +if(CMAKE_COMPILER_IS_CYGWIN) + set(CYGWIN 1) + set(UNIX 1) +endif() + +set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") + +if(CMAKE_COMPILER_IS_MINGW) + set(MINGW 1) +endif() +set(CMAKE_CXX_COMPILER_ID_RUN 1) +set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) +set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;mm;CPP) +set(CMAKE_CXX_LINKER_PREFERENCE 30) +set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) + +# Save compiler ABI information. +set(CMAKE_CXX_SIZEOF_DATA_PTR "8") +set(CMAKE_CXX_COMPILER_ABI "ELF") +set(CMAKE_CXX_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") + +if(CMAKE_CXX_SIZEOF_DATA_PTR) + set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") +endif() + +if(CMAKE_CXX_COMPILER_ABI) + set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") +endif() + +if(CMAKE_CXX_LIBRARY_ARCHITECTURE) + set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") +endif() + +set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "") +if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) + set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") +endif() + + + + +set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;m;c") +set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/5;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib") +set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") diff --git a/Source/CMakeFiles/3.5.1/CMakeDetermineCompilerABI_C.bin b/Source/CMakeFiles/3.5.1/CMakeDetermineCompilerABI_C.bin new file mode 100755 index 0000000..5bf96b2 Binary files /dev/null and b/Source/CMakeFiles/3.5.1/CMakeDetermineCompilerABI_C.bin differ diff --git a/Source/CMakeFiles/3.5.1/CMakeDetermineCompilerABI_CXX.bin b/Source/CMakeFiles/3.5.1/CMakeDetermineCompilerABI_CXX.bin new file mode 100755 index 0000000..871d1fb Binary files /dev/null and b/Source/CMakeFiles/3.5.1/CMakeDetermineCompilerABI_CXX.bin differ diff --git a/Source/CMakeFiles/3.5.1/CMakeSystem.cmake b/Source/CMakeFiles/3.5.1/CMakeSystem.cmake new file mode 100755 index 0000000..6de073d --- /dev/null +++ b/Source/CMakeFiles/3.5.1/CMakeSystem.cmake @@ -0,0 +1,15 @@ +set(CMAKE_HOST_SYSTEM "Linux-4.10.0-42-generic") +set(CMAKE_HOST_SYSTEM_NAME "Linux") +set(CMAKE_HOST_SYSTEM_VERSION "4.10.0-42-generic") +set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64") + + + +set(CMAKE_SYSTEM "Linux-4.10.0-42-generic") +set(CMAKE_SYSTEM_NAME "Linux") +set(CMAKE_SYSTEM_VERSION "4.10.0-42-generic") +set(CMAKE_SYSTEM_PROCESSOR "x86_64") + +set(CMAKE_CROSSCOMPILING "FALSE") + +set(CMAKE_SYSTEM_LOADED 1) diff --git a/Source/CMakeFiles/3.5.1/CompilerIdC/CMakeCCompilerId.c b/Source/CMakeFiles/3.5.1/CompilerIdC/CMakeCCompilerId.c new file mode 100755 index 0000000..570a15e --- /dev/null +++ b/Source/CMakeFiles/3.5.1/CompilerIdC/CMakeCCompilerId.c @@ -0,0 +1,544 @@ +#ifdef __cplusplus +# error "A C++ compiler has been selected for C." +#endif + +#if defined(__18CXX) +# define ID_VOID_MAIN +#endif + + +/* Version number components: V=Version, R=Revision, P=Patch + Version date components: YYYY=Year, MM=Month, DD=Day */ + +#if defined(__INTEL_COMPILER) || defined(__ICC) +# define COMPILER_ID "Intel" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif + /* __INTEL_COMPILER = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) +# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) +# if defined(__INTEL_COMPILER_UPDATE) +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) +# else +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) +# endif +# if defined(__INTEL_COMPILER_BUILD_DATE) + /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ +# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) +# endif +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif + +#elif defined(__PATHCC__) +# define COMPILER_ID "PathScale" +# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) +# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) +# if defined(__PATHCC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) +# endif + +#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) +# define COMPILER_ID "Embarcadero" +# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) +# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) +# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) + +#elif defined(__BORLANDC__) +# define COMPILER_ID "Borland" + /* __BORLANDC__ = 0xVRR */ +# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) +# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) + +#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 +# define COMPILER_ID "Watcom" + /* __WATCOMC__ = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__WATCOMC__) +# define COMPILER_ID "OpenWatcom" + /* __WATCOMC__ = VVRP + 1100 */ +# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__SUNPRO_C) +# define COMPILER_ID "SunPro" +# if __SUNPRO_C >= 0x5100 + /* __SUNPRO_C = 0xVRRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) +# else + /* __SUNPRO_CC = 0xVRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) +# endif + +#elif defined(__HP_cc) +# define COMPILER_ID "HP" + /* __HP_cc = VVRRPP */ +# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000) +# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100) + +#elif defined(__DECC) +# define COMPILER_ID "Compaq" + /* __DECC_VER = VVRRTPPPP */ +# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000) +# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100) +# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000) + +#elif defined(__IBMC__) && defined(__COMPILER_VER__) +# define COMPILER_ID "zOS" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800 +# define COMPILER_ID "XL" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800 +# define COMPILER_ID "VisualAge" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__PGI) +# define COMPILER_ID "PGI" +# define COMPILER_VERSION_MAJOR DEC(__PGIC__) +# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) +# if defined(__PGIC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) +# endif + +#elif defined(_CRAYC) +# define COMPILER_ID "Cray" +# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) +# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) + +#elif defined(__TI_COMPILER_VERSION__) +# define COMPILER_ID "TI" + /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ +# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) +# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) +# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) + +#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version) +# define COMPILER_ID "Fujitsu" + +#elif defined(__TINYC__) +# define COMPILER_ID "TinyCC" + +#elif defined(__SCO_VERSION__) +# define COMPILER_ID "SCO" + +#elif defined(__clang__) && defined(__apple_build_version__) +# define COMPILER_ID "AppleClang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) + +#elif defined(__clang__) +# define COMPILER_ID "Clang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif + +#elif defined(__GNUC__) +# define COMPILER_ID "GNU" +# define COMPILER_VERSION_MAJOR DEC(__GNUC__) +# if defined(__GNUC_MINOR__) +# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif defined(_MSC_VER) +# define COMPILER_ID "MSVC" + /* _MSC_VER = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) +# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) +# if defined(_MSC_FULL_VER) +# if _MSC_VER >= 1400 + /* _MSC_FULL_VER = VVRRPPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) +# else + /* _MSC_FULL_VER = VVRRPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) +# endif +# endif +# if defined(_MSC_BUILD) +# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) +# endif + +#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) +# define COMPILER_ID "ADSP" +#if defined(__VISUALDSPVERSION__) + /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ +# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) +# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) +#endif + +#elif defined(__IAR_SYSTEMS_ICC__ ) || defined(__IAR_SYSTEMS_ICC) +# define COMPILER_ID "IAR" + +#elif defined(__ARMCC_VERSION) +# define COMPILER_ID "ARMCC" +#if __ARMCC_VERSION >= 1000000 + /* __ARMCC_VERSION = VRRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#else + /* __ARMCC_VERSION = VRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#endif + + +#elif defined(SDCC) +# define COMPILER_ID "SDCC" + /* SDCC = VRP */ +# define COMPILER_VERSION_MAJOR DEC(SDCC/100) +# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10) +# define COMPILER_VERSION_PATCH DEC(SDCC % 10) + +#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION) +# define COMPILER_ID "MIPSpro" +# if defined(_SGI_COMPILER_VERSION) + /* _SGI_COMPILER_VERSION = VRP */ +# define COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100) +# define COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10) +# define COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION % 10) +# else + /* _COMPILER_VERSION = VRP */ +# define COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100) +# define COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10) +# define COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION % 10) +# endif + + +/* These compilers are either not known or too old to define an + identification macro. Try to identify the platform and guess that + it is the native compiler. */ +#elif defined(__sgi) +# define COMPILER_ID "MIPSpro" + +#elif defined(__hpux) || defined(__hpua) +# define COMPILER_ID "HP" + +#else /* unknown compiler */ +# define COMPILER_ID "" +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; +#ifdef SIMULATE_ID +char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; +#endif + +#ifdef __QNXNTO__ +char const* qnxnto = "INFO" ":" "qnxnto[]"; +#endif + +#if defined(__CRAYXE) || defined(__CRAYXC) +char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; +#endif + +#define STRINGIFY_HELPER(X) #X +#define STRINGIFY(X) STRINGIFY_HELPER(X) + +/* Identify known platforms by name. */ +#if defined(__linux) || defined(__linux__) || defined(linux) +# define PLATFORM_ID "Linux" + +#elif defined(__CYGWIN__) +# define PLATFORM_ID "Cygwin" + +#elif defined(__MINGW32__) +# define PLATFORM_ID "MinGW" + +#elif defined(__APPLE__) +# define PLATFORM_ID "Darwin" + +#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) +# define PLATFORM_ID "Windows" + +#elif defined(__FreeBSD__) || defined(__FreeBSD) +# define PLATFORM_ID "FreeBSD" + +#elif defined(__NetBSD__) || defined(__NetBSD) +# define PLATFORM_ID "NetBSD" + +#elif defined(__OpenBSD__) || defined(__OPENBSD) +# define PLATFORM_ID "OpenBSD" + +#elif defined(__sun) || defined(sun) +# define PLATFORM_ID "SunOS" + +#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) +# define PLATFORM_ID "AIX" + +#elif defined(__sgi) || defined(__sgi__) || defined(_SGI) +# define PLATFORM_ID "IRIX" + +#elif defined(__hpux) || defined(__hpux__) +# define PLATFORM_ID "HP-UX" + +#elif defined(__HAIKU__) +# define PLATFORM_ID "Haiku" + +#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) +# define PLATFORM_ID "BeOS" + +#elif defined(__QNX__) || defined(__QNXNTO__) +# define PLATFORM_ID "QNX" + +#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) +# define PLATFORM_ID "Tru64" + +#elif defined(__riscos) || defined(__riscos__) +# define PLATFORM_ID "RISCos" + +#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) +# define PLATFORM_ID "SINIX" + +#elif defined(__UNIX_SV__) +# define PLATFORM_ID "UNIX_SV" + +#elif defined(__bsdos__) +# define PLATFORM_ID "BSDOS" + +#elif defined(_MPRAS) || defined(MPRAS) +# define PLATFORM_ID "MP-RAS" + +#elif defined(__osf) || defined(__osf__) +# define PLATFORM_ID "OSF1" + +#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) +# define PLATFORM_ID "SCO_SV" + +#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) +# define PLATFORM_ID "ULTRIX" + +#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) +# define PLATFORM_ID "Xenix" + +#elif defined(__WATCOMC__) +# if defined(__LINUX__) +# define PLATFORM_ID "Linux" + +# elif defined(__DOS__) +# define PLATFORM_ID "DOS" + +# elif defined(__OS2__) +# define PLATFORM_ID "OS2" + +# elif defined(__WINDOWS__) +# define PLATFORM_ID "Windows3x" + +# else /* unknown platform */ +# define PLATFORM_ID "" +# endif + +#else /* unknown platform */ +# define PLATFORM_ID "" + +#endif + +/* For windows compilers MSVC and Intel we can determine + the architecture of the compiler being used. This is because + the compilers do not have flags that can change the architecture, + but rather depend on which compiler is being used +*/ +#if defined(_WIN32) && defined(_MSC_VER) +# if defined(_M_IA64) +# define ARCHITECTURE_ID "IA64" + +# elif defined(_M_X64) || defined(_M_AMD64) +# define ARCHITECTURE_ID "x64" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# elif defined(_M_ARM) +# if _M_ARM == 4 +# define ARCHITECTURE_ID "ARMV4I" +# elif _M_ARM == 5 +# define ARCHITECTURE_ID "ARMV5I" +# else +# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) +# endif + +# elif defined(_M_MIPS) +# define ARCHITECTURE_ID "MIPS" + +# elif defined(_M_SH) +# define ARCHITECTURE_ID "SHx" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__WATCOMC__) +# if defined(_M_I86) +# define ARCHITECTURE_ID "I86" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#else +# define ARCHITECTURE_ID "" +#endif + +/* Convert integer to decimal digit literals. */ +#define DEC(n) \ + ('0' + (((n) / 10000000)%10)), \ + ('0' + (((n) / 1000000)%10)), \ + ('0' + (((n) / 100000)%10)), \ + ('0' + (((n) / 10000)%10)), \ + ('0' + (((n) / 1000)%10)), \ + ('0' + (((n) / 100)%10)), \ + ('0' + (((n) / 10)%10)), \ + ('0' + ((n) % 10)) + +/* Convert integer to hex digit literals. */ +#define HEX(n) \ + ('0' + ((n)>>28 & 0xF)), \ + ('0' + ((n)>>24 & 0xF)), \ + ('0' + ((n)>>20 & 0xF)), \ + ('0' + ((n)>>16 & 0xF)), \ + ('0' + ((n)>>12 & 0xF)), \ + ('0' + ((n)>>8 & 0xF)), \ + ('0' + ((n)>>4 & 0xF)), \ + ('0' + ((n) & 0xF)) + +/* Construct a string literal encoding the version number components. */ +#ifdef COMPILER_VERSION_MAJOR +char const info_version[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', + COMPILER_VERSION_MAJOR, +# ifdef COMPILER_VERSION_MINOR + '.', COMPILER_VERSION_MINOR, +# ifdef COMPILER_VERSION_PATCH + '.', COMPILER_VERSION_PATCH, +# ifdef COMPILER_VERSION_TWEAK + '.', COMPILER_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct a string literal encoding the version number components. */ +#ifdef SIMULATE_VERSION_MAJOR +char const info_simulate_version[] = { + 'I', 'N', 'F', 'O', ':', + 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', + SIMULATE_VERSION_MAJOR, +# ifdef SIMULATE_VERSION_MINOR + '.', SIMULATE_VERSION_MINOR, +# ifdef SIMULATE_VERSION_PATCH + '.', SIMULATE_VERSION_PATCH, +# ifdef SIMULATE_VERSION_TWEAK + '.', SIMULATE_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; +char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; + + + + +const char* info_language_dialect_default = "INFO" ":" "dialect_default[" +#if !defined(__STDC_VERSION__) + "90" +#elif __STDC_VERSION__ >= 201000L + "11" +#elif __STDC_VERSION__ >= 199901L + "99" +#else +#endif +"]"; + +/*--------------------------------------------------------------------------*/ + +#ifdef ID_VOID_MAIN +void main() {} +#else +int main(int argc, char* argv[]) +{ + int require = 0; + require += info_compiler[argc]; + require += info_platform[argc]; + require += info_arch[argc]; +#ifdef COMPILER_VERSION_MAJOR + require += info_version[argc]; +#endif +#ifdef SIMULATE_ID + require += info_simulate[argc]; +#endif +#ifdef SIMULATE_VERSION_MAJOR + require += info_simulate_version[argc]; +#endif +#if defined(__CRAYXE) || defined(__CRAYXC) + require += info_cray[argc]; +#endif + require += info_language_dialect_default[argc]; + (void)argv; + return require; +} +#endif diff --git a/Source/CMakeFiles/3.5.1/CompilerIdC/a.out b/Source/CMakeFiles/3.5.1/CompilerIdC/a.out new file mode 100755 index 0000000..ec0b632 Binary files /dev/null and b/Source/CMakeFiles/3.5.1/CompilerIdC/a.out differ diff --git a/Source/CMakeFiles/3.5.1/CompilerIdCXX/CMakeCXXCompilerId.cpp b/Source/CMakeFiles/3.5.1/CompilerIdCXX/CMakeCXXCompilerId.cpp new file mode 100755 index 0000000..e6d8536 --- /dev/null +++ b/Source/CMakeFiles/3.5.1/CompilerIdCXX/CMakeCXXCompilerId.cpp @@ -0,0 +1,533 @@ +/* This source file must have a .cpp extension so that all C++ compilers + recognize the extension without flags. Borland does not know .cxx for + example. */ +#ifndef __cplusplus +# error "A C compiler has been selected for C++." +#endif + + +/* Version number components: V=Version, R=Revision, P=Patch + Version date components: YYYY=Year, MM=Month, DD=Day */ + +#if defined(__COMO__) +# define COMPILER_ID "Comeau" + /* __COMO_VERSION__ = VRR */ +# define COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100) +# define COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100) + +#elif defined(__INTEL_COMPILER) || defined(__ICC) +# define COMPILER_ID "Intel" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif + /* __INTEL_COMPILER = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) +# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) +# if defined(__INTEL_COMPILER_UPDATE) +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) +# else +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) +# endif +# if defined(__INTEL_COMPILER_BUILD_DATE) + /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ +# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) +# endif +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif + +#elif defined(__PATHCC__) +# define COMPILER_ID "PathScale" +# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) +# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) +# if defined(__PATHCC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) +# endif + +#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) +# define COMPILER_ID "Embarcadero" +# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) +# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) +# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) + +#elif defined(__BORLANDC__) +# define COMPILER_ID "Borland" + /* __BORLANDC__ = 0xVRR */ +# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) +# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) + +#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 +# define COMPILER_ID "Watcom" + /* __WATCOMC__ = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__WATCOMC__) +# define COMPILER_ID "OpenWatcom" + /* __WATCOMC__ = VVRP + 1100 */ +# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__SUNPRO_CC) +# define COMPILER_ID "SunPro" +# if __SUNPRO_CC >= 0x5100 + /* __SUNPRO_CC = 0xVRRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) +# else + /* __SUNPRO_CC = 0xVRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) +# endif + +#elif defined(__HP_aCC) +# define COMPILER_ID "HP" + /* __HP_aCC = VVRRPP */ +# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000) +# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100) + +#elif defined(__DECCXX) +# define COMPILER_ID "Compaq" + /* __DECCXX_VER = VVRRTPPPP */ +# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000) +# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100) +# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000) + +#elif defined(__IBMCPP__) && defined(__COMPILER_VER__) +# define COMPILER_ID "zOS" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800 +# define COMPILER_ID "XL" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800 +# define COMPILER_ID "VisualAge" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__PGI) +# define COMPILER_ID "PGI" +# define COMPILER_VERSION_MAJOR DEC(__PGIC__) +# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) +# if defined(__PGIC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) +# endif + +#elif defined(_CRAYC) +# define COMPILER_ID "Cray" +# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) +# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) + +#elif defined(__TI_COMPILER_VERSION__) +# define COMPILER_ID "TI" + /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ +# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) +# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) +# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) + +#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version) +# define COMPILER_ID "Fujitsu" + +#elif defined(__SCO_VERSION__) +# define COMPILER_ID "SCO" + +#elif defined(__clang__) && defined(__apple_build_version__) +# define COMPILER_ID "AppleClang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) + +#elif defined(__clang__) +# define COMPILER_ID "Clang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif + +#elif defined(__GNUC__) +# define COMPILER_ID "GNU" +# define COMPILER_VERSION_MAJOR DEC(__GNUC__) +# if defined(__GNUC_MINOR__) +# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif defined(_MSC_VER) +# define COMPILER_ID "MSVC" + /* _MSC_VER = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) +# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) +# if defined(_MSC_FULL_VER) +# if _MSC_VER >= 1400 + /* _MSC_FULL_VER = VVRRPPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) +# else + /* _MSC_FULL_VER = VVRRPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) +# endif +# endif +# if defined(_MSC_BUILD) +# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) +# endif + +#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) +# define COMPILER_ID "ADSP" +#if defined(__VISUALDSPVERSION__) + /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ +# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) +# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) +#endif + +#elif defined(__IAR_SYSTEMS_ICC__ ) || defined(__IAR_SYSTEMS_ICC) +# define COMPILER_ID "IAR" + +#elif defined(__ARMCC_VERSION) +# define COMPILER_ID "ARMCC" +#if __ARMCC_VERSION >= 1000000 + /* __ARMCC_VERSION = VRRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#else + /* __ARMCC_VERSION = VRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#endif + + +#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION) +# define COMPILER_ID "MIPSpro" +# if defined(_SGI_COMPILER_VERSION) + /* _SGI_COMPILER_VERSION = VRP */ +# define COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100) +# define COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10) +# define COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION % 10) +# else + /* _COMPILER_VERSION = VRP */ +# define COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100) +# define COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10) +# define COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION % 10) +# endif + + +/* These compilers are either not known or too old to define an + identification macro. Try to identify the platform and guess that + it is the native compiler. */ +#elif defined(__sgi) +# define COMPILER_ID "MIPSpro" + +#elif defined(__hpux) || defined(__hpua) +# define COMPILER_ID "HP" + +#else /* unknown compiler */ +# define COMPILER_ID "" +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; +#ifdef SIMULATE_ID +char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; +#endif + +#ifdef __QNXNTO__ +char const* qnxnto = "INFO" ":" "qnxnto[]"; +#endif + +#if defined(__CRAYXE) || defined(__CRAYXC) +char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; +#endif + +#define STRINGIFY_HELPER(X) #X +#define STRINGIFY(X) STRINGIFY_HELPER(X) + +/* Identify known platforms by name. */ +#if defined(__linux) || defined(__linux__) || defined(linux) +# define PLATFORM_ID "Linux" + +#elif defined(__CYGWIN__) +# define PLATFORM_ID "Cygwin" + +#elif defined(__MINGW32__) +# define PLATFORM_ID "MinGW" + +#elif defined(__APPLE__) +# define PLATFORM_ID "Darwin" + +#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) +# define PLATFORM_ID "Windows" + +#elif defined(__FreeBSD__) || defined(__FreeBSD) +# define PLATFORM_ID "FreeBSD" + +#elif defined(__NetBSD__) || defined(__NetBSD) +# define PLATFORM_ID "NetBSD" + +#elif defined(__OpenBSD__) || defined(__OPENBSD) +# define PLATFORM_ID "OpenBSD" + +#elif defined(__sun) || defined(sun) +# define PLATFORM_ID "SunOS" + +#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) +# define PLATFORM_ID "AIX" + +#elif defined(__sgi) || defined(__sgi__) || defined(_SGI) +# define PLATFORM_ID "IRIX" + +#elif defined(__hpux) || defined(__hpux__) +# define PLATFORM_ID "HP-UX" + +#elif defined(__HAIKU__) +# define PLATFORM_ID "Haiku" + +#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) +# define PLATFORM_ID "BeOS" + +#elif defined(__QNX__) || defined(__QNXNTO__) +# define PLATFORM_ID "QNX" + +#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) +# define PLATFORM_ID "Tru64" + +#elif defined(__riscos) || defined(__riscos__) +# define PLATFORM_ID "RISCos" + +#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) +# define PLATFORM_ID "SINIX" + +#elif defined(__UNIX_SV__) +# define PLATFORM_ID "UNIX_SV" + +#elif defined(__bsdos__) +# define PLATFORM_ID "BSDOS" + +#elif defined(_MPRAS) || defined(MPRAS) +# define PLATFORM_ID "MP-RAS" + +#elif defined(__osf) || defined(__osf__) +# define PLATFORM_ID "OSF1" + +#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) +# define PLATFORM_ID "SCO_SV" + +#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) +# define PLATFORM_ID "ULTRIX" + +#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) +# define PLATFORM_ID "Xenix" + +#elif defined(__WATCOMC__) +# if defined(__LINUX__) +# define PLATFORM_ID "Linux" + +# elif defined(__DOS__) +# define PLATFORM_ID "DOS" + +# elif defined(__OS2__) +# define PLATFORM_ID "OS2" + +# elif defined(__WINDOWS__) +# define PLATFORM_ID "Windows3x" + +# else /* unknown platform */ +# define PLATFORM_ID "" +# endif + +#else /* unknown platform */ +# define PLATFORM_ID "" + +#endif + +/* For windows compilers MSVC and Intel we can determine + the architecture of the compiler being used. This is because + the compilers do not have flags that can change the architecture, + but rather depend on which compiler is being used +*/ +#if defined(_WIN32) && defined(_MSC_VER) +# if defined(_M_IA64) +# define ARCHITECTURE_ID "IA64" + +# elif defined(_M_X64) || defined(_M_AMD64) +# define ARCHITECTURE_ID "x64" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# elif defined(_M_ARM) +# if _M_ARM == 4 +# define ARCHITECTURE_ID "ARMV4I" +# elif _M_ARM == 5 +# define ARCHITECTURE_ID "ARMV5I" +# else +# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) +# endif + +# elif defined(_M_MIPS) +# define ARCHITECTURE_ID "MIPS" + +# elif defined(_M_SH) +# define ARCHITECTURE_ID "SHx" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__WATCOMC__) +# if defined(_M_I86) +# define ARCHITECTURE_ID "I86" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#else +# define ARCHITECTURE_ID "" +#endif + +/* Convert integer to decimal digit literals. */ +#define DEC(n) \ + ('0' + (((n) / 10000000)%10)), \ + ('0' + (((n) / 1000000)%10)), \ + ('0' + (((n) / 100000)%10)), \ + ('0' + (((n) / 10000)%10)), \ + ('0' + (((n) / 1000)%10)), \ + ('0' + (((n) / 100)%10)), \ + ('0' + (((n) / 10)%10)), \ + ('0' + ((n) % 10)) + +/* Convert integer to hex digit literals. */ +#define HEX(n) \ + ('0' + ((n)>>28 & 0xF)), \ + ('0' + ((n)>>24 & 0xF)), \ + ('0' + ((n)>>20 & 0xF)), \ + ('0' + ((n)>>16 & 0xF)), \ + ('0' + ((n)>>12 & 0xF)), \ + ('0' + ((n)>>8 & 0xF)), \ + ('0' + ((n)>>4 & 0xF)), \ + ('0' + ((n) & 0xF)) + +/* Construct a string literal encoding the version number components. */ +#ifdef COMPILER_VERSION_MAJOR +char const info_version[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', + COMPILER_VERSION_MAJOR, +# ifdef COMPILER_VERSION_MINOR + '.', COMPILER_VERSION_MINOR, +# ifdef COMPILER_VERSION_PATCH + '.', COMPILER_VERSION_PATCH, +# ifdef COMPILER_VERSION_TWEAK + '.', COMPILER_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct a string literal encoding the version number components. */ +#ifdef SIMULATE_VERSION_MAJOR +char const info_simulate_version[] = { + 'I', 'N', 'F', 'O', ':', + 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', + SIMULATE_VERSION_MAJOR, +# ifdef SIMULATE_VERSION_MINOR + '.', SIMULATE_VERSION_MINOR, +# ifdef SIMULATE_VERSION_PATCH + '.', SIMULATE_VERSION_PATCH, +# ifdef SIMULATE_VERSION_TWEAK + '.', SIMULATE_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; +char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; + + + + +const char* info_language_dialect_default = "INFO" ":" "dialect_default[" +#if __cplusplus >= 201402L + "14" +#elif __cplusplus >= 201103L + "11" +#else + "98" +#endif +"]"; + +/*--------------------------------------------------------------------------*/ + +int main(int argc, char* argv[]) +{ + int require = 0; + require += info_compiler[argc]; + require += info_platform[argc]; +#ifdef COMPILER_VERSION_MAJOR + require += info_version[argc]; +#endif +#ifdef SIMULATE_ID + require += info_simulate[argc]; +#endif +#ifdef SIMULATE_VERSION_MAJOR + require += info_simulate_version[argc]; +#endif +#if defined(__CRAYXE) || defined(__CRAYXC) + require += info_cray[argc]; +#endif + require += info_language_dialect_default[argc]; + (void)argv; + return require; +} diff --git a/Source/CMakeFiles/3.5.1/CompilerIdCXX/a.out b/Source/CMakeFiles/3.5.1/CompilerIdCXX/a.out new file mode 100755 index 0000000..f493287 Binary files /dev/null and b/Source/CMakeFiles/3.5.1/CompilerIdCXX/a.out differ diff --git a/Source/CMakeFiles/CMakeDirectoryInformation.cmake b/Source/CMakeFiles/CMakeDirectoryInformation.cmake new file mode 100755 index 0000000..8481ace --- /dev/null +++ b/Source/CMakeFiles/CMakeDirectoryInformation.cmake @@ -0,0 +1,16 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.5 + +# Relative path conversion top directories. +set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/home/user/Downloads/libs/Source") +set(CMAKE_RELATIVE_PATH_TOP_BINARY "/home/user/Downloads/libs/Source") + +# Force unix paths in dependencies. +set(CMAKE_FORCE_UNIX_PATHS 1) + + +# The C and CXX include file regular expressions for this directory. +set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") +set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") +set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) +set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) diff --git a/Source/CMakeFiles/CMakeOutput.log b/Source/CMakeFiles/CMakeOutput.log new file mode 100755 index 0000000..359cb39 --- /dev/null +++ b/Source/CMakeFiles/CMakeOutput.log @@ -0,0 +1,554 @@ +The system is: Linux - 4.10.0-42-generic - x86_64 +Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded. +Compiler: /usr/bin/cc +Build flags: +Id flags: + +The output was: +0 + + +Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "a.out" + +The C compiler identification is GNU, found in "/home/user/Downloads/libs/Source/CMakeFiles/3.5.1/CompilerIdC/a.out" + +Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded. +Compiler: /usr/bin/c++ +Build flags: +Id flags: + +The output was: +0 + + +Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.out" + +The CXX compiler identification is GNU, found in "/home/user/Downloads/libs/Source/CMakeFiles/3.5.1/CompilerIdCXX/a.out" + +Determining if the C compiler works passed with the following output: +Change Dir: /home/user/Downloads/libs/Source/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_9b1f4/fast" +/usr/bin/make -f CMakeFiles/cmTC_9b1f4.dir/build.make CMakeFiles/cmTC_9b1f4.dir/build +make[1]: Entering directory '/home/user/Downloads/libs/Source/CMakeFiles/CMakeTmp' +Building C object CMakeFiles/cmTC_9b1f4.dir/testCCompiler.c.o +/usr/bin/cc -o CMakeFiles/cmTC_9b1f4.dir/testCCompiler.c.o -c /home/user/Downloads/libs/Source/CMakeFiles/CMakeTmp/testCCompiler.c +Linking C executable cmTC_9b1f4 +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_9b1f4.dir/link.txt --verbose=1 +/usr/bin/cc CMakeFiles/cmTC_9b1f4.dir/testCCompiler.c.o -o cmTC_9b1f4 -rdynamic +make[1]: Leaving directory '/home/user/Downloads/libs/Source/CMakeFiles/CMakeTmp' + + +Detecting C compiler ABI info compiled with the following output: +Change Dir: /home/user/Downloads/libs/Source/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_1b7eb/fast" +/usr/bin/make -f CMakeFiles/cmTC_1b7eb.dir/build.make CMakeFiles/cmTC_1b7eb.dir/build +make[1]: Entering directory '/home/user/Downloads/libs/Source/CMakeFiles/CMakeTmp' +Building C object CMakeFiles/cmTC_1b7eb.dir/CMakeCCompilerABI.c.o +/usr/bin/cc -o CMakeFiles/cmTC_1b7eb.dir/CMakeCCompilerABI.c.o -c /usr/share/cmake-3.5/Modules/CMakeCCompilerABI.c +Linking C executable cmTC_1b7eb +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_1b7eb.dir/link.txt --verbose=1 +/usr/bin/cc -v CMakeFiles/cmTC_1b7eb.dir/CMakeCCompilerABI.c.o -o cmTC_1b7eb -rdynamic +Using built-in specs. +COLLECT_GCC=/usr/bin/cc +COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper +Target: x86_64-linux-gnu +Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.5' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu +Thread model: posix +gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.5) +COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/ +LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/ +COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_1b7eb' '-rdynamic' '-mtune=generic' '-march=x86-64' + /usr/lib/gcc/x86_64-linux-gnu/5/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper -plugin-opt=-fresolution=/tmp/ccDgIFp2.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro -o cmTC_1b7eb /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. CMakeFiles/cmTC_1b7eb.dir/CMakeCCompilerABI.c.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o +make[1]: Leaving directory '/home/user/Downloads/libs/Source/CMakeFiles/CMakeTmp' + + +Parsed C implicit link information from above output: + link line regex: [^( *|.*[/\])(ld|([^/\]+-)?ld|collect2)[^/\]*( |$)] + ignore line: [Change Dir: /home/user/Downloads/libs/Source/CMakeFiles/CMakeTmp] + ignore line: [] + ignore line: [Run Build Command:"/usr/bin/make" "cmTC_1b7eb/fast"] + ignore line: [/usr/bin/make -f CMakeFiles/cmTC_1b7eb.dir/build.make CMakeFiles/cmTC_1b7eb.dir/build] + ignore line: [make[1]: Entering directory '/home/user/Downloads/libs/Source/CMakeFiles/CMakeTmp'] + ignore line: [Building C object CMakeFiles/cmTC_1b7eb.dir/CMakeCCompilerABI.c.o] + ignore line: [/usr/bin/cc -o CMakeFiles/cmTC_1b7eb.dir/CMakeCCompilerABI.c.o -c /usr/share/cmake-3.5/Modules/CMakeCCompilerABI.c] + ignore line: [Linking C executable cmTC_1b7eb] + ignore line: [/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_1b7eb.dir/link.txt --verbose=1] + ignore line: [/usr/bin/cc -v CMakeFiles/cmTC_1b7eb.dir/CMakeCCompilerABI.c.o -o cmTC_1b7eb -rdynamic ] + ignore line: [Using built-in specs.] + ignore line: [COLLECT_GCC=/usr/bin/cc] + ignore line: [COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper] + ignore line: [Target: x86_64-linux-gnu] + ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.5' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu] + ignore line: [Thread model: posix] + ignore line: [gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.5) ] + ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/] + ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_1b7eb' '-rdynamic' '-mtune=generic' '-march=x86-64'] + link line: [ /usr/lib/gcc/x86_64-linux-gnu/5/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper -plugin-opt=-fresolution=/tmp/ccDgIFp2.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro -o cmTC_1b7eb /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. CMakeFiles/cmTC_1b7eb.dir/CMakeCCompilerABI.c.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o] + arg [/usr/lib/gcc/x86_64-linux-gnu/5/collect2] ==> ignore + arg [-plugin] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so] ==> ignore + arg [-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper] ==> ignore + arg [-plugin-opt=-fresolution=/tmp/ccDgIFp2.res] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore + arg [-plugin-opt=-pass-through=-lc] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore + arg [--sysroot=/] ==> ignore + arg [--build-id] ==> ignore + arg [--eh-frame-hdr] ==> ignore + arg [-m] ==> ignore + arg [elf_x86_64] ==> ignore + arg [--hash-style=gnu] ==> ignore + arg [--as-needed] ==> ignore + arg [-export-dynamic] ==> ignore + arg [-dynamic-linker] ==> ignore + arg [/lib64/ld-linux-x86-64.so.2] ==> ignore + arg [-zrelro] ==> ignore + arg [-o] ==> ignore + arg [cmTC_1b7eb] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o] ==> ignore + arg [-L/usr/lib/gcc/x86_64-linux-gnu/5] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/5] + arg [-L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu] + arg [-L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib] + arg [-L/lib/x86_64-linux-gnu] ==> dir [/lib/x86_64-linux-gnu] + arg [-L/lib/../lib] ==> dir [/lib/../lib] + arg [-L/usr/lib/x86_64-linux-gnu] ==> dir [/usr/lib/x86_64-linux-gnu] + arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib] + arg [-L/usr/lib/gcc/x86_64-linux-gnu/5/../../..] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../..] + arg [CMakeFiles/cmTC_1b7eb.dir/CMakeCCompilerABI.c.o] ==> ignore + arg [-lgcc] ==> lib [gcc] + arg [--as-needed] ==> ignore + arg [-lgcc_s] ==> lib [gcc_s] + arg [--no-as-needed] ==> ignore + arg [-lc] ==> lib [c] + arg [-lgcc] ==> lib [gcc] + arg [--as-needed] ==> ignore + arg [-lgcc_s] ==> lib [gcc_s] + arg [--no-as-needed] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/5/crtend.o] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o] ==> ignore + remove lib [gcc] + remove lib [gcc_s] + remove lib [gcc] + remove lib [gcc_s] + collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/5] ==> [/usr/lib/gcc/x86_64-linux-gnu/5] + collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu] + collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib] ==> [/usr/lib] + collapse library dir [/lib/x86_64-linux-gnu] ==> [/lib/x86_64-linux-gnu] + collapse library dir [/lib/../lib] ==> [/lib] + collapse library dir [/usr/lib/x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu] + collapse library dir [/usr/lib/../lib] ==> [/usr/lib] + collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../..] ==> [/usr/lib] + implicit libs: [c] + implicit dirs: [/usr/lib/gcc/x86_64-linux-gnu/5;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib] + implicit fwks: [] + + + + +Detecting C [-std=c11] compiler features compiled with the following output: +Change Dir: /home/user/Downloads/libs/Source/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_4b3f2/fast" +/usr/bin/make -f CMakeFiles/cmTC_4b3f2.dir/build.make CMakeFiles/cmTC_4b3f2.dir/build +make[1]: Entering directory '/home/user/Downloads/libs/Source/CMakeFiles/CMakeTmp' +Building C object CMakeFiles/cmTC_4b3f2.dir/feature_tests.c.o +/usr/bin/cc -std=c11 -o CMakeFiles/cmTC_4b3f2.dir/feature_tests.c.o -c /home/user/Downloads/libs/Source/CMakeFiles/feature_tests.c +Linking C executable cmTC_4b3f2 +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_4b3f2.dir/link.txt --verbose=1 +/usr/bin/cc CMakeFiles/cmTC_4b3f2.dir/feature_tests.c.o -o cmTC_4b3f2 -rdynamic +make[1]: Leaving directory '/home/user/Downloads/libs/Source/CMakeFiles/CMakeTmp' + + + Feature record: C_FEATURE:1c_function_prototypes + Feature record: C_FEATURE:1c_restrict + Feature record: C_FEATURE:1c_static_assert + Feature record: C_FEATURE:1c_variadic_macros + + +Detecting C [-std=c99] compiler features compiled with the following output: +Change Dir: /home/user/Downloads/libs/Source/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_8c0d8/fast" +/usr/bin/make -f CMakeFiles/cmTC_8c0d8.dir/build.make CMakeFiles/cmTC_8c0d8.dir/build +make[1]: Entering directory '/home/user/Downloads/libs/Source/CMakeFiles/CMakeTmp' +Building C object CMakeFiles/cmTC_8c0d8.dir/feature_tests.c.o +/usr/bin/cc -std=c99 -o CMakeFiles/cmTC_8c0d8.dir/feature_tests.c.o -c /home/user/Downloads/libs/Source/CMakeFiles/feature_tests.c +Linking C executable cmTC_8c0d8 +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_8c0d8.dir/link.txt --verbose=1 +/usr/bin/cc CMakeFiles/cmTC_8c0d8.dir/feature_tests.c.o -o cmTC_8c0d8 -rdynamic +make[1]: Leaving directory '/home/user/Downloads/libs/Source/CMakeFiles/CMakeTmp' + + + Feature record: C_FEATURE:1c_function_prototypes + Feature record: C_FEATURE:1c_restrict + Feature record: C_FEATURE:0c_static_assert + Feature record: C_FEATURE:1c_variadic_macros + + +Detecting C [-std=c90] compiler features compiled with the following output: +Change Dir: /home/user/Downloads/libs/Source/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_6cd3b/fast" +/usr/bin/make -f CMakeFiles/cmTC_6cd3b.dir/build.make CMakeFiles/cmTC_6cd3b.dir/build +make[1]: Entering directory '/home/user/Downloads/libs/Source/CMakeFiles/CMakeTmp' +Building C object CMakeFiles/cmTC_6cd3b.dir/feature_tests.c.o +/usr/bin/cc -std=c90 -o CMakeFiles/cmTC_6cd3b.dir/feature_tests.c.o -c /home/user/Downloads/libs/Source/CMakeFiles/feature_tests.c +Linking C executable cmTC_6cd3b +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_6cd3b.dir/link.txt --verbose=1 +/usr/bin/cc CMakeFiles/cmTC_6cd3b.dir/feature_tests.c.o -o cmTC_6cd3b -rdynamic +make[1]: Leaving directory '/home/user/Downloads/libs/Source/CMakeFiles/CMakeTmp' + + + Feature record: C_FEATURE:1c_function_prototypes + Feature record: C_FEATURE:0c_restrict + Feature record: C_FEATURE:0c_static_assert + Feature record: C_FEATURE:0c_variadic_macros +Determining if the CXX compiler works passed with the following output: +Change Dir: /home/user/Downloads/libs/Source/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_1c713/fast" +/usr/bin/make -f CMakeFiles/cmTC_1c713.dir/build.make CMakeFiles/cmTC_1c713.dir/build +make[1]: Entering directory '/home/user/Downloads/libs/Source/CMakeFiles/CMakeTmp' +Building CXX object CMakeFiles/cmTC_1c713.dir/testCXXCompiler.cxx.o +/usr/bin/c++ -o CMakeFiles/cmTC_1c713.dir/testCXXCompiler.cxx.o -c /home/user/Downloads/libs/Source/CMakeFiles/CMakeTmp/testCXXCompiler.cxx +Linking CXX executable cmTC_1c713 +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_1c713.dir/link.txt --verbose=1 +/usr/bin/c++ CMakeFiles/cmTC_1c713.dir/testCXXCompiler.cxx.o -o cmTC_1c713 -rdynamic +make[1]: Leaving directory '/home/user/Downloads/libs/Source/CMakeFiles/CMakeTmp' + + +Detecting CXX compiler ABI info compiled with the following output: +Change Dir: /home/user/Downloads/libs/Source/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_8ec97/fast" +/usr/bin/make -f CMakeFiles/cmTC_8ec97.dir/build.make CMakeFiles/cmTC_8ec97.dir/build +make[1]: Entering directory '/home/user/Downloads/libs/Source/CMakeFiles/CMakeTmp' +Building CXX object CMakeFiles/cmTC_8ec97.dir/CMakeCXXCompilerABI.cpp.o +/usr/bin/c++ -o CMakeFiles/cmTC_8ec97.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake-3.5/Modules/CMakeCXXCompilerABI.cpp +Linking CXX executable cmTC_8ec97 +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_8ec97.dir/link.txt --verbose=1 +/usr/bin/c++ -v CMakeFiles/cmTC_8ec97.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_8ec97 -rdynamic +Using built-in specs. +COLLECT_GCC=/usr/bin/c++ +COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper +Target: x86_64-linux-gnu +Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.5' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu +Thread model: posix +gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.5) +COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/ +LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/ +COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_8ec97' '-rdynamic' '-shared-libgcc' '-mtune=generic' '-march=x86-64' + /usr/lib/gcc/x86_64-linux-gnu/5/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper -plugin-opt=-fresolution=/tmp/ccUvW5JG.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro -o cmTC_8ec97 /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. CMakeFiles/cmTC_8ec97.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o +make[1]: Leaving directory '/home/user/Downloads/libs/Source/CMakeFiles/CMakeTmp' + + +Parsed CXX implicit link information from above output: + link line regex: [^( *|.*[/\])(ld|([^/\]+-)?ld|collect2)[^/\]*( |$)] + ignore line: [Change Dir: /home/user/Downloads/libs/Source/CMakeFiles/CMakeTmp] + ignore line: [] + ignore line: [Run Build Command:"/usr/bin/make" "cmTC_8ec97/fast"] + ignore line: [/usr/bin/make -f CMakeFiles/cmTC_8ec97.dir/build.make CMakeFiles/cmTC_8ec97.dir/build] + ignore line: [make[1]: Entering directory '/home/user/Downloads/libs/Source/CMakeFiles/CMakeTmp'] + ignore line: [Building CXX object CMakeFiles/cmTC_8ec97.dir/CMakeCXXCompilerABI.cpp.o] + ignore line: [/usr/bin/c++ -o CMakeFiles/cmTC_8ec97.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake-3.5/Modules/CMakeCXXCompilerABI.cpp] + ignore line: [Linking CXX executable cmTC_8ec97] + ignore line: [/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_8ec97.dir/link.txt --verbose=1] + ignore line: [/usr/bin/c++ -v CMakeFiles/cmTC_8ec97.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_8ec97 -rdynamic ] + ignore line: [Using built-in specs.] + ignore line: [COLLECT_GCC=/usr/bin/c++] + ignore line: [COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper] + ignore line: [Target: x86_64-linux-gnu] + ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.5' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu] + ignore line: [Thread model: posix] + ignore line: [gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.5) ] + ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/] + ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_8ec97' '-rdynamic' '-shared-libgcc' '-mtune=generic' '-march=x86-64'] + link line: [ /usr/lib/gcc/x86_64-linux-gnu/5/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper -plugin-opt=-fresolution=/tmp/ccUvW5JG.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro -o cmTC_8ec97 /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. CMakeFiles/cmTC_8ec97.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o] + arg [/usr/lib/gcc/x86_64-linux-gnu/5/collect2] ==> ignore + arg [-plugin] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so] ==> ignore + arg [-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper] ==> ignore + arg [-plugin-opt=-fresolution=/tmp/ccUvW5JG.res] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc] ==> ignore + arg [-plugin-opt=-pass-through=-lc] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc] ==> ignore + arg [--sysroot=/] ==> ignore + arg [--build-id] ==> ignore + arg [--eh-frame-hdr] ==> ignore + arg [-m] ==> ignore + arg [elf_x86_64] ==> ignore + arg [--hash-style=gnu] ==> ignore + arg [--as-needed] ==> ignore + arg [-export-dynamic] ==> ignore + arg [-dynamic-linker] ==> ignore + arg [/lib64/ld-linux-x86-64.so.2] ==> ignore + arg [-zrelro] ==> ignore + arg [-o] ==> ignore + arg [cmTC_8ec97] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o] ==> ignore + arg [-L/usr/lib/gcc/x86_64-linux-gnu/5] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/5] + arg [-L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu] + arg [-L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib] + arg [-L/lib/x86_64-linux-gnu] ==> dir [/lib/x86_64-linux-gnu] + arg [-L/lib/../lib] ==> dir [/lib/../lib] + arg [-L/usr/lib/x86_64-linux-gnu] ==> dir [/usr/lib/x86_64-linux-gnu] + arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib] + arg [-L/usr/lib/gcc/x86_64-linux-gnu/5/../../..] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../..] + arg [CMakeFiles/cmTC_8ec97.dir/CMakeCXXCompilerABI.cpp.o] ==> ignore + arg [-lstdc++] ==> lib [stdc++] + arg [-lm] ==> lib [m] + arg [-lgcc_s] ==> lib [gcc_s] + arg [-lgcc] ==> lib [gcc] + arg [-lc] ==> lib [c] + arg [-lgcc_s] ==> lib [gcc_s] + arg [-lgcc] ==> lib [gcc] + arg [/usr/lib/gcc/x86_64-linux-gnu/5/crtend.o] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o] ==> ignore + remove lib [gcc_s] + remove lib [gcc] + remove lib [gcc_s] + remove lib [gcc] + collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/5] ==> [/usr/lib/gcc/x86_64-linux-gnu/5] + collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu] + collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib] ==> [/usr/lib] + collapse library dir [/lib/x86_64-linux-gnu] ==> [/lib/x86_64-linux-gnu] + collapse library dir [/lib/../lib] ==> [/lib] + collapse library dir [/usr/lib/x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu] + collapse library dir [/usr/lib/../lib] ==> [/usr/lib] + collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../..] ==> [/usr/lib] + implicit libs: [stdc++;m;c] + implicit dirs: [/usr/lib/gcc/x86_64-linux-gnu/5;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib] + implicit fwks: [] + + + + +Detecting CXX [-std=c++14] compiler features compiled with the following output: +Change Dir: /home/user/Downloads/libs/Source/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_0304a/fast" +/usr/bin/make -f CMakeFiles/cmTC_0304a.dir/build.make CMakeFiles/cmTC_0304a.dir/build +make[1]: Entering directory '/home/user/Downloads/libs/Source/CMakeFiles/CMakeTmp' +Building CXX object CMakeFiles/cmTC_0304a.dir/feature_tests.cxx.o +/usr/bin/c++ -std=c++14 -o CMakeFiles/cmTC_0304a.dir/feature_tests.cxx.o -c /home/user/Downloads/libs/Source/CMakeFiles/feature_tests.cxx +Linking CXX executable cmTC_0304a +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_0304a.dir/link.txt --verbose=1 +/usr/bin/c++ CMakeFiles/cmTC_0304a.dir/feature_tests.cxx.o -o cmTC_0304a -rdynamic +make[1]: Leaving directory '/home/user/Downloads/libs/Source/CMakeFiles/CMakeTmp' + + + Feature record: CXX_FEATURE:1cxx_aggregate_default_initializers + Feature record: CXX_FEATURE:1cxx_alias_templates + Feature record: CXX_FEATURE:1cxx_alignas + Feature record: CXX_FEATURE:1cxx_alignof + Feature record: CXX_FEATURE:1cxx_attributes + Feature record: CXX_FEATURE:1cxx_attribute_deprecated + Feature record: CXX_FEATURE:1cxx_auto_type + Feature record: CXX_FEATURE:1cxx_binary_literals + Feature record: CXX_FEATURE:1cxx_constexpr + Feature record: CXX_FEATURE:1cxx_contextual_conversions + Feature record: CXX_FEATURE:1cxx_decltype + Feature record: CXX_FEATURE:1cxx_decltype_auto + Feature record: CXX_FEATURE:1cxx_decltype_incomplete_return_types + Feature record: CXX_FEATURE:1cxx_default_function_template_args + Feature record: CXX_FEATURE:1cxx_defaulted_functions + Feature record: CXX_FEATURE:1cxx_defaulted_move_initializers + Feature record: CXX_FEATURE:1cxx_delegating_constructors + Feature record: CXX_FEATURE:1cxx_deleted_functions + Feature record: CXX_FEATURE:1cxx_digit_separators + Feature record: CXX_FEATURE:1cxx_enum_forward_declarations + Feature record: CXX_FEATURE:1cxx_explicit_conversions + Feature record: CXX_FEATURE:1cxx_extended_friend_declarations + Feature record: CXX_FEATURE:1cxx_extern_templates + Feature record: CXX_FEATURE:1cxx_final + Feature record: CXX_FEATURE:1cxx_func_identifier + Feature record: CXX_FEATURE:1cxx_generalized_initializers + Feature record: CXX_FEATURE:1cxx_generic_lambdas + Feature record: CXX_FEATURE:1cxx_inheriting_constructors + Feature record: CXX_FEATURE:1cxx_inline_namespaces + Feature record: CXX_FEATURE:1cxx_lambdas + Feature record: CXX_FEATURE:1cxx_lambda_init_captures + Feature record: CXX_FEATURE:1cxx_local_type_template_args + Feature record: CXX_FEATURE:1cxx_long_long_type + Feature record: CXX_FEATURE:1cxx_noexcept + Feature record: CXX_FEATURE:1cxx_nonstatic_member_init + Feature record: CXX_FEATURE:1cxx_nullptr + Feature record: CXX_FEATURE:1cxx_override + Feature record: CXX_FEATURE:1cxx_range_for + Feature record: CXX_FEATURE:1cxx_raw_string_literals + Feature record: CXX_FEATURE:1cxx_reference_qualified_functions + Feature record: CXX_FEATURE:1cxx_relaxed_constexpr + Feature record: CXX_FEATURE:1cxx_return_type_deduction + Feature record: CXX_FEATURE:1cxx_right_angle_brackets + Feature record: CXX_FEATURE:1cxx_rvalue_references + Feature record: CXX_FEATURE:1cxx_sizeof_member + Feature record: CXX_FEATURE:1cxx_static_assert + Feature record: CXX_FEATURE:1cxx_strong_enums + Feature record: CXX_FEATURE:1cxx_template_template_parameters + Feature record: CXX_FEATURE:1cxx_thread_local + Feature record: CXX_FEATURE:1cxx_trailing_return_types + Feature record: CXX_FEATURE:1cxx_unicode_literals + Feature record: CXX_FEATURE:1cxx_uniform_initialization + Feature record: CXX_FEATURE:1cxx_unrestricted_unions + Feature record: CXX_FEATURE:1cxx_user_literals + Feature record: CXX_FEATURE:1cxx_variable_templates + Feature record: CXX_FEATURE:1cxx_variadic_macros + Feature record: CXX_FEATURE:1cxx_variadic_templates + + +Detecting CXX [-std=c++11] compiler features compiled with the following output: +Change Dir: /home/user/Downloads/libs/Source/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_ddb42/fast" +/usr/bin/make -f CMakeFiles/cmTC_ddb42.dir/build.make CMakeFiles/cmTC_ddb42.dir/build +make[1]: Entering directory '/home/user/Downloads/libs/Source/CMakeFiles/CMakeTmp' +Building CXX object CMakeFiles/cmTC_ddb42.dir/feature_tests.cxx.o +/usr/bin/c++ -std=c++11 -o CMakeFiles/cmTC_ddb42.dir/feature_tests.cxx.o -c /home/user/Downloads/libs/Source/CMakeFiles/feature_tests.cxx +Linking CXX executable cmTC_ddb42 +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_ddb42.dir/link.txt --verbose=1 +/usr/bin/c++ CMakeFiles/cmTC_ddb42.dir/feature_tests.cxx.o -o cmTC_ddb42 -rdynamic +make[1]: Leaving directory '/home/user/Downloads/libs/Source/CMakeFiles/CMakeTmp' + + + Feature record: CXX_FEATURE:0cxx_aggregate_default_initializers + Feature record: CXX_FEATURE:1cxx_alias_templates + Feature record: CXX_FEATURE:1cxx_alignas + Feature record: CXX_FEATURE:1cxx_alignof + Feature record: CXX_FEATURE:1cxx_attributes + Feature record: CXX_FEATURE:0cxx_attribute_deprecated + Feature record: CXX_FEATURE:1cxx_auto_type + Feature record: CXX_FEATURE:0cxx_binary_literals + Feature record: CXX_FEATURE:1cxx_constexpr + Feature record: CXX_FEATURE:0cxx_contextual_conversions + Feature record: CXX_FEATURE:1cxx_decltype + Feature record: CXX_FEATURE:0cxx_decltype_auto + Feature record: CXX_FEATURE:1cxx_decltype_incomplete_return_types + Feature record: CXX_FEATURE:1cxx_default_function_template_args + Feature record: CXX_FEATURE:1cxx_defaulted_functions + Feature record: CXX_FEATURE:1cxx_defaulted_move_initializers + Feature record: CXX_FEATURE:1cxx_delegating_constructors + Feature record: CXX_FEATURE:1cxx_deleted_functions + Feature record: CXX_FEATURE:0cxx_digit_separators + Feature record: CXX_FEATURE:1cxx_enum_forward_declarations + Feature record: CXX_FEATURE:1cxx_explicit_conversions + Feature record: CXX_FEATURE:1cxx_extended_friend_declarations + Feature record: CXX_FEATURE:1cxx_extern_templates + Feature record: CXX_FEATURE:1cxx_final + Feature record: CXX_FEATURE:1cxx_func_identifier + Feature record: CXX_FEATURE:1cxx_generalized_initializers + Feature record: CXX_FEATURE:0cxx_generic_lambdas + Feature record: CXX_FEATURE:1cxx_inheriting_constructors + Feature record: CXX_FEATURE:1cxx_inline_namespaces + Feature record: CXX_FEATURE:1cxx_lambdas + Feature record: CXX_FEATURE:0cxx_lambda_init_captures + Feature record: CXX_FEATURE:1cxx_local_type_template_args + Feature record: CXX_FEATURE:1cxx_long_long_type + Feature record: CXX_FEATURE:1cxx_noexcept + Feature record: CXX_FEATURE:1cxx_nonstatic_member_init + Feature record: CXX_FEATURE:1cxx_nullptr + Feature record: CXX_FEATURE:1cxx_override + Feature record: CXX_FEATURE:1cxx_range_for + Feature record: CXX_FEATURE:1cxx_raw_string_literals + Feature record: CXX_FEATURE:1cxx_reference_qualified_functions + Feature record: CXX_FEATURE:0cxx_relaxed_constexpr + Feature record: CXX_FEATURE:0cxx_return_type_deduction + Feature record: CXX_FEATURE:1cxx_right_angle_brackets + Feature record: CXX_FEATURE:1cxx_rvalue_references + Feature record: CXX_FEATURE:1cxx_sizeof_member + Feature record: CXX_FEATURE:1cxx_static_assert + Feature record: CXX_FEATURE:1cxx_strong_enums + Feature record: CXX_FEATURE:1cxx_template_template_parameters + Feature record: CXX_FEATURE:1cxx_thread_local + Feature record: CXX_FEATURE:1cxx_trailing_return_types + Feature record: CXX_FEATURE:1cxx_unicode_literals + Feature record: CXX_FEATURE:1cxx_uniform_initialization + Feature record: CXX_FEATURE:1cxx_unrestricted_unions + Feature record: CXX_FEATURE:1cxx_user_literals + Feature record: CXX_FEATURE:0cxx_variable_templates + Feature record: CXX_FEATURE:1cxx_variadic_macros + Feature record: CXX_FEATURE:1cxx_variadic_templates + + +Detecting CXX [-std=c++98] compiler features compiled with the following output: +Change Dir: /home/user/Downloads/libs/Source/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_cf362/fast" +/usr/bin/make -f CMakeFiles/cmTC_cf362.dir/build.make CMakeFiles/cmTC_cf362.dir/build +make[1]: Entering directory '/home/user/Downloads/libs/Source/CMakeFiles/CMakeTmp' +Building CXX object CMakeFiles/cmTC_cf362.dir/feature_tests.cxx.o +/usr/bin/c++ -std=c++98 -o CMakeFiles/cmTC_cf362.dir/feature_tests.cxx.o -c /home/user/Downloads/libs/Source/CMakeFiles/feature_tests.cxx +Linking CXX executable cmTC_cf362 +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_cf362.dir/link.txt --verbose=1 +/usr/bin/c++ CMakeFiles/cmTC_cf362.dir/feature_tests.cxx.o -o cmTC_cf362 -rdynamic +make[1]: Leaving directory '/home/user/Downloads/libs/Source/CMakeFiles/CMakeTmp' + + + Feature record: CXX_FEATURE:0cxx_aggregate_default_initializers + Feature record: CXX_FEATURE:0cxx_alias_templates + Feature record: CXX_FEATURE:0cxx_alignas + Feature record: CXX_FEATURE:0cxx_alignof + Feature record: CXX_FEATURE:0cxx_attributes + Feature record: CXX_FEATURE:0cxx_attribute_deprecated + Feature record: CXX_FEATURE:0cxx_auto_type + Feature record: CXX_FEATURE:0cxx_binary_literals + Feature record: CXX_FEATURE:0cxx_constexpr + Feature record: CXX_FEATURE:0cxx_contextual_conversions + Feature record: CXX_FEATURE:0cxx_decltype + Feature record: CXX_FEATURE:0cxx_decltype_auto + Feature record: CXX_FEATURE:0cxx_decltype_incomplete_return_types + Feature record: CXX_FEATURE:0cxx_default_function_template_args + Feature record: CXX_FEATURE:0cxx_defaulted_functions + Feature record: CXX_FEATURE:0cxx_defaulted_move_initializers + Feature record: CXX_FEATURE:0cxx_delegating_constructors + Feature record: CXX_FEATURE:0cxx_deleted_functions + Feature record: CXX_FEATURE:0cxx_digit_separators + Feature record: CXX_FEATURE:0cxx_enum_forward_declarations + Feature record: CXX_FEATURE:0cxx_explicit_conversions + Feature record: CXX_FEATURE:0cxx_extended_friend_declarations + Feature record: CXX_FEATURE:0cxx_extern_templates + Feature record: CXX_FEATURE:0cxx_final + Feature record: CXX_FEATURE:0cxx_func_identifier + Feature record: CXX_FEATURE:0cxx_generalized_initializers + Feature record: CXX_FEATURE:0cxx_generic_lambdas + Feature record: CXX_FEATURE:0cxx_inheriting_constructors + Feature record: CXX_FEATURE:0cxx_inline_namespaces + Feature record: CXX_FEATURE:0cxx_lambdas + Feature record: CXX_FEATURE:0cxx_lambda_init_captures + Feature record: CXX_FEATURE:0cxx_local_type_template_args + Feature record: CXX_FEATURE:0cxx_long_long_type + Feature record: CXX_FEATURE:0cxx_noexcept + Feature record: CXX_FEATURE:0cxx_nonstatic_member_init + Feature record: CXX_FEATURE:0cxx_nullptr + Feature record: CXX_FEATURE:0cxx_override + Feature record: CXX_FEATURE:0cxx_range_for + Feature record: CXX_FEATURE:0cxx_raw_string_literals + Feature record: CXX_FEATURE:0cxx_reference_qualified_functions + Feature record: CXX_FEATURE:0cxx_relaxed_constexpr + Feature record: CXX_FEATURE:0cxx_return_type_deduction + Feature record: CXX_FEATURE:0cxx_right_angle_brackets + Feature record: CXX_FEATURE:0cxx_rvalue_references + Feature record: CXX_FEATURE:0cxx_sizeof_member + Feature record: CXX_FEATURE:0cxx_static_assert + Feature record: CXX_FEATURE:0cxx_strong_enums + Feature record: CXX_FEATURE:1cxx_template_template_parameters + Feature record: CXX_FEATURE:0cxx_thread_local + Feature record: CXX_FEATURE:0cxx_trailing_return_types + Feature record: CXX_FEATURE:0cxx_unicode_literals + Feature record: CXX_FEATURE:0cxx_uniform_initialization + Feature record: CXX_FEATURE:0cxx_unrestricted_unions + Feature record: CXX_FEATURE:0cxx_user_literals + Feature record: CXX_FEATURE:0cxx_variable_templates + Feature record: CXX_FEATURE:0cxx_variadic_macros + Feature record: CXX_FEATURE:0cxx_variadic_templates diff --git a/Source/CMakeFiles/Makefile.cmake b/Source/CMakeFiles/Makefile.cmake new file mode 100755 index 0000000..616dbc0 --- /dev/null +++ b/Source/CMakeFiles/Makefile.cmake @@ -0,0 +1,115 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.5 + +# The generator used is: +set(CMAKE_DEPENDS_GENERATOR "Unix Makefiles") + +# The top level Makefile was generated from the following files: +set(CMAKE_MAKEFILE_DEPENDS + "CMakeCache.txt" + "CMakeFiles/3.5.1/CMakeCCompiler.cmake" + "CMakeFiles/3.5.1/CMakeCXXCompiler.cmake" + "CMakeFiles/3.5.1/CMakeSystem.cmake" + "CMakeFiles/feature_tests.c" + "CMakeFiles/feature_tests.cxx" + "CMakeLists.txt" + "/usr/share/cmake-3.5/Modules/CMakeCCompiler.cmake.in" + "/usr/share/cmake-3.5/Modules/CMakeCCompilerABI.c" + "/usr/share/cmake-3.5/Modules/CMakeCInformation.cmake" + "/usr/share/cmake-3.5/Modules/CMakeCXXCompiler.cmake.in" + "/usr/share/cmake-3.5/Modules/CMakeCXXCompilerABI.cpp" + "/usr/share/cmake-3.5/Modules/CMakeCXXInformation.cmake" + "/usr/share/cmake-3.5/Modules/CMakeCommonLanguageInclude.cmake" + "/usr/share/cmake-3.5/Modules/CMakeCompilerIdDetection.cmake" + "/usr/share/cmake-3.5/Modules/CMakeDetermineCCompiler.cmake" + "/usr/share/cmake-3.5/Modules/CMakeDetermineCXXCompiler.cmake" + "/usr/share/cmake-3.5/Modules/CMakeDetermineCompileFeatures.cmake" + "/usr/share/cmake-3.5/Modules/CMakeDetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/CMakeDetermineCompilerABI.cmake" + "/usr/share/cmake-3.5/Modules/CMakeDetermineCompilerId.cmake" + "/usr/share/cmake-3.5/Modules/CMakeDetermineSystem.cmake" + "/usr/share/cmake-3.5/Modules/CMakeFindBinUtils.cmake" + "/usr/share/cmake-3.5/Modules/CMakeGenericSystem.cmake" + "/usr/share/cmake-3.5/Modules/CMakeLanguageInformation.cmake" + "/usr/share/cmake-3.5/Modules/CMakeParseArguments.cmake" + "/usr/share/cmake-3.5/Modules/CMakeParseImplicitLinkInfo.cmake" + "/usr/share/cmake-3.5/Modules/CMakeSystem.cmake.in" + "/usr/share/cmake-3.5/Modules/CMakeSystemSpecificInformation.cmake" + "/usr/share/cmake-3.5/Modules/CMakeSystemSpecificInitialize.cmake" + "/usr/share/cmake-3.5/Modules/CMakeTestCCompiler.cmake" + "/usr/share/cmake-3.5/Modules/CMakeTestCXXCompiler.cmake" + "/usr/share/cmake-3.5/Modules/CMakeTestCompilerCommon.cmake" + "/usr/share/cmake-3.5/Modules/CMakeUnixFindMake.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/ADSP-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/ARMCC-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/AppleClang-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/Borland-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/Clang-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/Clang-DetermineCompilerInternal.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/Comeau-CXX-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/Compaq-C-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/Compaq-CXX-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/Cray-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/Embarcadero-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/Fujitsu-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/GHS-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/GNU-C-FeatureTests.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/GNU-C.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/GNU-CXX-FeatureTests.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/GNU-CXX.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/GNU-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/GNU.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/HP-C-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/HP-CXX-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/IAR-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/IBMCPP-C-DetermineVersionInternal.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/IBMCPP-CXX-DetermineVersionInternal.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/Intel-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/MIPSpro-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/MSVC-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/OpenWatcom-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/PGI-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/PathScale-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/SCO-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/SDCC-C-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/SunPro-C-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/SunPro-CXX-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/TI-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/TinyCC-C-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/VisualAge-C-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/VisualAge-CXX-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/Watcom-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/XL-C-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/XL-CXX-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/zOS-C-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/zOS-CXX-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Internal/FeatureTesting.cmake" + "/usr/share/cmake-3.5/Modules/MultiArchCross.cmake" + "/usr/share/cmake-3.5/Modules/Platform/Linux-CXX.cmake" + "/usr/share/cmake-3.5/Modules/Platform/Linux-GNU-C.cmake" + "/usr/share/cmake-3.5/Modules/Platform/Linux-GNU-CXX.cmake" + "/usr/share/cmake-3.5/Modules/Platform/Linux-GNU.cmake" + "/usr/share/cmake-3.5/Modules/Platform/Linux.cmake" + "/usr/share/cmake-3.5/Modules/Platform/UnixPaths.cmake" + ) + +# The corresponding makefile is: +set(CMAKE_MAKEFILE_OUTPUTS + "Makefile" + "CMakeFiles/cmake.check_cache" + ) + +# Byproducts of CMake generate step: +set(CMAKE_MAKEFILE_PRODUCTS + "CMakeFiles/3.5.1/CMakeSystem.cmake" + "CMakeFiles/3.5.1/CMakeCCompiler.cmake" + "CMakeFiles/3.5.1/CMakeCXXCompiler.cmake" + "CMakeFiles/3.5.1/CMakeCCompiler.cmake" + "CMakeFiles/3.5.1/CMakeCXXCompiler.cmake" + "CMakeFiles/CMakeDirectoryInformation.cmake" + ) + +# Dependency information for all targets: +set(CMAKE_DEPEND_INFO_FILES + "CMakeFiles/modelPlugFirmata.dir/DependInfo.cmake" + ) diff --git a/Source/CMakeFiles/Makefile2 b/Source/CMakeFiles/Makefile2 new file mode 100755 index 0000000..dca4480 --- /dev/null +++ b/Source/CMakeFiles/Makefile2 @@ -0,0 +1,108 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.5 + +# Default target executed when no arguments are given to make. +default_target: all + +.PHONY : default_target + +# The main recursive all target +all: + +.PHONY : all + +# The main recursive preinstall target +preinstall: + +.PHONY : preinstall + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/bin/cmake + +# The command to remove a file. +RM = /usr/bin/cmake -E remove -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /home/user/Downloads/libs/Source + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /home/user/Downloads/libs/Source + +#============================================================================= +# Target rules for target CMakeFiles/modelPlugFirmata.dir + +# All Build rule for target. +CMakeFiles/modelPlugFirmata.dir/all: + $(MAKE) -f CMakeFiles/modelPlugFirmata.dir/build.make CMakeFiles/modelPlugFirmata.dir/depend + $(MAKE) -f CMakeFiles/modelPlugFirmata.dir/build.make CMakeFiles/modelPlugFirmata.dir/build + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/home/user/Downloads/libs/Source/CMakeFiles --progress-num=1,2,3 "Built target modelPlugFirmata" +.PHONY : CMakeFiles/modelPlugFirmata.dir/all + +# Include target in all. +all: CMakeFiles/modelPlugFirmata.dir/all + +.PHONY : all + +# Build rule for subdir invocation for target. +CMakeFiles/modelPlugFirmata.dir/rule: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /home/user/Downloads/libs/Source/CMakeFiles 3 + $(MAKE) -f CMakeFiles/Makefile2 CMakeFiles/modelPlugFirmata.dir/all + $(CMAKE_COMMAND) -E cmake_progress_start /home/user/Downloads/libs/Source/CMakeFiles 0 +.PHONY : CMakeFiles/modelPlugFirmata.dir/rule + +# Convenience name for target. +modelPlugFirmata: CMakeFiles/modelPlugFirmata.dir/rule + +.PHONY : modelPlugFirmata + +# clean rule for target. +CMakeFiles/modelPlugFirmata.dir/clean: + $(MAKE) -f CMakeFiles/modelPlugFirmata.dir/build.make CMakeFiles/modelPlugFirmata.dir/clean +.PHONY : CMakeFiles/modelPlugFirmata.dir/clean + +# clean rule for target. +clean: CMakeFiles/modelPlugFirmata.dir/clean + +.PHONY : clean + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/Source/CMakeFiles/TargetDirectories.txt b/Source/CMakeFiles/TargetDirectories.txt new file mode 100755 index 0000000..d9400b3 --- /dev/null +++ b/Source/CMakeFiles/TargetDirectories.txt @@ -0,0 +1,3 @@ +/home/user/Downloads/libs/Source/CMakeFiles/rebuild_cache.dir +/home/user/Downloads/libs/Source/CMakeFiles/edit_cache.dir +/home/user/Downloads/libs/Source/CMakeFiles/modelPlugFirmata.dir diff --git a/Source/CMakeFiles/cmake.check_cache b/Source/CMakeFiles/cmake.check_cache new file mode 100755 index 0000000..3dccd73 --- /dev/null +++ b/Source/CMakeFiles/cmake.check_cache @@ -0,0 +1 @@ +# This file is generated by cmake for dependency checking of the CMakeCache.txt file diff --git a/Source/CMakeFiles/feature_tests.bin b/Source/CMakeFiles/feature_tests.bin new file mode 100755 index 0000000..42c19f3 Binary files /dev/null and b/Source/CMakeFiles/feature_tests.bin differ diff --git a/Source/CMakeFiles/feature_tests.c b/Source/CMakeFiles/feature_tests.c new file mode 100755 index 0000000..6590dde --- /dev/null +++ b/Source/CMakeFiles/feature_tests.c @@ -0,0 +1,34 @@ + + const char features[] = {"\n" +"C_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 +"1" +#else +"0" +#endif +"c_function_prototypes\n" +"C_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +"1" +#else +"0" +#endif +"c_restrict\n" +"C_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201000L +"1" +#else +"0" +#endif +"c_static_assert\n" +"C_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +"1" +#else +"0" +#endif +"c_variadic_macros\n" + +}; + +int main(int argc, char** argv) { (void)argv; return features[argc]; } diff --git a/Source/CMakeFiles/feature_tests.cxx b/Source/CMakeFiles/feature_tests.cxx new file mode 100755 index 0000000..b93418c --- /dev/null +++ b/Source/CMakeFiles/feature_tests.cxx @@ -0,0 +1,405 @@ + + const char features[] = {"\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 500 && __cplusplus >= 201402L +"1" +#else +"0" +#endif +"cxx_aggregate_default_initializers\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L +"1" +#else +"0" +#endif +"cxx_alias_templates\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L +"1" +#else +"0" +#endif +"cxx_alignas\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L +"1" +#else +"0" +#endif +"cxx_alignof\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L +"1" +#else +"0" +#endif +"cxx_attributes\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L +"1" +#else +"0" +#endif +"cxx_attribute_deprecated\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) +"1" +#else +"0" +#endif +"cxx_auto_type\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L +"1" +#else +"0" +#endif +"cxx_binary_literals\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) +"1" +#else +"0" +#endif +"cxx_constexpr\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L +"1" +#else +"0" +#endif +"cxx_contextual_conversions\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) +"1" +#else +"0" +#endif +"cxx_decltype\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L +"1" +#else +"0" +#endif +"cxx_decltype_auto\n" +"CXX_FEATURE:" +#if ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40801) && __cplusplus >= 201103L +"1" +#else +"0" +#endif +"cxx_decltype_incomplete_return_types\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) +"1" +#else +"0" +#endif +"cxx_default_function_template_args\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) +"1" +#else +"0" +#endif +"cxx_defaulted_functions\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) +"1" +#else +"0" +#endif +"cxx_defaulted_move_initializers\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L +"1" +#else +"0" +#endif +"cxx_delegating_constructors\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) +"1" +#else +"0" +#endif +"cxx_deleted_functions\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L +"1" +#else +"0" +#endif +"cxx_digit_separators\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) +"1" +#else +"0" +#endif +"cxx_enum_forward_declarations\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) +"1" +#else +"0" +#endif +"cxx_explicit_conversions\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L +"1" +#else +"0" +#endif +"cxx_extended_friend_declarations\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) +"1" +#else +"0" +#endif +"cxx_extern_templates\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L +"1" +#else +"0" +#endif +"cxx_final\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) +"1" +#else +"0" +#endif +"cxx_func_identifier\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) +"1" +#else +"0" +#endif +"cxx_generalized_initializers\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L +"1" +#else +"0" +#endif +"cxx_generic_lambdas\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L +"1" +#else +"0" +#endif +"cxx_inheriting_constructors\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) +"1" +#else +"0" +#endif +"cxx_inline_namespaces\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) +"1" +#else +"0" +#endif +"cxx_lambdas\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L +"1" +#else +"0" +#endif +"cxx_lambda_init_captures\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) +"1" +#else +"0" +#endif +"cxx_local_type_template_args\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) +"1" +#else +"0" +#endif +"cxx_long_long_type\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) +"1" +#else +"0" +#endif +"cxx_noexcept\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L +"1" +#else +"0" +#endif +"cxx_nonstatic_member_init\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) +"1" +#else +"0" +#endif +"cxx_nullptr\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L +"1" +#else +"0" +#endif +"cxx_override\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) +"1" +#else +"0" +#endif +"cxx_range_for\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) +"1" +#else +"0" +#endif +"cxx_raw_string_literals\n" +"CXX_FEATURE:" +#if ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40801) && __cplusplus >= 201103L +"1" +#else +"0" +#endif +"cxx_reference_qualified_functions\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 500 && __cplusplus >= 201402L +"1" +#else +"0" +#endif +"cxx_relaxed_constexpr\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L +"1" +#else +"0" +#endif +"cxx_return_type_deduction\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) +"1" +#else +"0" +#endif +"cxx_right_angle_brackets\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) +"1" +#else +"0" +#endif +"cxx_rvalue_references\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) +"1" +#else +"0" +#endif +"cxx_sizeof_member\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) +"1" +#else +"0" +#endif +"cxx_static_assert\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) +"1" +#else +"0" +#endif +"cxx_strong_enums\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && __cplusplus +"1" +#else +"0" +#endif +"cxx_template_template_parameters\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L +"1" +#else +"0" +#endif +"cxx_thread_local\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) +"1" +#else +"0" +#endif +"cxx_trailing_return_types\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) +"1" +#else +"0" +#endif +"cxx_unicode_literals\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) +"1" +#else +"0" +#endif +"cxx_uniform_initialization\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) +"1" +#else +"0" +#endif +"cxx_unrestricted_unions\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L +"1" +#else +"0" +#endif +"cxx_user_literals\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 500 && __cplusplus >= 201402L +"1" +#else +"0" +#endif +"cxx_variable_templates\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) +"1" +#else +"0" +#endif +"cxx_variadic_macros\n" +"CXX_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) +"1" +#else +"0" +#endif +"cxx_variadic_templates\n" + +}; + +int main(int argc, char** argv) { (void)argv; return features[argc]; } diff --git a/Source/CMakeFiles/modelPlugFirmata.dir/CXX.includecache b/Source/CMakeFiles/modelPlugFirmata.dir/CXX.includecache new file mode 100755 index 0000000..17718e5 --- /dev/null +++ b/Source/CMakeFiles/modelPlugFirmata.dir/CXX.includecache @@ -0,0 +1,108 @@ +#IncludeRegexLine: ^[ ]*#[ ]*(include|import)[ ]*[<"]([^">]+)([">]) + +#IncludeRegexScan: ^.*$ + +#IncludeRegexComplain: ^$ + +#IncludeRegexTransform: + +/home/user/Downloads/libs/Source/modelPlugFirmata.cpp +stdio.h +- +stdint.h +- +algorithm +- +vector +- +serial.h +/home/user/Downloads/libs/Source/serial.h +modelPlugFirmata.h +/home/user/Downloads/libs/Source/modelPlugFirmata.h + +/home/user/Downloads/libs/Source/modelPlugFirmata.h + +/home/user/Downloads/libs/Source/serial.cpp +serial.h +/home/user/Downloads/libs/Source/serial.h +sys/types.h +- +fcntl.h +- +errno.h +- +sys/select.h +- +termios.h +- +unistd.h +- +dirent.h +- +sys/stat.h +- +sys/ioctl.h +- +linux/serial.h +- +errno.h +- +stdio.h +- +string.h +- +stdio.h +- +string.h +- +unistd.h +- +fcntl.h +- +sys/ioctl.h +- +errno.h +- +paths.h +- +termios.h +- +sysexits.h +- +sys/param.h +- +sys/select.h +- +sys/time.h +- +time.h +- +CoreFoundation/CoreFoundation.h +- +IOKit/IOKitLib.h +- +IOKit/serial/IOSerialKeys.h +- +IOKit/IOBSD.h +- +windows.h +- + +/home/user/Downloads/libs/Source/serial.h +stdint.h +- +termios.h +- +termios.h +- +windows.h +- +vector +- +string +- +sstream +- +algorithm +- + diff --git a/Source/CMakeFiles/modelPlugFirmata.dir/DependInfo.cmake b/Source/CMakeFiles/modelPlugFirmata.dir/DependInfo.cmake new file mode 100755 index 0000000..c1e23de --- /dev/null +++ b/Source/CMakeFiles/modelPlugFirmata.dir/DependInfo.cmake @@ -0,0 +1,26 @@ +# The set of languages for which implicit dependencies are needed: +set(CMAKE_DEPENDS_LANGUAGES + "CXX" + ) +# The set of files for implicit dependencies of each language: +set(CMAKE_DEPENDS_CHECK_CXX + "/home/user/Downloads/libs/Source/modelPlugFirmata.cpp" "/home/user/Downloads/libs/Source/CMakeFiles/modelPlugFirmata.dir/modelPlugFirmata.cpp.o" + "/home/user/Downloads/libs/Source/serial.cpp" "/home/user/Downloads/libs/Source/CMakeFiles/modelPlugFirmata.dir/serial.cpp.o" + ) +set(CMAKE_CXX_COMPILER_ID "GNU") + +# Preprocessor definitions for this target. +set(CMAKE_TARGET_DEFINITIONS_CXX + "LINUX" + ) + +# The include file search paths: +set(CMAKE_CXX_TARGET_INCLUDE_PATH + ) + +# Targets to which this target links. +set(CMAKE_TARGET_LINKED_INFO_FILES + ) + +# Fortran module output directory. +set(CMAKE_Fortran_TARGET_MODULE_DIR "") diff --git a/Source/CMakeFiles/modelPlugFirmata.dir/build.make b/Source/CMakeFiles/modelPlugFirmata.dir/build.make new file mode 100755 index 0000000..5d0d8e9 --- /dev/null +++ b/Source/CMakeFiles/modelPlugFirmata.dir/build.make @@ -0,0 +1,140 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.5 + +# Delete rule output on recipe failure. +.DELETE_ON_ERROR: + + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/bin/cmake + +# The command to remove a file. +RM = /usr/bin/cmake -E remove -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /home/user/Downloads/libs/Source + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /home/user/Downloads/libs/Source + +# Include any dependencies generated for this target. +include CMakeFiles/modelPlugFirmata.dir/depend.make + +# Include the progress variables for this target. +include CMakeFiles/modelPlugFirmata.dir/progress.make + +# Include the compile flags for this target's objects. +include CMakeFiles/modelPlugFirmata.dir/flags.make + +CMakeFiles/modelPlugFirmata.dir/modelPlugFirmata.cpp.o: CMakeFiles/modelPlugFirmata.dir/flags.make +CMakeFiles/modelPlugFirmata.dir/modelPlugFirmata.cpp.o: modelPlugFirmata.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/user/Downloads/libs/Source/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object CMakeFiles/modelPlugFirmata.dir/modelPlugFirmata.cpp.o" + /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/modelPlugFirmata.dir/modelPlugFirmata.cpp.o -c /home/user/Downloads/libs/Source/modelPlugFirmata.cpp + +CMakeFiles/modelPlugFirmata.dir/modelPlugFirmata.cpp.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/modelPlugFirmata.dir/modelPlugFirmata.cpp.i" + /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/user/Downloads/libs/Source/modelPlugFirmata.cpp > CMakeFiles/modelPlugFirmata.dir/modelPlugFirmata.cpp.i + +CMakeFiles/modelPlugFirmata.dir/modelPlugFirmata.cpp.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/modelPlugFirmata.dir/modelPlugFirmata.cpp.s" + /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/user/Downloads/libs/Source/modelPlugFirmata.cpp -o CMakeFiles/modelPlugFirmata.dir/modelPlugFirmata.cpp.s + +CMakeFiles/modelPlugFirmata.dir/modelPlugFirmata.cpp.o.requires: + +.PHONY : CMakeFiles/modelPlugFirmata.dir/modelPlugFirmata.cpp.o.requires + +CMakeFiles/modelPlugFirmata.dir/modelPlugFirmata.cpp.o.provides: CMakeFiles/modelPlugFirmata.dir/modelPlugFirmata.cpp.o.requires + $(MAKE) -f CMakeFiles/modelPlugFirmata.dir/build.make CMakeFiles/modelPlugFirmata.dir/modelPlugFirmata.cpp.o.provides.build +.PHONY : CMakeFiles/modelPlugFirmata.dir/modelPlugFirmata.cpp.o.provides + +CMakeFiles/modelPlugFirmata.dir/modelPlugFirmata.cpp.o.provides.build: CMakeFiles/modelPlugFirmata.dir/modelPlugFirmata.cpp.o + + +CMakeFiles/modelPlugFirmata.dir/serial.cpp.o: CMakeFiles/modelPlugFirmata.dir/flags.make +CMakeFiles/modelPlugFirmata.dir/serial.cpp.o: serial.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/user/Downloads/libs/Source/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Building CXX object CMakeFiles/modelPlugFirmata.dir/serial.cpp.o" + /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/modelPlugFirmata.dir/serial.cpp.o -c /home/user/Downloads/libs/Source/serial.cpp + +CMakeFiles/modelPlugFirmata.dir/serial.cpp.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/modelPlugFirmata.dir/serial.cpp.i" + /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/user/Downloads/libs/Source/serial.cpp > CMakeFiles/modelPlugFirmata.dir/serial.cpp.i + +CMakeFiles/modelPlugFirmata.dir/serial.cpp.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/modelPlugFirmata.dir/serial.cpp.s" + /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/user/Downloads/libs/Source/serial.cpp -o CMakeFiles/modelPlugFirmata.dir/serial.cpp.s + +CMakeFiles/modelPlugFirmata.dir/serial.cpp.o.requires: + +.PHONY : CMakeFiles/modelPlugFirmata.dir/serial.cpp.o.requires + +CMakeFiles/modelPlugFirmata.dir/serial.cpp.o.provides: CMakeFiles/modelPlugFirmata.dir/serial.cpp.o.requires + $(MAKE) -f CMakeFiles/modelPlugFirmata.dir/build.make CMakeFiles/modelPlugFirmata.dir/serial.cpp.o.provides.build +.PHONY : CMakeFiles/modelPlugFirmata.dir/serial.cpp.o.provides + +CMakeFiles/modelPlugFirmata.dir/serial.cpp.o.provides.build: CMakeFiles/modelPlugFirmata.dir/serial.cpp.o + + +# Object files for target modelPlugFirmata +modelPlugFirmata_OBJECTS = \ +"CMakeFiles/modelPlugFirmata.dir/modelPlugFirmata.cpp.o" \ +"CMakeFiles/modelPlugFirmata.dir/serial.cpp.o" + +# External object files for target modelPlugFirmata +modelPlugFirmata_EXTERNAL_OBJECTS = + +libmodelPlugFirmata.so: CMakeFiles/modelPlugFirmata.dir/modelPlugFirmata.cpp.o +libmodelPlugFirmata.so: CMakeFiles/modelPlugFirmata.dir/serial.cpp.o +libmodelPlugFirmata.so: CMakeFiles/modelPlugFirmata.dir/build.make +libmodelPlugFirmata.so: CMakeFiles/modelPlugFirmata.dir/link.txt + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/home/user/Downloads/libs/Source/CMakeFiles --progress-num=$(CMAKE_PROGRESS_3) "Linking CXX shared library libmodelPlugFirmata.so" + $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/modelPlugFirmata.dir/link.txt --verbose=$(VERBOSE) + +# Rule to build all files generated by this target. +CMakeFiles/modelPlugFirmata.dir/build: libmodelPlugFirmata.so + +.PHONY : CMakeFiles/modelPlugFirmata.dir/build + +CMakeFiles/modelPlugFirmata.dir/requires: CMakeFiles/modelPlugFirmata.dir/modelPlugFirmata.cpp.o.requires +CMakeFiles/modelPlugFirmata.dir/requires: CMakeFiles/modelPlugFirmata.dir/serial.cpp.o.requires + +.PHONY : CMakeFiles/modelPlugFirmata.dir/requires + +CMakeFiles/modelPlugFirmata.dir/clean: + $(CMAKE_COMMAND) -P CMakeFiles/modelPlugFirmata.dir/cmake_clean.cmake +.PHONY : CMakeFiles/modelPlugFirmata.dir/clean + +CMakeFiles/modelPlugFirmata.dir/depend: + cd /home/user/Downloads/libs/Source && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /home/user/Downloads/libs/Source /home/user/Downloads/libs/Source /home/user/Downloads/libs/Source /home/user/Downloads/libs/Source /home/user/Downloads/libs/Source/CMakeFiles/modelPlugFirmata.dir/DependInfo.cmake --color=$(COLOR) +.PHONY : CMakeFiles/modelPlugFirmata.dir/depend + diff --git a/Source/CMakeFiles/modelPlugFirmata.dir/cmake_clean.cmake b/Source/CMakeFiles/modelPlugFirmata.dir/cmake_clean.cmake new file mode 100755 index 0000000..c752d2c --- /dev/null +++ b/Source/CMakeFiles/modelPlugFirmata.dir/cmake_clean.cmake @@ -0,0 +1,11 @@ +file(REMOVE_RECURSE + "CMakeFiles/modelPlugFirmata.dir/modelPlugFirmata.cpp.o" + "CMakeFiles/modelPlugFirmata.dir/serial.cpp.o" + "libmodelPlugFirmata.pdb" + "libmodelPlugFirmata.so" +) + +# Per-language clean rules from dependency scanning. +foreach(lang CXX) + include(CMakeFiles/modelPlugFirmata.dir/cmake_clean_${lang}.cmake OPTIONAL) +endforeach() diff --git a/Source/CMakeFiles/modelPlugFirmata.dir/depend.internal b/Source/CMakeFiles/modelPlugFirmata.dir/depend.internal new file mode 100755 index 0000000..7c66c02 --- /dev/null +++ b/Source/CMakeFiles/modelPlugFirmata.dir/depend.internal @@ -0,0 +1,10 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.5 + +CMakeFiles/modelPlugFirmata.dir/modelPlugFirmata.cpp.o + /home/user/Downloads/libs/Source/modelPlugFirmata.cpp + /home/user/Downloads/libs/Source/modelPlugFirmata.h + /home/user/Downloads/libs/Source/serial.h +CMakeFiles/modelPlugFirmata.dir/serial.cpp.o + /home/user/Downloads/libs/Source/serial.cpp + /home/user/Downloads/libs/Source/serial.h diff --git a/Source/CMakeFiles/modelPlugFirmata.dir/depend.make b/Source/CMakeFiles/modelPlugFirmata.dir/depend.make new file mode 100755 index 0000000..9555e47 --- /dev/null +++ b/Source/CMakeFiles/modelPlugFirmata.dir/depend.make @@ -0,0 +1,10 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.5 + +CMakeFiles/modelPlugFirmata.dir/modelPlugFirmata.cpp.o: modelPlugFirmata.cpp +CMakeFiles/modelPlugFirmata.dir/modelPlugFirmata.cpp.o: modelPlugFirmata.h +CMakeFiles/modelPlugFirmata.dir/modelPlugFirmata.cpp.o: serial.h + +CMakeFiles/modelPlugFirmata.dir/serial.cpp.o: serial.cpp +CMakeFiles/modelPlugFirmata.dir/serial.cpp.o: serial.h + diff --git a/Source/CMakeFiles/modelPlugFirmata.dir/flags.make b/Source/CMakeFiles/modelPlugFirmata.dir/flags.make new file mode 100755 index 0000000..bab2d24 --- /dev/null +++ b/Source/CMakeFiles/modelPlugFirmata.dir/flags.make @@ -0,0 +1,10 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.5 + +# compile CXX with /usr/bin/c++ +CXX_FLAGS = -O3 -DNDEBUG -fPIC + +CXX_DEFINES = -DLINUX -DmodelPlugFirmata_EXPORTS + +CXX_INCLUDES = + diff --git a/Source/CMakeFiles/modelPlugFirmata.dir/link.txt b/Source/CMakeFiles/modelPlugFirmata.dir/link.txt new file mode 100755 index 0000000..051743d --- /dev/null +++ b/Source/CMakeFiles/modelPlugFirmata.dir/link.txt @@ -0,0 +1 @@ +/usr/bin/c++ -fPIC -O3 -DNDEBUG -shared -Wl,-soname,libmodelPlugFirmata.so -o libmodelPlugFirmata.so CMakeFiles/modelPlugFirmata.dir/modelPlugFirmata.cpp.o CMakeFiles/modelPlugFirmata.dir/serial.cpp.o diff --git a/Source/CMakeFiles/modelPlugFirmata.dir/modelPlugFirmata.cpp.o b/Source/CMakeFiles/modelPlugFirmata.dir/modelPlugFirmata.cpp.o new file mode 100755 index 0000000..3ac3933 Binary files /dev/null and b/Source/CMakeFiles/modelPlugFirmata.dir/modelPlugFirmata.cpp.o differ diff --git a/Source/CMakeFiles/modelPlugFirmata.dir/progress.make b/Source/CMakeFiles/modelPlugFirmata.dir/progress.make new file mode 100755 index 0000000..6a9dc74 --- /dev/null +++ b/Source/CMakeFiles/modelPlugFirmata.dir/progress.make @@ -0,0 +1,4 @@ +CMAKE_PROGRESS_1 = 1 +CMAKE_PROGRESS_2 = 2 +CMAKE_PROGRESS_3 = 3 + diff --git a/Source/CMakeFiles/modelPlugFirmata.dir/serial.cpp.o b/Source/CMakeFiles/modelPlugFirmata.dir/serial.cpp.o new file mode 100755 index 0000000..082767e Binary files /dev/null and b/Source/CMakeFiles/modelPlugFirmata.dir/serial.cpp.o differ diff --git a/Source/CMakeFiles/progress.marks b/Source/CMakeFiles/progress.marks new file mode 100755 index 0000000..00750ed --- /dev/null +++ b/Source/CMakeFiles/progress.marks @@ -0,0 +1 @@ +3 diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt new file mode 100755 index 0000000..6f2a222 --- /dev/null +++ b/Source/CMakeLists.txt @@ -0,0 +1,20 @@ +set(CMAKE_BUILD_TYPE Release) + +cmake_minimum_required(VERSION 2.8) + +if(WIN32) + add_definitions(-DWINDOWS) +elseif(UNIX AND NOT APPLE) + add_definitions(-DLINUX) +elseif(APPLE) + add_definitions(-DMACOSX) + SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -framework CoreFoundation -framework IOKit" ) +else() + message(SEND_ERROR "Undefined platform") +endif() + + + +set(SRC modelPlugFirmata.cpp modelPlugFirmata.h serial.cpp serial.h) + +add_library(modelPlugFirmata SHARED ${SRC}) diff --git a/Source/COPYING b/Source/COPYING new file mode 100755 index 0000000..94a9ed0 --- /dev/null +++ b/Source/COPYING @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc..
+.
+The first thing you need to do is upload the Firmware code to your board .
+ +Figure 1. Location of the Firmware sketch.
+If you wish to use PID(Proportional-integral-derivative) then use another firmware provided with the package. To open an firmware through Arduino IDE click on “Open“ and Browse to the location where you extracted the package. Insdie the package folder look for folder named “Firmware“ which contains a file named “pidmata3.ino“. Select that file and click open to load firmware in Arduino IDE.
+ Important instructions for using above mentioned firmware “pidmata3.ino“:
+
Once the the Firmware code is in the board, you need to write down the serial port that it is using. This is important because you need to give the port name to OpenModelicaArduino in order to communicate with the board. You can find the serial port in Tools->Serial Port or in the bottom-right corner of the Arduino software window (see Figure 2). In Windows the serial port name is something like “COM5”, while in OS X and Linux the name will be something like “/dev/ttyACM0”. Now you are ready to make your first model.
+ +Figure 2. Finding the serial port being used.
+As a first exercise, you are going to reproduce with OpenModelicaArduino the blinking LED example. You can either open the prebuilt example (OpenModelicaArduino.Examples.BlinkLed) or build it by yourself. To build the model, locate the components:
+Connect the components as in Figure 3. One thing to notice is that the DigitalOutput model is connected to the Arduino component to specify that the pin belongs to that board. This connection is necessary because OpenModelicaArduino can use multiple boards with multiple pins at the same time.
+ +Figure 3. Diagram of the blinking LED.
+Next you need to specify the serial port that the board is using. This is done by selecting the Arduino component and showing its parameters. In the parameter view, you can find the Port parameter. Write the port name that you got in the section “Preparing your board”. Important: the name must be have quotation marks as shown in Figure 4.
+ +Figure 4. Specifying the serial port name.
+Now you need to set the pin number that you are going to use in the DigitalOutput component. Usually, the Arduino boards have an LED attached to pin 13. Set that number in the Pin parameter as shown in Figure 5.
+ +Figure 5. Specifying the pin to use.
+For the BooleanPulse component, set the 'period' parameter to 1. The model is ready to simulate. Press the simulate button and wait to see the results.
+The first time you run the model, it is probably simulated so fast that you do not have time to react. The reason is that OpenModelica simulates the model as fast as possible. In order to interact with your models using OpenModelicaArduino, it is necessary to synchronize the simulation time with real time. This is done in by using Synchronisation block in ModelicaDeviceDriver library. After simulating the model one time, you need to check in the checkbox “Synchronize with real-time” as shown in Figure 6.
+ //+ //
Figure 6. Synchronizing your simulation with real time.
+ //If you are building many models with the OpenModelicaArduino library, you should set the “Synchronize with real-time” option as a default simulation setting in SimulationCenter under the menu Tools->Options in the section SimulationCenter->Default Experiment (see Figure 7).
+ //+ //
Figure 7. Setting \"Synchronize with real-time\" as default.
+ //Now run the simulation again and you should see the LED blinking until the simulation reaches the stop time. If you want to keep the simulation running continuously, you need to change the stop time to “infinite” as shown in Figure 8.
+ // + //Figure 8. Setting the stop time to infinite.
+ //If you run the simulation again, you should see the LED blinking continuously.
+One thing that you may have noticed is that OpenModelicaArduino prints status messages in the simulation log (see Figure 9). The first thing it prints is a list of the available ports. In that list, you should see your current port (A). After that, it prints the current port and the speed used (B). Once the port is opened, you receive a notification that the board is initialized (C). Usually the boards report the version of Firmata that you are running. Then you set the sampling interval that the board uses (D). In this example, you can see that you are setting pin 13 to be an output because you have used the DigitalOutput component (E). Finally you will see that the board will send you a list of all the pins available and thier capabilities (F). This list contains the number of the pin and the modes in which it can be used, for example: DigitalInput, DigitalOutput, AnalogInput, AnalogOutput, and Servo.
+ +Figure 9. Messages shown by OpenModelicaArduino.
+This is a checklist that you can follow in order to solve most of the problems that can occur when using the ModelPlug library:
+If you are still having problems, you can go to http://community.wolfram.com and ask a question.
+OpenModelicaArduino contains a series of basic examples showing the functionality of the components. You can check the Examples under ModelPlug.Examples. Once you have learned how to use the basic components of OpenModelicaArduino, you can check the Arduino Playground to learn how to connect other sensors and actuators (http://playground.arduino.cc).
", revisions = ""), + Diagram(coordinateSystem(extent = {{-148.5, -105}, {148.5, 105}}, preserveAspectRatio = true, initialScale = 0.1, grid = {5, 5}))); + end GettingStarted; + + package Pins "Components to access the board I/O" + extends Internal.Icons.Block; + + model AnalogInput "Reads an analog signal from the specified pin" + extends OpenModelicaEmbedded.Internal.Icons.Block; + Modelica.Blocks.Interfaces.RealOutput y annotation( + Placement(visible = true, transformation(origin = {110, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {100, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + parameter Integer Pin = 0 "Number of the analog pin"; + OpenModelicaEmbedded.Internal.Interfaces.PinConnector pinConnector annotation( + Placement(visible = true, transformation(origin = {-100, -0}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-100, -0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + parameter Real InitValue = 0 "Initial value until the board responds" annotation( + Dialog(group = "Initialization")); + parameter Real MinValue = 0 "Minimum value of ADC" annotation( + Dialog(group = "Scaling")); + parameter Real MaxValue = 1 "Maximum value of ADC" annotation( + Dialog(group = "Scaling")); + parameter Integer adcResolution = 10 "Resolution of the ADC in your microcontroller" annotation( + Dialog(group = "Scaling")); + equation + y = OpenModelicaEmbedded.Internal.ExternalFunctions.readAnalogPin(Pin, MinValue, MaxValue, InitValue, pinConnector, adcResolution); + annotation( + Documentation(info = "Reads an analog signal from the specified pin. This component uses the 'analogRead' function of Arduino.
+Signal Range: By default, the signal goes from 0 to 1 where 0 represents no voltage and 1 the voltage reference of the ADC in the board. This signal can be scaled by setting the 'MinValue' and 'MaxValue' parameters.
+Not all pins support analog input. Check the documentation of your board to find the pin capabilities.
+", revisions = ""), + Icon(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -85}, {100, 85}}, radius = 40), Rectangle(fillColor = {243, 134, 48}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-90, -60}, {90, 60}}, radius = 40), Text(origin = {0, -130}, extent = {{-100, -20}, {100, 20}}, textString = "Pin %Pin"), Text(origin = {0, 10}, extent = {{-75, -15}, {75, 25}}, textString = "Analog", textStyle = {TextStyle.Bold}), Text(origin = {0, -20}, extent = {{-75, -15}, {75, 25}}, textString = "Input", textStyle = {TextStyle.Bold})}), + Diagram(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -75}, {100, 75}}, radius = 40), Rectangle(fillColor = {243, 134, 48}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-90, -50}, {90, 50}}, radius = 40), Text(origin = {0, 20}, extent = {{-75, -15}, {75, 25}}, textString = "Analog", textStyle = {TextStyle.Bold}), Text(origin = {0, -20}, extent = {{-75, -15}, {75, 25}}, textString = "Input", textStyle = {TextStyle.Bold})})); + end AnalogInput; + + model AnalogOutput "Writes an analog signal to the specified pin" + extends OpenModelicaEmbedded.Internal.Icons.Block; + Modelica.Blocks.Interfaces.RealInput u annotation( + Placement(visible = true, transformation(origin = {-110, -0}, extent = {{-25, -25}, {25, 25}}, rotation = 0), iconTransformation(origin = {-100, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + parameter Integer Pin = 0 "Number of the PWM/DAC pin"; + OpenModelicaEmbedded.Internal.Interfaces.PinConnector pinConnector annotation( + Placement(visible = true, transformation(origin = {100, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {100, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + parameter Real MinValue = 0 "Value considered as minimum by the PWM/DAC" annotation( + Dialog(group = "Scaling")); + parameter Real MaxValue = 1 "Value considered as maximum by the PWM/DAC" annotation( + Dialog(group = "Scaling")); + protected + Real scaled_u = (u - MinValue) / (MaxValue - MinValue); + equation + OpenModelicaEmbedded.Internal.ExternalFunctions.writeAnalogPin(Pin, pinConnector, scaled_u); + annotation( + Documentation(info = "
Writes an analog signal to the specified pin. This component uses the 'analogWrite' function of Arduino.
+Signal Range: By default, the signal goes from 0 to 1, where 0 represents no voltage and 1 the maximum voltage that PWM/DAC of your board can provide. This signal can be scaled by setting the 'MinValue' and 'MaxValue' parameters.
+Analog outputs use the PWM capabilities of the pins, therefore, they do not provide a continuous signal. If you want to get a continuous signal, you need to add a lowpass filter. Check the Arduino Playground (http://playground.arduino.cc) for more information on PWM.
+Not all pins support analog output. Check the documentation of your board to find the pin capabilities.
+", revisions = ""), + Icon(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -85}, {100, 85}}, radius = 40), Rectangle(fillColor = {243, 134, 48}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-90, -60}, {90, 60}}, radius = 40), Text(origin = {0, -130}, extent = {{-100, -20}, {100, 20}}, textString = "Pin %Pin"), Text(origin = {0, 10}, extent = {{-75, -15}, {75, 25}}, textString = "Analog", textStyle = {TextStyle.Bold}), Text(origin = {0, -20}, extent = {{-75, -15}, {75, 25}}, textString = "Output", textStyle = {TextStyle.Bold})}), + Diagram(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -75}, {100, 75}}, radius = 40), Rectangle(fillColor = {243, 134, 48}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-90, -50}, {90, 50}}, radius = 40), Text(origin = {0, 20}, extent = {{-75, -15}, {75, 25}}, textString = "Analog", textStyle = {TextStyle.Bold}), Text(origin = {0, -20}, extent = {{-75, -15}, {75, 25}}, textString = "Output", textStyle = {TextStyle.Bold})})); + end AnalogOutput; + + model DigitalInput "Reads a digital signal from the specified pin" + extends OpenModelicaEmbedded.Internal.Icons.Block; + Modelica.Blocks.Interfaces.BooleanOutput y annotation( + Placement(visible = true, transformation(origin = {110, 1.643}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {101.75, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + parameter Integer Pin = 0 "Number of the digital pin"; + parameter Boolean InitValue = false "Initial value until the board responds" annotation( + Dialog(group = "Initialization")); + OpenModelicaEmbedded.Internal.Interfaces.PinConnector pinConnector annotation( + Placement(visible = true, transformation(origin = {-100, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-100, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + equation + y = OpenModelicaEmbedded.Internal.ExternalFunctions.readDigitalPin(Pin, InitValue, pinConnector); + annotation( + Documentation(info = "
Reads a digital signal from the specified pin. This component uses the 'digitalRead' function of Arduino.
+Signal Range: This component accepts only Boolean signals (true/false).
", revisions = ""), + Icon(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -85}, {100, 85}}, radius = 40), Rectangle(fillColor = {0, 170, 255}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-90, -60}, {90, 60}}, radius = 40), Text(origin = {0, -130}, extent = {{-100, -20}, {100, 20}}, textString = "Pin %Pin"), Text(origin = {0, 10}, extent = {{-75, -15}, {75, 25}}, textString = "Digital", textStyle = {TextStyle.Bold}), Text(origin = {0, -20}, extent = {{-75, -15}, {75, 25}}, textString = "Input", textStyle = {TextStyle.Bold})}), + Diagram(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -75}, {100, 75}}, radius = 40), Rectangle(fillColor = {0, 170, 255}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-90, -50}, {90, 50}}, radius = 40), Text(origin = {0, 20}, extent = {{-75, -15}, {75, 25}}, textString = "Digital", textStyle = {TextStyle.Bold}), Text(origin = {0, -20}, extent = {{-75, -15}, {75, 25}}, textString = "Input", textStyle = {TextStyle.Bold})})); + end DigitalInput; + + model DigitalOutput "Writes a digital signal to the specified pin" + extends OpenModelicaEmbedded.Internal.Icons.Block; + Modelica.Blocks.Interfaces.BooleanInput u annotation( + Placement(visible = true, transformation(origin = {-110, -0}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-100, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + parameter Integer Pin = 0 "Number of the digital pin"; + OpenModelicaEmbedded.Internal.Interfaces.PinConnector pinConnector annotation( + Placement(visible = true, transformation(origin = {100, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {100, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + equation + OpenModelicaEmbedded.Internal.ExternalFunctions.writeDigitalPin(Pin, pinConnector, u); + annotation( + Documentation(info = "Writes a digital signal to the specified pin. This component uses the 'digitalWrite' function of Arduino.
+Signal Range: This component accepts only Boolean signals (true/false).
", revisions = ""), + Icon(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -85}, {100, 85}}, radius = 40), Rectangle(fillColor = {0, 170, 255}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-90, -60}, {90, 60}}, radius = 40), Text(origin = {0, -130}, extent = {{-100, -20}, {100, 20}}, textString = "Pin %Pin"), Text(origin = {0, 10}, extent = {{-75, -15}, {75, 25}}, textString = "Digital", textStyle = {TextStyle.Bold}), Text(origin = {0, -20}, extent = {{-75, -15}, {75, 25}}, textString = "Output", textStyle = {TextStyle.Bold})}), + Diagram(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -75}, {100, 75}}, radius = 40), Rectangle(fillColor = {0, 170, 255}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-90, -50}, {90, 50}}, radius = 40), Text(origin = {0, 20}, extent = {{-75, -15}, {75, 25}}, textString = "Digital", textStyle = {TextStyle.Bold}), Text(origin = {0, -20}, extent = {{-75, -15}, {75, 25}}, textString = "Input", textStyle = {TextStyle.Bold})})); + end DigitalOutput; + + model Servo "Controls a servo motor attached to the specified pin" + extends OpenModelicaEmbedded.Internal.Icons.Block; + Modelica.Blocks.Interfaces.RealInput u annotation( + Placement(visible = true, transformation(origin = {-110, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-100, -0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaEmbedded.Internal.Interfaces.PinConnector pinConnector annotation( + Placement(visible = true, transformation(origin = {100, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {100, -0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + parameter Integer Pin = 0 "Pin number of the servo"; + parameter OpenModelicaEmbedded.Internal.Types.ServoUnit InputUnit "if None (Default) the servo receives a signal between 0 and 1. If Degrees the control signal is from 0 to 180. If Radians the signal is from 0 to Pi."; + parameter Integer MinPulse = 544 "The pulse width, in microseconds, corresponding to the minimum (0-degree) angle on the servo. + (Ignore this parameter if using Tiva C board)" annotation( + Dialog(group = "Advanced")); + parameter Integer MaxPulse = 2400 "The pulse width, in microseconds, corresponding to the maximum (180-degree) angle on the servo. + (Ignore this parameter if using Tiva C board)" annotation( + Dialog(group = "Advanced")); + Real outputSignal; + equation + outputSignal = if InputUnit == OpenModelicaEmbedded.Internal.Types.ServoUnit.None then u else if InputUnit == OpenModelicaEmbedded.Internal.Types.ServoUnit.Degrees then u / 180 else if InputUnit == OpenModelicaEmbedded.Internal.Types.ServoUnit.Radians then u / Modelica.Constants.pi else u; + OpenModelicaEmbedded.Internal.ExternalFunctions.writeServoPin(Pin, pinConnector, u, MinPulse, MaxPulse); + annotation( + Documentation(info = "Controls a servo motor attached to the specified pin. This component uses the 'Servo' library of Arduino.
+Signal Range: By default, the range goes from 0 to 1, which corresponds to 0 to 180 degrees. If you want to input values in radians, you can change the parameter 'InputUnit' from 'Degrees' to 'Radians'.
+If your servo does not work correctly with the default settings, you can set the parameters 'MinPulse' and 'MaxPulse'. To get more information on how to configure a servo, you can check the documentation of the Servo library, http://arduino.cc/en/reference/servo.
", revisions = ""), + Icon(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -85}, {100, 85}}, radius = 40), Rectangle(fillColor = {0, 255, 127}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-90, -60}, {90, 60}}, radius = 40), Text(origin = {0, -130}, extent = {{-100, -20}, {100, 20}}, textString = "Pin %Pin"), Text(extent = {{-75, -25}, {75, 25}}, textString = "Servo", textStyle = {TextStyle.Bold})}), + Diagram(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -75}, {100, 75}}, radius = 40), Rectangle(fillColor = {0, 255, 127}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-90, -50}, {90, 50}}, radius = 40), Text(extent = {{-75, -25}, {75, 25}}, textString = "Servo", textStyle = {TextStyle.Bold})})); + end Servo; + annotation( + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(visible = true, origin = {-30, 30}, fillColor = {250, 105, 0}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-25, -25}, {25, 25}}, radius = 50), Rectangle(visible = true, origin = {30, 30}, fillColor = {243, 134, 48}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-25, -25}, {25, 25}}, radius = 50), Rectangle(visible = true, origin = {-30, -30}, fillColor = {167, 219, 216}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-25, -25}, {25, 25}}, radius = 50), Rectangle(visible = true, origin = {30, -30}, fillColor = {105, 210, 231}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-25, -25}, {25, 25}}, radius = 50)}), + Diagram(coordinateSystem(extent = {{-148.5, -105}, {148.5, 105}}, preserveAspectRatio = true, initialScale = 0.1, grid = {5, 5}))); + end Pins; + + + + package Boards "Components to connect to the Firmata boards" + model Arduino "Component with default configuration for Arduino boards" + parameter Internal.Types.SerialPort Port = "COM1" "Name of the serial port"; + parameter Boolean ShowPinCapabilities = true "Set to true if you want to see the capabilities of the pins in your board"; + parameter Boolean UseDTR = false "Some boards like Arduino Leonardo require UseDTR=true"; + OpenModelicaEmbedded.Internal.ExternalFunctions.FirmataBoardObject board = Internal.ExternalFunctions.FirmataBoardObject.constructor(Port, ShowPinCapabilities, integer(UpdatePeriod * 1000), BaudRate, UseDTR); + OpenModelicaEmbedded.Internal.Interfaces.BoardConnector boardConnector annotation( + Placement(visible = true, transformation(origin = {-90, -12.256}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {0, 0}, extent = {{-100, -100}, {100, 100}}, rotation = 0))); + protected + discrete Integer BoardId(start = -1) "Board Identifier. Initialized automatically keep as -1."; + constant Modelica.SIunits.Time UpdatePeriod = 0.01 "Sampling interval. The standard Firmata has a maximum samplig period of 10 ms (0.01 s)"; + constant Integer BaudRate = 57600 "Baud rate used to comunicate with the board"; + equation + when initial() then + BoardId = Internal.ExternalFunctions.getBoardId(board); + end when; + when sample(0, UpdatePeriod) then + OpenModelicaEmbedded.Internal.ExternalFunctions.updateBoard(BoardId); + end when; + boardConnector = BoardId; + annotation( + Documentation(info = "This component provides a ready-to-use configuration for the Arduino board. This component has been tested with Arduino Uno, Arduino Mega 2560, and Arduino Mini, but it should work with any Arduino board.
+When running the simulation, you will get a list of the capabilities of every pin. If you want to stop showing the capabilities every time you simulate, you need to set the property 'ShowCapabilities' to false. If you are not sure about the location of a specific pin in your board, you should check the documentation for your board.
", revisions = ""), + Icon(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Polygon(origin = {10.562, 9.352}, fillColor = {42, 85, 94}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-85.751, 70.648}, {-102.737, 66.761}, {-105.751, 50.648}, {-105.751, -69.352}, {-99.475, -85.465}, {-85.751, -89.352}, {74.249, -89.352}, {81.746, -83.29}, {84.249, -76.041}, {84.249, 34.141}, {79.249, 43.202}, {54.249, 43.202}, {52.314, 67.486}, {31.729, 70.648}, {-85.751, 70.648}}, smooth = Smooth.Bezier), Rectangle(origin = {-71.211, 40}, fillColor = {106, 108, 116}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-32.24, -20}, {32.24, 20}}, radius = 10), Rectangle(origin = {-79.366, -45.041}, fillPattern = FillPattern.Solid, extent = {{-25.915, -15.041}, {25.915, 15.041}}, radius = 10), Text(origin = {0, -130}, extent = {{-100, -20}, {100, 20}}, textString = "%Port"), Text(origin = {5, -30}, lineColor = {255, 255, 255}, extent = {{-75, 30}, {75, -30}}, textString = "Arduino")}), + Diagram(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Polygon(origin = {10.562, 9.352}, fillColor = {42, 85, 94}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-85.751, 70.648}, {-102.737, 66.761}, {-105.751, 50.648}, {-105.751, -69.352}, {-99.475, -85.465}, {-85.751, -89.352}, {74.249, -89.352}, {81.746, -83.29}, {84.249, -76.041}, {84.249, 34.141}, {79.249, 43.202}, {54.249, 43.202}, {52.314, 67.486}, {31.729, 70.648}, {-85.751, 70.648}}, smooth = Smooth.Bezier), Rectangle(origin = {-71.211, 40}, fillColor = {106, 108, 116}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-32.24, -20}, {32.24, 20}}, radius = 10), Rectangle(origin = {-79.366, -45.041}, fillPattern = FillPattern.Solid, extent = {{-25.915, -15.041}, {25.915, 15.041}}, radius = 10), Ellipse(origin = {-8.451, 32.225}, lineColor = {255, 255, 255}, fillColor = {42, 85, 94}, fillPattern = FillPattern.Solid, lineThickness = 5, extent = {{-15, -12.225}, {15, 12.225}}, endAngle = 360), Ellipse(origin = {21.55, 32.22}, lineColor = {255, 255, 255}, fillColor = {42, 85, 94}, fillPattern = FillPattern.Solid, lineThickness = 5, extent = {{-15, -12.23}, {15, 12.23}}, endAngle = 360), Text(origin = {-5, -15}, lineColor = {255, 255, 255}, extent = {{-75, 25}, {95, -35}}, textString = "Arduino", textStyle = {TextStyle.Bold})})); + end Arduino; + + model StandardFirmata "Component with default configuration for any board with the standard Firmata" + parameter Internal.Types.SerialPort Port = "COM1" "Name of the serial port"; + parameter Boolean ShowPinCapabilities = true "Set to true if you want to see the capabilities of the pins in your board"; + parameter Boolean UseDTR = false "Set to true if your board requires DTR"; + OpenModelicaEmbedded.Internal.Interfaces.BoardConnector boardConnector annotation( + Placement(visible = true, transformation(origin = {-90, -14.401}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {0, 0}, extent = {{-100, -100}, {100, 100}}, rotation = 0))); + OpenModelicaEmbedded.Internal.ExternalFunctions.FirmataBoardObject board = Internal.ExternalFunctions.FirmataBoardObject.constructor(Port, ShowPinCapabilities, integer(UpdatePeriod * 1000), BaudRate, UseDTR); + protected + discrete Integer BoardId(start = -1) "Board Identifier. Initialized automatically keep as -1."; + constant Modelica.SIunits.Time UpdatePeriod = 0.01 "Sampling interval. The standard Firmata has a maximum samplig period of 10 ms (0.01 s)"; + constant Integer BaudRate = 57600 "Baud rate used to comunicate with the board"; + equation + when initial() then + BoardId = Internal.ExternalFunctions.getBoardId(board); + end when; + when sample(0, UpdatePeriod) then + OpenModelicaEmbedded.Internal.ExternalFunctions.updateBoard(BoardId); + end when; + boardConnector = BoardId; + annotation( + Documentation(info = "This component provides a ready-to-use configuration for boards flashed with the StandardFirmata. This component has been tested with chipKIT UNO and Teensy 3.1, but it should work with any board supporting the StandardFirmata.
+When running the simulation, you will get a list of the capabilities of every pin. If you want to stop showing the capabilities every time you simulate, you need to set the property 'ShowCapabilities' to False. If you are not sure about the location of an specific pin in your board, you should check the documentation for your board.
+", revisions = ""), + Icon(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Polygon(origin = {10.56, 9.35}, fillColor = {0, 170, 0}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-85.751, 70.648}, {-102.737, 66.761}, {-105.751, 50.648}, {-105.751, -69.352}, {-99.475, -85.465}, {-85.751, -89.352}, {74.249, -89.352}, {81.746, -83.29}, {84.249, -76.041}, {84.249, 34.141}, {79.249, 43.202}, {54.249, 43.202}, {52.314, 67.486}, {31.729, 70.648}, {-85.751, 70.648}}, smooth = Smooth.Bezier), Rectangle(origin = {-71.211, 40}, fillColor = {106, 108, 116}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-32.24, -20}, {32.24, 20}}, radius = 10), Rectangle(origin = {-79.366, -45.041}, fillPattern = FillPattern.Solid, extent = {{-25.915, -15.041}, {25.915, 15.041}}, radius = 10), Text(origin = {0, -130}, extent = {{-100, -20}, {100, 20}}, textString = "%Port"), Text(origin = {5, -10}, lineColor = {255, 255, 255}, extent = {{-75, 30}, {75, -30}}, textString = "Standard")}), + Diagram(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Polygon(origin = {10.56, 9.35}, fillColor = {0, 170, 0}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-85.751, 70.648}, {-102.737, 66.761}, {-105.751, 50.648}, {-105.751, -69.352}, {-99.475, -85.465}, {-85.751, -89.352}, {74.249, -89.352}, {81.746, -83.29}, {84.249, -76.041}, {84.249, 34.141}, {79.249, 43.202}, {54.249, 43.202}, {52.314, 67.486}, {31.729, 70.648}, {-85.751, 70.648}}, smooth = Smooth.Bezier), Rectangle(origin = {-71.211, 40}, fillColor = {106, 108, 116}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-32.24, -20}, {32.24, 20}}, radius = 10), Rectangle(origin = {-79.366, -45.041}, fillPattern = FillPattern.Solid, extent = {{-25.915, -15.041}, {25.915, 15.041}}, radius = 10), Text(origin = {-5, -15}, lineColor = {255, 255, 255}, extent = {{-75, 25}, {95, -35}}, textString = "Standard", textStyle = {TextStyle.Bold})})); + end StandardFirmata; + + model CustomFirmata "Component that allows custom configuration of the Firmata" + parameter Internal.Types.SerialPort Port = "COM1" "Name of the serial port"; + parameter Boolean ShowPinCapabilities = true "Set to true if you want to see the capabilities of the pins in your board"; + parameter Boolean UseDTR = false "Some boards like Arduino Leonardo require UseDTR=true"; + OpenModelicaEmbedded.Internal.Interfaces.BoardConnector boardConnector annotation( + Placement(visible = true, transformation(origin = {-90, -14.401}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {0, 0}, extent = {{-100, -100}, {100, 100}}, rotation = 0))); + OpenModelicaEmbedded.Internal.ExternalFunctions.FirmataBoardObject board = Internal.ExternalFunctions.FirmataBoardObject.constructor(Port, ShowPinCapabilities, integer(UpdatePeriod * 1000), BaudRate, UseDTR); + parameter Modelica.SIunits.Time UpdatePeriod = 0.01 "Sampling interval. The standard Firmata has a maximum samplig period of 10 ms (0.01 s)"; + parameter Integer BaudRate = 57600 "Baud rate used to communicate with the board"; + protected + discrete Integer BoardId(start = -1) "Board Identifier. Initialized automatically keep as -1."; + equation + when initial() then + BoardId = Internal.ExternalFunctions.getBoardId(board); + end when; + when sample(0, UpdatePeriod) then + OpenModelicaEmbedded.Internal.ExternalFunctions.updateBoard(BoardId); + end when; + boardConnector = BoardId; + annotation( + Documentation(info = "
This component is for advanced users who can modify the Firmata source code or have a non-Arduino board running Firmata. This component allows you to specify your preferred baud rate and sampling interval.
+The baud rate is specified with the 'BaudRate' property. You have to consider that standard serial ports do not support arbitrary baud rates.
+When setting the 'UpdatePeriod' property, it is necessary to change the \"Interval length\" in the simulation settings, to match the update period.
", revisions = ""), + Icon(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Polygon(origin = {10.56, 9.35}, fillColor = {170, 0, 127}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-85.751, 70.648}, {-102.737, 66.761}, {-105.751, 50.648}, {-105.751, -69.352}, {-99.475, -85.465}, {-85.751, -89.352}, {74.249, -89.352}, {81.746, -83.29}, {84.249, -76.041}, {84.249, 34.141}, {79.249, 43.202}, {54.249, 43.202}, {52.314, 67.486}, {31.729, 70.648}, {-85.751, 70.648}}, smooth = Smooth.Bezier), Rectangle(origin = {-71.211, 40}, fillColor = {106, 108, 116}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-32.24, -20}, {32.24, 20}}, radius = 10), Rectangle(origin = {-79.366, -45.041}, fillPattern = FillPattern.Solid, extent = {{-25.915, -15.041}, {25.915, 15.041}}, radius = 10), Text(origin = {0, -130}, extent = {{-100, -20}, {100, 20}}, textString = "%Port"), Text(origin = {5, -10}, lineColor = {255, 255, 255}, extent = {{-75, 30}, {75, -30}}, textString = "Custom")}), + Diagram(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Polygon(origin = {10.56, 9.35}, fillColor = {170, 0, 127}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-85.751, 70.648}, {-102.737, 66.761}, {-105.751, 50.648}, {-105.751, -69.352}, {-99.475, -85.465}, {-85.751, -89.352}, {74.249, -89.352}, {81.746, -83.29}, {84.249, -76.041}, {84.249, 34.141}, {79.249, 43.202}, {54.249, 43.202}, {52.314, 67.486}, {31.729, 70.648}, {-85.751, 70.648}}, smooth = Smooth.Bezier), Rectangle(origin = {-71.211, 40}, fillColor = {106, 108, 116}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-32.24, -20}, {32.24, 20}}, radius = 10), Rectangle(origin = {-79.366, -45.041}, fillPattern = FillPattern.Solid, extent = {{-25.915, -15.041}, {25.915, 15.041}}, radius = 10), Text(origin = {-5, -15}, lineColor = {255, 255, 255}, extent = {{-75, 25}, {95, -35}}, textString = "Custom", textStyle = {TextStyle.Bold})})); + end CustomFirmata; + + model ArduinoLeonardo "Component with configuration for Arduino Leonardo boards" + parameter Internal.Types.SerialPort Port = "COM1" "Name of the serial port"; + parameter Boolean ShowPinCapabilities = true "Set to true if you want to see the capabilities of the pins in your board"; + parameter Boolean UseDTR = true "Some boards like Arduino Leonardo require UseDTR=true"; + OpenModelicaEmbedded.Internal.ExternalFunctions.FirmataBoardObject board = Internal.ExternalFunctions.FirmataBoardObject.constructor(Port, ShowPinCapabilities, integer(UpdatePeriod * 1000), BaudRate, UseDTR); + OpenModelicaEmbedded.Internal.Interfaces.BoardConnector boardConnector annotation( + Placement(visible = true, transformation(origin = {-90, -12.256}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {0, 0}, extent = {{-100, -100}, {100, 100}}, rotation = 0))); + protected + discrete Integer BoardId(start = -1) "Board Identifier. Initialized automatically keep as -1."; + constant Modelica.SIunits.Time UpdatePeriod = 0.01 "Sampling interval. The standard Firmata has a maximum samplig period of 10 ms (0.01 s)"; + constant Integer BaudRate = 57600 "Baud rate used to comunicate with the board"; + equation + when initial() then + BoardId = Internal.ExternalFunctions.getBoardId(board); + end when; + when sample(0, UpdatePeriod) then + OpenModelicaEmbedded.Internal.ExternalFunctions.updateBoard(BoardId); + end when; + boardConnector = BoardId; + annotation( + Documentation(info = "This component provides a ready-to-use configuration for the Arduino Leonardo board. This component works for any board using native USB communication, like the Arduino Esplora.
+When running the simulation, you will get a list of the capabilities of every pin. If you want to stop showing the capabilities every time you simulate, you need to set the property "ShowCapabilities" to false.
", revisions = ""), + Icon(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Polygon(origin = {10.562, 9.352}, fillColor = {42, 85, 94}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-85.751, 70.648}, {-102.737, 66.761}, {-105.751, 50.648}, {-105.751, -69.352}, {-99.475, -85.465}, {-85.751, -89.352}, {74.249, -89.352}, {81.746, -83.29}, {84.249, -76.041}, {84.249, 34.141}, {79.249, 43.202}, {54.249, 43.202}, {52.314, 67.486}, {31.729, 70.648}, {-85.751, 70.648}}, smooth = Smooth.Bezier), Rectangle(origin = {-71.211, 40}, fillColor = {106, 108, 116}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-32.24, -20}, {32.24, 20}}, radius = 10), Rectangle(origin = {-79.366, -45.041}, fillPattern = FillPattern.Solid, extent = {{-25.915, -15.041}, {25.915, 15.041}}, radius = 10), Text(origin = {0, -130}, extent = {{-100, -20}, {100, 20}}, textString = "%Port"), Text(origin = {5, -30}, lineColor = {255, 255, 255}, extent = {{-75, 30}, {75, -30}}, textString = "Leonardo")}), + Diagram(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Polygon(origin = {10.562, 9.352}, fillColor = {42, 85, 94}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-85.751, 70.648}, {-102.737, 66.761}, {-105.751, 50.648}, {-105.751, -69.352}, {-99.475, -85.465}, {-85.751, -89.352}, {74.249, -89.352}, {81.746, -83.29}, {84.249, -76.041}, {84.249, 34.141}, {79.249, 43.202}, {54.249, 43.202}, {52.314, 67.486}, {31.729, 70.648}, {-85.751, 70.648}}, smooth = Smooth.Bezier), Rectangle(origin = {-71.211, 40}, fillColor = {106, 108, 116}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-32.24, -20}, {32.24, 20}}, radius = 10), Rectangle(origin = {-79.366, -45.041}, fillPattern = FillPattern.Solid, extent = {{-25.915, -15.041}, {25.915, 15.041}}, radius = 10), Ellipse(origin = {-8.451, 32.225}, lineColor = {255, 255, 255}, fillColor = {42, 85, 94}, fillPattern = FillPattern.Solid, lineThickness = 5, extent = {{-15, -12.225}, {15, 12.225}}, endAngle = 360), Ellipse(origin = {21.55, 32.22}, lineColor = {255, 255, 255}, fillColor = {42, 85, 94}, fillPattern = FillPattern.Solid, lineThickness = 5, extent = {{-15, -12.23}, {15, 12.23}}, endAngle = 360), Text(origin = {-5, -15}, lineColor = {255, 255, 255}, extent = {{-75, 25}, {95, -35}}, textString = "Leonardo", textStyle = {TextStyle.Bold})}), + Diagram(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {10, 10}), graphics = {Polygon(visible = true, origin = {10.751, 9.352}, fillColor = {42, 85, 94}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-85.751, 70.648}, {-102.737, 66.761}, {-105.751, 50.648}, {-105.751, -69.352}, {-99.475, -85.465}, {-85.751, -89.352}, {74.249, -89.352}, {81.746, -83.29}, {84.249, -76.041}, {84.249, 34.141}, {79.249, 43.202}, {54.249, 43.202}, {52.314, 67.486}, {31.729, 70.648}}, smooth = Smooth.Bezier), Rectangle(visible = true, origin = {-71.211, 40}, fillColor = {106, 108, 116}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-32.24, -20}, {32.24, 20}}, radius = 10), Rectangle(visible = true, origin = {-79.366, -45.041}, fillPattern = FillPattern.Solid, extent = {{-25.915, -15.041}, {25.915, 15.041}}, radius = 10), Rectangle(visible = true, origin = {0.725, 70}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-54.177, -6.186}, {54.177, 6.186}}, radius = 10), Rectangle(visible = true, origin = {22.372, -63.814}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-64.177, -6.186}, {64.177, 6.186}}, radius = 10), Rectangle(visible = true, origin = {25.52, -30}, fillPattern = FillPattern.Solid, extent = {{-51.029, -13.424}, {51.029, 13.424}}, radius = 10), Rectangle(visible = true, origin = {76.549, -63.624}, fillColor = {250, 105, 0}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {66.549, -63.624}, fillColor = {243, 134, 48}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {56.549, -63.624}, fillColor = {250, 105, 0}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {46.549, -63.624}, fillColor = {243, 134, 48}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {36.549, -63.624}, fillColor = {250, 105, 0}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {26.549, -63.624}, fillColor = {243, 134, 48}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {46.549, 70}, fillColor = {167, 219, 216}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {36.549, 70}, fillColor = {105, 210, 231}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {26.549, 70}, fillColor = {167, 219, 216}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {16.549, 70}, fillColor = {105, 210, 231}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {6.549, 70}, fillColor = {167, 219, 216}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {-3.451, 70}, fillColor = {105, 210, 231}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {-13.451, 70}, fillColor = {167, 219, 216}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {-23.451, 70}, fillColor = {105, 210, 231}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {-33.451, 70}, fillColor = {167, 219, 216}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {-43.451, 70}, fillColor = {105, 210, 231}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {-33.451, -63.624}, fillColor = {204, 208, 224}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {-23.451, -63.624}, fillColor = {204, 208, 224}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {-13.451, -63.624}, fillColor = {204, 208, 224}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {-3.451, -63.624}, fillColor = {204, 208, 224}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Ellipse(visible = true, origin = {-8.451, 43.801}, lineColor = {255, 255, 255}, fillColor = {42, 85, 94}, fillPattern = FillPattern.Solid, lineThickness = 5, extent = {{-15, -12.225}, {15, 12.225}}), Ellipse(visible = true, origin = {21.549, 43.801}, lineColor = {255, 255, 255}, fillColor = {42, 85, 94}, fillPattern = FillPattern.Solid, lineThickness = 5, extent = {{-15, -12.225}, {15, 12.225}}), Text(visible = true, origin = {10, 23.151}, extent = {{-40, -10}, {40, 10}}, textString = "Leonardo")})); + end ArduinoLeonardo; + + model customBoard + parameter Internal.Types.SerialPort Port = "COM1" "Name of the serial port"; + parameter Boolean ShowPinCapabilities = true "Set to true if you want to see the capabilities of the pins in your board"; + parameter Boolean UseDTR = false "Some boards like Arduino Leonardo require UseDTR=true"; + parameter String BoardName = "[Board Name]" "Name of the development board/Microcontroller you are using"; + OpenModelicaEmbedded.Internal.ExternalFunctions.FirmataBoardObject board = Internal.ExternalFunctions.FirmataBoardObject.constructor(Port, ShowPinCapabilities, integer(UpdatePeriod * 1000), BaudRate, UseDTR); + OpenModelicaEmbedded.Internal.Interfaces.BoardConnector boardConnector annotation( + Placement(visible = true, transformation(origin = {-90, -12.256}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {0, 0}, extent = {{-100, -100}, {100, 100}}, rotation = 0))); + protected + discrete Integer BoardId(start = -1) "Board Identifier. Initialized automatically keep as -1."; + constant Modelica.SIunits.Time UpdatePeriod = 0.01 "Sampling interval. The standard Firmata has a maximum sampling period of 10 ms (0.01 s)"; + constant Integer BaudRate = 57600 "Baud rate used to communicate with the board"; + equation + when initial() then + BoardId = Internal.ExternalFunctions.getBoardId(board); + end when; + when sample(0, UpdatePeriod) then + OpenModelicaEmbedded.Internal.ExternalFunctions.updateBoard(BoardId); + end when; + boardConnector = BoardId; + annotation( + Icon(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(fillColor = {0, 85, 0}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-95, 90}, {95, -70}}, radius = 10), Text(origin = {0, 20}, lineColor = {255, 255, 255}, extent = {{-85, 40}, {85, -40}}, textString = "%BoardName"), Text(origin = {0, -80}, extent = {{-50, 20}, {50, -20}}, textString = "Port: %Port")}), + Diagram(coordinateSystem(initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(fillColor = {0, 85, 0}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-95, 80}, {95, -80}}, radius = 10), Text(lineColor = {255, 255, 255}, extent = {{-85, 35}, {85, -35}}, textString = "%BoardName")})); + end customBoard; + + annotation( + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {10, 10}), graphics = {Polygon(visible = true, origin = {12.096, 9.352}, fillColor = {0, 128, 0}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-85.75100000000001, 70.648}, {-102.737, 66.761}, {-105.751, 50.648}, {-105.751, -69.352}, {-99.47499999999999, -85.465}, {-85.75100000000001, -89.352}, {74.249, -89.352}, {81.746, -83.29000000000001}, {86.32899999999999, -74.352}, {84.249, 34.141}, {82.185, 50.648}, {74.732, 67.486}, {52.373, 70.648}, {31.729, 70.648}}, smooth = Smooth.Bezier), Rectangle(visible = true, origin = {-69.67700000000001, 40}, fillColor = {106, 108, 116}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-32.24, -20}, {32.24, 20}}, radius = 10), Rectangle(visible = true, origin = {-77.83199999999999, -45.041}, fillPattern = FillPattern.Solid, extent = {{-25.915, -15.041}, {25.915, 15.041}}, radius = 10), Rectangle(visible = true, origin = {24.177, 70}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-54.177, -6.186}, {54.177, 6.186}}, radius = 10), Rectangle(visible = true, origin = {23.906, -63.814}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-64.17700000000001, -6.186}, {64.17700000000001, 6.186}}, radius = 10), Rectangle(visible = true, origin = {21.91, 0}, fillPattern = FillPattern.Solid, extent = {{-28.09, -25}, {28.09, 25}}, radius = 10), Rectangle(visible = true, origin = {78.083, -63.624}, fillColor = {250, 105, 0}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {68.083, -63.624}, fillColor = {243, 134, 48}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {58.083, -63.624}, fillColor = {250, 105, 0}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {48.083, -63.624}, fillColor = {243, 134, 48}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {38.083, -63.624}, fillColor = {250, 105, 0}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {28.083, -63.624}, fillColor = {243, 134, 48}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {70.00100000000001, 70}, fillColor = {167, 219, 216}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {60.001, 70}, fillColor = {105, 210, 231}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {50.001, 70}, fillColor = {167, 219, 216}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {40.001, 70}, fillColor = {105, 210, 231}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {30.001, 70}, fillColor = {167, 219, 216}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {20.001, 70}, fillColor = {105, 210, 231}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {10.001, 70}, fillColor = {167, 219, 216}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {0.001, 70}, fillColor = {105, 210, 231}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {-9.999000000000001, 70}, fillColor = {167, 219, 216}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {-19.999, 70}, fillColor = {105, 210, 231}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {-31.917, -63.624}, fillColor = {204, 208, 224}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {-21.917, -63.624}, fillColor = {204, 208, 224}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {-11.917, -63.624}, fillColor = {204, 208, 224}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50), Rectangle(visible = true, origin = {-1.917, -63.624}, fillColor = {204, 208, 224}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Engraved, extent = {{-4.118, -3.624}, {4.118, 3.624}}, radius = 50)}), + Diagram(coordinateSystem(extent = {{-148.5, -105}, {148.5, 105}}, preserveAspectRatio = true, initialScale = 0.1, grid = {5, 5}))); + end Boards; + + + package Examples "A collection of examples to help you get started" + extends Modelica.Icons.ExamplesPackage; + + model BlinkLed "Basic example of blinking an LED" + extends Modelica.Icons.Example; + replaceable OpenModelicaEmbedded.Boards.Arduino arduino(Port = "/dev/ttyACM0", ShowPinCapabilities = true, UseDTR = false) annotation( + Placement(visible = true, transformation(origin = {30, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaEmbedded.Pins.DigitalOutput digitalOutput(Pin = 30) annotation( + Placement(visible = true, transformation(origin = {0, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {35, 15}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Sources.BooleanPulse booleanPulse annotation( + Placement(visible = true, transformation(origin = {-30, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + equation + connect(digitalOutput.pinConnector, arduino.boardConnector) annotation( + Line(points = {{10, -10}, {30, -10}}, color = {72, 73, 79})); + connect(booleanPulse.y, digitalOutput.u) annotation( + Line(points = {{-19, -10}, {-10, -10}}, color = {255, 0, 255})); + annotation( + experiment(StopTime = 10, Interval = 0.001), + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = false, initialScale = 0.1, grid = {10, 10})), + preferredView = "diagram", + Documentation(info = "This example uses the DigitalOutput component to control the LED attached to the Arduino board on pin 13. It uses a BooleanPulse from the Modelica library to produce an On/Off signal that is fed into the DigitalOutput component. This will make the LED attached to the pin blink.
+You can go ahead and add more LEDs to the board as shown in the following figure. This will require you to add one more DigitalOutput component to control the LED on pin 9.
+", revisions = ""), + Diagram(coordinateSystem(extent = {{-50, -50}, {50, 50}}, initialScale = 0.1, grid = {5, 5}))); + end BlinkLed; + + model DimmingLed "Changing the intensity of an LED" + extends Modelica.Icons.Example; + OpenModelicaEmbedded.Boards.Arduino arduino(Port = "/dev/ttyACM0", ShowPinCapabilities = true) annotation( + Placement(visible = true, transformation(origin = {30, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Pins.AnalogOutput analogOutput(MaxValue = 512, MinValue = -512, Pin = 30) annotation( + Placement(visible = true, transformation(origin = {0, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {35, 25}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaEmbedded.Pins.AnalogInput analogInput1(MaxValue = 512, MinValue = -512, Pin = 23) annotation( + Placement(visible = true, transformation(origin = {-30, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + equation + connect(analogInput1.pinConnector, arduino.boardConnector) annotation( + Line(points = {{-40, -10}, {-45, -10}, {-45, -40}, {30, -40}, {30, -10}, {30, -10}})); + connect(analogInput1.y, analogOutput.u) annotation( + Line(points = {{-20, -10}, {-10, -10}, {-10, -10}, {-10, -10}}, color = {0, 0, 127})); + connect(analogOutput.pinConnector, arduino.boardConnector) annotation( + Line(visible = true, origin = {20, -10}, points = {{-10, -0}, {10, 0}})); + annotation( + experiment(Interval = 0.001, __Wolfram_SynchronizeWithRealTime = true), + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = false, initialScale = 0.1, grid = {10, 10})), + preferredView = "diagram", + Documentation(info = "This example uses the AnalogOutput component to change the light intensity of an LED. AnalogOutput uses the Arduino function 'analogWrite', which produces a PWM (Pulse-Width Modulated) signal. This type of signal can be used to directly control the LED intensity. The following figure shows the connections.
+ +You can check the Arduino Playground to know more about PWM outputs.
", revisions = ""), + Diagram(coordinateSystem(extent = {{-50, -50}, {50, 50}}, initialScale = 0.1, grid = {5, 5}))); + end DimmingLed; + + model ReadSensor "Reading analog signals" + extends Modelica.Icons.Example; + OpenModelicaEmbedded.Boards.Arduino arduino(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {0, 15}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaEmbedded.Pins.DigitalOutput digitalOutput(Pin = 10) annotation( + Placement(visible = true, transformation(origin = {-30, 15}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaEmbedded.Pins.AnalogInput analogInput1(Pin = 16) annotation( + Placement(visible = true, transformation(origin = {30, 15}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Logical.Greater greater1 annotation( + Placement(visible = true, transformation(origin = {-10, -15}, extent = {{10, -10}, {-10, 10}}, rotation = 0))); + Modelica.Blocks.Sources.Constant Reference(k = 0.5) annotation( + Placement(visible = true, transformation(origin = {30, -30}, extent = {{-10, -10}, {10, 10}}, rotation = -180))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-30, -40}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + equation + connect(greater1.y, digitalOutput.u) annotation( + Line(visible = true, origin = {-38.744, -2.5}, points = {{17.744, -12.5}, {-6.256, -12.5}, {-6.256, 17.5}, {-1.256, 17.5}}, color = {255, 0, 255})); + connect(analogInput1.y, greater1.u1) annotation( + Line(visible = true, origin = {33.994, -5}, points = {{6.006, 20}, {11.006, 20}, {11.006, 0}, {-23.994, 0}, {-23.994, -10}, {-31.994, -10}}, color = {0, 0, 127})); + connect(analogInput1.pinConnector, arduino.boardConnector) annotation( + Line(visible = true, origin = {10, 15}, points = {{10, 0}, {-10, 0}}, color = {72, 73, 79})); + connect(digitalOutput.pinConnector, arduino.boardConnector) annotation( + Line(visible = true, origin = {-10, 15}, points = {{-10, 0}, {10, 0}}, color = {72, 73, 79})); + connect(Reference.y, greater1.u2) annotation( + Line(visible = true, origin = {12.75, -29}, points = {{6.25, -1}, {-2.75, -1}, {-2.75, 6}, {-10.75, 6}}, color = {0, 0, 127})); + annotation( + experiment(StartTime = 0.0, StopTime = 10.0, Interval = 0.001, __Wolfram_Algorithm = "dassl", Tolerance = 1e-006, __Wolfram_SynchronizeWithRealTime = true), + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = false, initialScale = 0.1, grid = {10, 10})), + preferredView = "diagram", + Documentation(info = "This example shows how to read an analog voltage using the AnalogInput component. The analog signal is then compared to a reference, and if the signal is above the reference, it will turn on an LED. You can see in the following figure how to build this example.
+ +You can see that pin A0 for the Arduino corresponds to pin number 14 for the Firmata. For other boards, the pin numbering may vary.
+Run the simulation and move the potentiometer. You should see that when the position of the shaft is near the middle, the LED changes state.
+The AnalogInput component returns a signal between 0 and 1. This value represents the voltage between 0 and the reference voltage. If you prefer to get the signal directly in volts, you need to change the 'MaxValue' property to the reference voltage, but generally it is either 5 V or 3.3 V.
", revisions = ""), + Diagram(coordinateSystem(extent = {{-50, -50}, {50, 50}}, initialScale = 0.1, grid = {5, 5}))); + end ReadSensor; + + model MoveServo "Using servos" + extends Modelica.Icons.Example; + Boards.Arduino arduino(Port = "COM1") annotation( + Placement(visible = true, transformation(origin = {30, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Pins.Servo servo(Pin = 10) annotation( + Placement(visible = true, transformation(origin = {0, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Sources.ExpSine expSine(offset = 0.5, amplitude = 0.5, freqHz = 0.4, damping = 0.1) annotation( + Placement(visible = true, transformation(origin = {-30, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-25, 35}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + equation + connect(expSine.y, servo.u) annotation( + Line(visible = true, origin = {-14.5, -10}, points = {{-4.5, -0}, {4.5, 0}}, color = {0, 0, 127})); + connect(servo.pinConnector, arduino.boardConnector) annotation( + Line(visible = true, origin = {20, -10}, points = {{-10, 0}, {10, -0}}, color = {72, 73, 79})); + annotation( + experiment(Interval = 0.001, __Wolfram_SynchronizeWithRealTime = true), + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = false, initialScale = 0.1, grid = {10, 10})), + preferredView = "diagram", + Documentation(info = "This example shows how to control a servo by using the Servo component. You can find the diagram in the following figure.
+For this example, it is recommended to use an external power source to provide voltage for the servo. This is because the power from the Arduino may not be enough to supply the servo. If you are not sure how to connect your servo, take a look at the reference in the Arduino Playground (http://playground.arduino.cc).
+ +Servos are controlled with a signal in the range of 0 to 1, where 0 corresponds to 0 degrees of rotation and 1 to 180 degrees. This example makes the servo bounce from 0 to 180 degrees until it gets stable around 90 degrees.
", revisions = ""), + Diagram(coordinateSystem(extent = {{-50, -50}, {50, 50}}, initialScale = 0.1, grid = {5, 5}))); + end MoveServo; + + model SimpleONOFF "A simple On/Off controller" + extends Modelica.Icons.Example; + OpenModelicaEmbedded.Boards.Arduino arduino(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {0, 15}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaEmbedded.Pins.AnalogInput analogInput1(MaxValue = 3.3 * 100, Pin = 23, adcResolution = 12) annotation( + Placement(visible = true, transformation(origin = {30, 15}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Sources.Constant Reference(k = 40) annotation( + Placement(visible = true, transformation(origin = {35, -25}, extent = {{-10, -10}, {10, 10}}, rotation = -180))); + Modelica.Blocks.Math.Add add1(k2 = +1, k1 = -1) annotation( + Placement(visible = true, transformation(origin = {-0, -25}, extent = {{10, -10}, {-10, 10}}, rotation = 0))); + Pins.DigitalOutput digitalOutput(Pin = 30) annotation( + Placement(visible = true, transformation(origin = {-30, 15}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Logical.Hysteresis hysteresis(uLow = -1, uHigh = 1) annotation( + Placement(visible = true, transformation(origin = {-30, -25}, extent = {{10, -10}, {-10, 10}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {42.5, 42.5}, extent = {{-7.5, -7.5}, {7.5, 7.5}}, rotation = 0))); + equation + connect(hysteresis.u, add1.y) annotation( + Line(visible = true, origin = {-14.5, -25}, points = {{-3.5, -0}, {3.5, 0}}, color = {0, 0, 127})); + connect(digitalOutput.u, hysteresis.y) annotation( + Line(visible = true, origin = {-43.25, 5}, points = {{3.25, 10}, {-1.75, 10}, {-1.75, -30}, {2.25, -30}}, color = {255, 0, 255})); + connect(digitalOutput.pinConnector, arduino.boardConnector) annotation( + Line(visible = true, origin = {-10, 15}, points = {{-10, 0}, {10, 0}})); + connect(add1.u2, Reference.y) annotation( + Line(visible = true, origin = {18.5, -23}, points = {{-6.5, -8}, {1.5, -8}, {1.5, -2}, {5.5, -2}}, color = {0, 0, 127})); + connect(analogInput1.y, add1.u1) annotation( + Line(visible = true, origin = {33.506, 12}, points = {{6.494, 3}, {11.494, 3}, {11.494, -17}, {-13.506, -17}, {-13.506, -31}, {-21.506, -31}}, color = {0, 0, 127})); + connect(arduino.boardConnector, analogInput1.pinConnector) annotation( + Line(visible = true, origin = {10, 15}, points = {{-10, 0}, {10, 0}})); + annotation( + experiment(Interval = 0.001, __Wolfram_SynchronizeWithRealTime = true), + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = false, initialScale = 0.1, grid = {10, 10})), + preferredView = "diagram", + Documentation(info = "This example is a simple ON/OFF controller and can be used for either heating or cooling. It uses an LM35 to read the temperature, and based on that temperature, the controller switches a relay on or off. You can attach a fan or a heater to the relay, depending on the operation you want to perform. You can find the diagram in the following figure.
Note: You need to be careful when using relays that control electrical equipment using AC voltage, because an incorrect connection may damage your board.
The target temperature is set by a constant component. The measured temperature is subtracted from the reference in order to obtain the error. The error signal is fed into the hysteresis component, which will send a Boolean signal to control the relay. If you want cooling instead of heating, you need to invert the logic of this signal.
"), + Diagram(coordinateSystem(extent = {{-50, -50}, {50, 50}}, initialScale = 0.1, grid = {5, 5}))); + end SimpleONOFF; + + model UsingArduinoLeonardo "Basic example of blinking an LED" + extends OpenModelicaEmbedded.Examples.BlinkLed(redeclare OpenModelicaEmbedded.Boards.ArduinoLeonardo arduino); + annotation( + experiment(StopTime = 10, Interval = 0.001, __Wolfram_SynchronizeWithRealTime = true), + Documentation(info = "This example shows how the + Blink Led can be used with an Arduino Leonardo.
", revisions = "")); + end UsingArduinoLeonardo; + + + + + model UsingCustomBoard "Using a Firmata-compatible board" + extends Modelica.Icons.Example; + Modelica.Blocks.Sources.BooleanPulse booleanPulse(period = 1) annotation( + Placement(visible = true, transformation(origin = {-30, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Pins.DigitalOutput digitalOutput(Pin = 13) annotation( + Placement(visible = true, transformation(origin = {-0, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Boards.CustomFirmata customFirmata(Port = "COM1", BaudRate = 115200, UpdatePeriod = 0.001) annotation( + Placement(visible = true, transformation(origin = {30, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-30, 30}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + equation + connect(digitalOutput.pinConnector, customFirmata.boardConnector) annotation( + Line(visible = true, origin = {20, -10}, points = {{-10, 0}, {10, -0}})); + connect(booleanPulse.y, digitalOutput.u) annotation( + Line(visible = true, origin = {-14.5, -10}, points = {{-4.5, 0}, {4.5, 0}}, color = {255, 0, 255})); + annotation( + experiment(Interval = 0.001, __Wolfram_SynchronizeWithRealTime = true), + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = false, initialScale = 0.1, grid = {10, 10})), + preferredView = "diagram", + Documentation(info = "- 1 Teensy 3.1 board
+This example shows how to use a board with a custom version of Firmata. The Teensy board works perfectly with the StandardFirmata, but in this example it is modified in order get a faster data transfer speed.
+ +
The main difference of the CustomFirmata component is that it allows you to set the baud rate to the sampling interval that you want to use. In this case the oce of the StandardFirmata is modified to use a baud rate of 115200. You can perform this modification in the source code. Search for the line:
Firmata.Begin(57600);
+and changing it to
+Firmata.Begin(115200);
+This initializes the serial port at the given speed. The next change that you can make is reducing the minimum sampling interval. You can find this tweak by searching in the code the text:
+#define MINIMUM_SAMPLING_INTERVAL 10
+and changing it to
+#define MINIMUM_SAMPLING_INTERVAL 1
+This changes the sampling interval limit from 10 ms to 1ms. You have to consider that this change is possible because the Teensy board can run up to 96 MHz. If you change the sampling interval, it is necessary to change the simulation setting in SimulationCenter to 1 ms, as shown in the following figure.
+ ", revisions = ""), + Diagram(coordinateSystem(extent = {{-50, -50}, {50, 50}}, initialScale = 0.1, grid = {5, 5}))); + end UsingCustomBoard; + + model UsingStandardFirmata "Using a standard Firmata board" + extends Modelica.Icons.Example; + Boards.StandardFirmata standardFirmata(Port = "COM1", ShowPinCapabilities = true) annotation( + Placement(visible = true, transformation(origin = {30, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaEmbedded.Pins.DigitalOutput digitalOutput(Pin = 13) annotation( + Placement(visible = true, transformation(origin = {-0, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Sources.BooleanPulse booleanPulse(period = 1) annotation( + Placement(visible = true, transformation(origin = {-30, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-35, 40}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + equation + connect(digitalOutput.pinConnector, standardFirmata.boardConnector) annotation( + Line(visible = true, origin = {20, -10}, points = {{-10, 0}, {10, 0}}, color = {72, 73, 79})); + connect(booleanPulse.y, digitalOutput.u) annotation( + Line(visible = true, origin = {-14.5, -10}, points = {{-4.5, 0}, {4.5, 0}}, color = {255, 0, 255})); + annotation( + experiment(StopTime = 10, Interval = 0.001, __Wolfram_SynchronizeWithRealTime = true), + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = false, initialScale = 0.1, grid = {10, 10})), + preferredView = "diagram", + Documentation(info = "This example uses the DigitalOutput component to control the LED attached to a standard Firmata board on pin 13. It uses a BooleanPulse from the Modelica library to produce an On/Off signal that is fed into the DigitalOutput component. This will make the LED attached to the pin blink.
+You can go ahead and add more LEDs to the board as shown in the following figure. This will require you to add one more DigitalOutput component to control the LED on pin 9.
+ ", revisions = ""), + Diagram(coordinateSystem(extent = {{-50, -50}, {50, 50}}, initialScale = 0.1, grid = {5, 5}))); + end UsingStandardFirmata; + + model DCMotorWithPWM + extends Modelica.Icons.Example; + OpenModelicaEmbedded.Boards.customBoard customBoard1(BoardName = "Arduino UNO", Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {13, 29}, extent = {{-25, -25}, {25, 25}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {54, 78}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaEmbedded.Pins.AnalogOutput analogOutput1(MaxValue = 255, Pin = 30) annotation( + Placement(visible = true, transformation(origin = {-57, 29}, extent = {{-15, -15}, {15, 15}}, rotation = 0))); + OpenModelicaEmbedded.Pins.DigitalOutput digitalOutput1(Pin = 8) annotation( + Placement(visible = true, transformation(origin = {-45, -23}, extent = {{-13, -13}, {13, 13}}, rotation = 90))); + OpenModelicaEmbedded.Pins.DigitalOutput digitalOutput2(Pin = 9) annotation( + Placement(visible = true, transformation(origin = {50, -28}, extent = {{-10, -10}, {10, 10}}, rotation = 90))); + Modelica.Blocks.Sources.BooleanConstant booleanConstant1(k = true) annotation( + Placement(visible = true, transformation(origin = {-70, -70}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Sources.BooleanConstant booleanConstant2(k = false) annotation( + Placement(visible = true, transformation(origin = {14, -74}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaEmbedded.Pins.AnalogInput analogInput1(MaxValue = 1024, Pin = 23) annotation( + Placement(visible = true, transformation(origin = {-56, 74}, extent = {{-14, -14}, {14, 14}}, rotation = 0))); + equation + connect(analogInput1.y, analogOutput1.u) annotation( + Line(points = {{-42, 74}, {-20, 74}, {-20, 52}, {-90, 52}, {-90, 28}, {-72, 28}, {-72, 30}}, color = {0, 0, 127})); + connect(analogInput1.pinConnector, customBoard1.boardConnector) annotation( + Line(points = {{-70, 74}, {-88, 74}, {-88, 92}, {12, 92}, {12, 30}, {14, 30}})); + connect(digitalOutput1.pinConnector, customBoard1.boardConnector) annotation( + Line(points = {{-45, -10}, {-44.75, -10}, {-44.75, -2}, {14, -2}, {14, 30}})); + connect(booleanConstant1.y, digitalOutput1.u) annotation( + Line(points = {{-58, -70}, {-46, -70}, {-46, -36}, {-45, -36}}, color = {255, 0, 255})); + connect(booleanConstant2.y, digitalOutput2.u) annotation( + Line(points = {{26, -74}, {50, -74}, {50, -40}, {49, -40}, {49, -38}, {50, -38}}, color = {255, 0, 255})); + connect(digitalOutput2.pinConnector, customBoard1.boardConnector) annotation( + Line(points = {{50, -18}, {50, 30}, {14, 30}})); + connect(analogOutput1.pinConnector, customBoard1.boardConnector) annotation( + Line(points = {{-42, 30}, {13, 30}, {13, 29}})); + annotation( + uses(OpenModelicaEmbedded(version = "1.2"), Modelica(version = "3.2.2"), Modelica_DeviceDrivers(version = "1.5.0"))); + end DCMotorWithPWM; + + model DCMotorWithPID + extends Modelica.Icons.Example; + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1(priority = "High", setPriority = true) annotation( + Placement(visible = true, transformation(origin = {92, 88}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Mechanics.Rotational.Components.Inertia inertia1(J = 1, a(start = 0), phi(start = 0), w(start = 0)) annotation( + Placement(visible = true, transformation(origin = {-22, -86}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Mechanics.Rotational.Components.Inertia inertia2(J = 1, a(start = 0), phi(start = 0), w(start = 0)) annotation( + Placement(visible = true, transformation(origin = {56, -86}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Mechanics.Rotational.Components.SpringDamper springDamper1(c = 20, d = 10, phi_rel0 = 0) annotation( + Placement(visible = true, transformation(origin = {16, -86}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Mechanics.Rotational.Sources.Torque torque1 annotation( + Placement(visible = true, transformation(origin = {-64, -86}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Mechanics.Rotational.Sources.ConstantTorque constantTorque1(tau_constant = 10) annotation( + Placement(visible = true, transformation(origin = {98, -86}, extent = {{10, -10}, {-10, 10}}, rotation = 0))); + Modelica.Mechanics.Rotational.Sensors.SpeedSensor speedSensor1 annotation( + Placement(visible = true, transformation(origin = {88, -36}, extent = {{-10, -10}, {10, 10}}, rotation = 90))); + OpenModelicaEmbedded.Boards.CustomFirmata customFirmata1(BaudRate = 57600, Port = "/dev/ttyACM0", ShowPinCapabilities = true, UpdatePeriod = 0.02, UseDTR = true) annotation( + Placement(visible = true, transformation(origin = {-10, 4}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaEmbedded.Pins.AnalogOutput analogOutput1(MaxValue = 512, MinValue = -512, Pin = 5) annotation( + Placement(visible = true, transformation(origin = {46, 2}, extent = {{10, -10}, {-10, 10}}, rotation = 0))); + OpenModelicaEmbedded.Pins.AnalogInput analogInput1(InitValue = 0, MaxValue = 512, MinValue = -512, Pin = 15) annotation( + Placement(visible = true, transformation(origin = {-64, 2}, extent = {{10, -10}, {-10, 10}}, rotation = 0))); + OpenModelicaEmbedded.Pins.AnalogOutput analogOutput2(MaxValue = 512, MinValue = -512, Pin = 6) annotation( + Placement(visible = true, transformation(origin = {-54, 58}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Sources.Sine sine1(amplitude = 512, freqHz = 0.5) annotation( + Placement(visible = true, transformation(origin = {-122, 58}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + equation + connect(sine1.y, analogOutput2.u) annotation( + Line(points = {{-110, 58}, {-64, 58}, {-64, 58}, {-64, 58}}, color = {0, 0, 127})); + connect(analogOutput2.pinConnector, customFirmata1.boardConnector) annotation( + Line(points = {{-44, 58}, {-10, 58}, {-10, 4}})); + connect(analogInput1.y, torque1.tau) annotation( + Line(points = {{-74, 2}, {-84, 2}, {-84, 2}, {-94, 2}, {-94, -86}, {-76, -86}}, color = {0, 0, 127})); + connect(analogInput1.pinConnector, customFirmata1.boardConnector) annotation( + Line(points = {{-54, 2}, {-10, 2}, {-10, 4}})); + connect(speedSensor1.w, analogOutput1.u) annotation( + Line(points = {{88, -25}, {89, -25}, {89, -23}, {88, -23}, {88, 3}, {56, 3}, {56, 1}}, color = {0, 0, 127})); + connect(analogOutput1.pinConnector, customFirmata1.boardConnector) annotation( + Line(points = {{36, 2}, {35.5, 2}, {35.5, 2}, {35, 2}, {35, 4}, {-10, 4}})); + connect(speedSensor1.flange, constantTorque1.flange) annotation( + Line(points = {{88, -46}, {88, -86}})); + connect(inertia2.flange_b, constantTorque1.flange) annotation( + Line(points = {{66, -86}, {88, -86}, {88, -86}, {88, -86}, {88, -86}, {88, -86}})); + connect(torque1.flange, inertia1.flange_a) annotation( + Line(points = {{-54, -86}, {-37, -86}, {-37, -86}, {-32, -86}, {-32, -86}, {-31, -86}, {-31, -86}, {-32, -86}})); + connect(springDamper1.flange_b, inertia2.flange_a) annotation( + Line(points = {{26, -86}, {36, -86}, {36, -86}, {46, -86}, {46, -86}, {46, -86}})); + connect(inertia1.flange_b, springDamper1.flange_a) annotation( + Line(points = {{-12, -86}, {-3, -86}, {-3, -86}, {6, -86}, {6, -86}, {6, -86}})); + annotation( + uses(OpenModelicaEmbedded(version = "1.2"), Modelica(version = "3.2.2"), Modelica_DeviceDrivers(version = "1.5.0"))); + end DCMotorWithPID; + annotation( + Diagram(coordinateSystem(extent = {{-148.5, -105}, {148.5, 105}}, preserveAspectRatio = true, initialScale = 0.1, grid = {5, 5}))); + end Examples; + + + package Internal "Internal classes that should not be used directly by the user" + extends Modelica.Icons.Package; + + package Icons "Icons used in ModelPlug" + extends Modelica.Icons.IconsPackage; + + partial model Block "Icon for blocks" + annotation( + experiment(NumberOfIntervals = -1), + preferredView = "icon", + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(visible = true, fillColor = {128, 128, 128}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -80}, {100, 80}}, radius = 40), Rectangle(visible = true, origin = {5, -5}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-95, -75}, {95, 75}}, radius = 40), Rectangle(visible = true, fillColor = {64, 64, 64}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-90, -70}, {90, 70}}, radius = 30)}), + Diagram(coordinateSystem(extent = {{-148.5, -105}, {148.5, 105}}, preserveAspectRatio = true, initialScale = 0.1, grid = {5, 5}))); + end Block; + annotation( + Diagram(coordinateSystem(extent = {{-148.5, -105}, {148.5, 105}}, preserveAspectRatio = true, initialScale = 0.1, grid = {5, 5}))); + end Icons; + + package ExternalFunctions "External functions used to communicate with the boards" + extends Modelica.Icons.Package; + + function readAnalogPin + input Integer pin; + input Real min; + input Real max; + input Real init; + input Integer board; + input Integer adcResolution; + output Real value; + + external "C" value = readAnalogPin(pin, min, max, init, board, adcResolution) annotation( + Include = "#include \"modelPlugFirmata.h\"", + Library = "modelPlugFirmata", + IncludeDirectory = "modelica://OpenModelicaEmbedded/Resources/Include", + LibraryDirectory = "modelica://OpenModelicaEmbedded/Resources/Library"); + end readAnalogPin; + + class FirmataBoardObject + extends ExternalObject; + + function constructor "Function that call the external constructor" + input String port; + input Boolean showCapabilities; + input Integer samplingMs; + input Integer BaudRate; + input Boolean UseDTR; + output FirmataBoardObject board; + + external "C" board = boardConstructor(port, showCapabilities, samplingMs, BaudRate, UseDTR) annotation( + Include = "#include \"modelPlugFirmata.h\"", + Library = "modelPlugFirmata", + IncludeDirectory = "modelica://OpenModelicaEmbedded/Resources/Include", + LibraryDirectory = "modelica://OpenModelicaEmbedded/Resources/Library"); + end constructor; + + function destructor "Function to destroy the object" + input FirmataBoardObject board; + + external "C" boardDestructor(board) annotation( + Include = "#include \"modelPlugFirmata.h\"", + Library = "modelPlugFirmata", + IncludeDirectory = "modelica://OpenModelicaEmbedded/Resources/Include", + LibraryDirectory = "modelica://OpenModelicaEmbedded/Resources/Library"); + end destructor; + end FirmataBoardObject; + + function getBoardId + input FirmataBoardObject board; + output Integer id; + + external "C" id = getBoardId(board) annotation( + Include = "#include \"modelPlugFirmata.h\"", + Library = "modelPlugFirmata", + IncludeDirectory = "modelica://OpenModelicaEmbedded/Resources/Include", + LibraryDirectory = "modelica://OpenModelicaEmbedded/Resources/Library"); + end getBoardId; + + function readDigitalPin + input Integer pin; + input Boolean init; + input Integer board; + output Boolean value; + + external "C" value = readDigitalPin(pin, init, board) annotation( + Include = "#include \"modelPlugFirmata.h\"", + Library = "modelPlugFirmata", + IncludeDirectory = "modelica://OpenModelicaEmbedded/Resources/Include", + LibraryDirectory = "modelica://OpenModelicaEmbedded/Resources/Library"); + end readDigitalPin; + + function writeAnalogPin + input Integer pin; + input Integer board; + input Real value; + + external "C" writeAnalogPin(pin, board, value) annotation( + Include = "#include \"modelPlugFirmata.h\"", + Library = "modelPlugFirmata", + IncludeDirectory = "modelica://OpenModelicaEmbedded/Resources/Include", + LibraryDirectory = "modelica://OpenModelicaEmbedded/Resources/Library"); + end writeAnalogPin; + + function writeDigitalPin + input Integer pin; + input Integer board; + input Boolean value; + + external "C" writeDigitalPin(pin, board, value) annotation( + Include = "#include \"modelPlugFirmata.h\"", + Library = "modelPlugFirmata", + IncludeDirectory = "modelica://OpenModelicaEmbedded/Resources/Include", + LibraryDirectory = "modelica://OpenModelicaEmbedded/Resources/Library"); + end writeDigitalPin; + + function updateBoard + input Integer board; + + external "C" updateBoard(board) annotation( + Include = "#include \"modelPlugFirmata.h\"", + Library = "modelPlugFirmata", + IncludeDirectory = "modelica://OpenModelicaEmbedded/Resources/Include", + LibraryDirectory = "modelica://OpenModelicaEmbedded/Resources/Library"); + end updateBoard; + + function writeServoPin + input Integer pin; + input Integer board; + input Real value; + input Integer MinPulse; + input Integer MaxPulse; + + external "C" writeServoPin(pin, board, value, MinPulse, MaxPulse) annotation( + Include = "#include \"modelPlugFirmata.h\"", + Library = "modelPlugFirmata", + IncludeDirectory = "modelica://OpenModelicaEmbedded/Resources/Include", + LibraryDirectory = "modelica://OpenModelicaEmbedded/Resources/Library"); + end writeServoPin; + annotation( + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {10, 10}), graphics = {Text(visible = true, origin = {11.425, 9.596}, extent = {{-101.424, -59.596}, {78.57599999999999, 40.404}}, textString = "EF")}), + Documentation(info = "", revisions = ""), + Diagram(coordinateSystem(extent = {{-148.5, 105}, {148.5, -105}}, preserveAspectRatio = true, initialScale = 0.1, grid = {10, 10})), + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}), graphics = {Rectangle(visible = true, fillColor = {209, 209, 209}, fillPattern = FillPattern.Solid, extent = {{-100, -100}, {75, 75}}), Polygon(visible = true, fillColor = {236, 236, 236}, fillPattern = FillPattern.Solid, points = {{-100, 75}, {-75, 100}, {100, 100}, {75, 75}}), Polygon(visible = true, fillColor = {177, 177, 177}, fillPattern = FillPattern.Solid, points = {{75, -100}, {75, 75}, {100, 100}, {100, -75}}), Text(visible = true, extent = {{-95.95, -91.88}, {63.97, 71.52}}, textString = "C")})); + end ExternalFunctions; + + package Types "Type and unit definitions" + extends Modelica.Icons.TypesPackage; + type ServoUnit = enumeration(None, Degrees, Radians); + type SerialPort = String annotation( + Dialog(__Wolfram_serialPortSelector = true)); + annotation( + Diagram(coordinateSystem(extent = {{-148.5, -105}, {148.5, 105}}, preserveAspectRatio = true, initialScale = 0.1, grid = {5, 5}))); + end Types; + + package Interfaces "Package with connectors and partial models" + extends Modelica.Icons.InterfacesPackage; + connector BoardConnector = output Integer annotation( + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {10, 10}), graphics = {Ellipse(visible = true, origin = {-0, 0.74}, fillColor = {64, 64, 64}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-10, -9.26}, {10, 9.26}})}), + Diagram(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {10, 10}), graphics = {Ellipse(visible = true, origin = {-0, 0.74}, fillColor = {64, 64, 64}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-10, -9.26}, {10, 9.26}})})); + connector PinConnector = input Integer annotation( + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {10, 10}), graphics = {Ellipse(visible = true, fillColor = {64, 64, 64}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -100}, {100, 100}}), Ellipse(visible = true, fillColor = {128, 128, 128}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-70, -70}, {70, 70}})}), + Diagram(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {10, 10}), graphics = {Ellipse(visible = true, fillColor = {64, 64, 64}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -100}, {100, 100}}), Ellipse(visible = true, fillColor = {128, 128, 128}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-70, -70}, {70, 70}})})); + end Interfaces; + annotation( + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {10, 10}), graphics = {Polygon(visible = true, origin = {1.383, -4.142}, rotation = 45, fillColor = {64, 64, 64}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-15, 93.333}, {-15, 68.333}, {0, 58.333}, {15, 68.333}, {15, 93.333}, {20, 93.333}, {25, 83.333}, {25, 58.333}, {10, 43.333}, {10, -41.667}, {25, -56.667}, {25, -76.667}, {10, -91.667}, {0, -91.667}, {0, -81.667}, {5, -81.667}, {15, -71.667}, {15, -61.667}, {5, -51.667}, {-5, -51.667}, {-15, -61.667}, {-15, -71.667}, {-5, -81.667}, {0, -81.667}, {0, -91.667}, {-10, -91.667}, {-25, -76.667}, {-25, -56.667}, {-10, -41.667}, {-10, 43.333}, {-25, 58.333}, {-25, 83.333}, {-20, 93.333}}), Polygon(visible = true, origin = {10.102, 5.218}, rotation = -45, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, points = {{-15, 87.273}, {15, 87.273}, {20, 82.273}, {20, 27.273}, {10, 17.273}, {10, 7.273}, {20, 2.273}, {20, -2.727}, {5, -2.727}, {5, -77.727}, {10, -87.727}, {5, -112.727}, {-5, -112.727}, {-10, -87.727}, {-5, -77.727}, {-5, -2.727}, {-20, -2.727}, {-20, 2.273}, {-10, 7.273}, {-10, 17.273}, {-20, 27.273}, {-20, 82.273}})})); + end Internal; + + + + package ArduinoExamples + extends Modelica.Icons.ExamplesPackage; + + package Led + extends Modelica.Icons.ExamplesPackage; + + model ex1_led_blue + extends Modelica.Icons.Example; + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-60, 60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaEmbedded.Pins.DigitalOutput digitalOutput1(Pin = 9) annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, -20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Sources.BooleanConstant booleanConstant1(k = true) annotation( + Placement(visible = true, transformation(origin = {-60, -20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Boards.customBoard customBoard1(BoardName = "Arduino UNO", Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {61, -21}, extent = {{-21, -21}, {21, 21}}, rotation = 0))); + equation + connect(digitalOutput1.pinConnector, customBoard1.boardConnector) annotation( + Line(points = {{20, -20}, {60, -20}, {60, -20}, {62, -20}})); + connect(booleanConstant1.y, digitalOutput1.u) annotation( + Line(points = {{-38, -20}, {-20, -20}, {-20, -20}, {-20, -20}}, color = {255, 0, 255})); + end ex1_led_blue; + + + + + + + + model ex2_led_blue_delay + extends Modelica.Icons.Example; + OpenModelicaEmbedded.Boards.Arduino arduino1(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {60, -20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaEmbedded.Pins.DigitalOutput digitalOutput1(Pin = 9) annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, -20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1(enableRealTimeScaling = false) annotation( + Placement(visible = true, transformation(origin = {-60, 60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Sources.BooleanPulse booleanPulse1(period = 20, startTime = 5, width = 10) annotation( + Placement(visible = true, transformation(origin = {-60, -20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + equation + connect(booleanPulse1.y, digitalOutput1.u) annotation( + Line(points = {{-38, -20}, {-20, -20}, {-20, -20}, {-20, -20}}, color = {255, 0, 255})); + connect(digitalOutput1.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{20, -20}, {60, -20}, {60, -20}, {60, -20}})); + end ex2_led_blue_delay; + + model ex3_led_blue_red + extends Modelica.Icons.Example; + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-60, 60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaEmbedded.Pins.DigitalOutput digitalOutput1(Pin = 9) annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, 3.55271e-15}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaEmbedded.Pins.DigitalOutput digitalOutput2(Pin = 11) annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, -60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Sources.BooleanPulse booleanPulse1(period = 20, startTime = 5, width = 25) annotation( + Placement(visible = true, transformation(origin = {-60, 3.55271e-15}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Sources.BooleanPulse booleanPulse2(period = 20, startTime = 5, width = 40) annotation( + Placement(visible = true, transformation(origin = {-60, -60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaEmbedded.Boards.customBoard customBoard1(BoardName = "Arduino UNO", Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {60, -20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + equation + connect(digitalOutput1.pinConnector, customBoard1.boardConnector) annotation( + Line(points = {{20, 0}, {60, 0}, {60, -20}, {60, -20}})); + connect(digitalOutput2.pinConnector, customBoard1.boardConnector) annotation( + Line(points = {{20, -60}, {60, -60}, {60, -20}, {60, -20}})); + connect(booleanPulse2.y, digitalOutput2.u) annotation( + Line(points = {{-38, -60}, {-20, -60}, {-20, -60}, {-20, -60}}, color = {255, 0, 255})); + connect(booleanPulse1.y, digitalOutput1.u) annotation( + Line(points = {{-38, 0}, {-20, 0}, {-20, 0}, {-20, 0}}, color = {255, 0, 255})); + end ex3_led_blue_red; + + model ex4_led_blink + extends Modelica.Icons.Example; + OpenModelicaEmbedded.Boards.Arduino arduino1(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {42, -6}, extent = {{-14, -14}, {14, 14}}, rotation = 0))); + OpenModelicaEmbedded.Pins.DigitalOutput digitalOutput1(Pin = 10) annotation( + Placement(visible = true, transformation(origin = {-9, -7}, extent = {{-13, -13}, {13, 13}}, rotation = 0))); + Modelica.Blocks.Sources.BooleanPulse booleanPulse1(period = 2, startTime = 4, width = 50) annotation( + Placement(visible = true, transformation(origin = {-68, -12}, extent = {{-14, -14}, {14, 14}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-19, 51}, extent = {{-13, -13}, {13, 13}}, rotation = 0))); + equation + connect(booleanPulse1.y, digitalOutput1.u) annotation( + Line(points = {{-53, -12}, {-24, -12}, {-24, -7}, {-22, -7}}, color = {255, 0, 255})); + connect(digitalOutput1.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{4, -7}, {22, -7}, {22, -6}, {42, -6}})); + annotation( + uses(OpenModelicaEmbedded(version = "1.2"), Modelica(version = "3.2.2"), Modelica_DeviceDrivers(version = "1.5.0"))); + end ex4_led_blink; + end Led; + + package Push_button + extends Modelica.Icons.ExamplesPackage; + + model ex1_push_button_status + extends Modelica.Icons.Example; + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-70, 70}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaEmbedded.Boards.Arduino arduino1(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {-60, 3.55271e-15}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaEmbedded.Pins.DigitalInput digitalInput1(Pin = 12) annotation( + Placement(visible = true, transformation(origin = {0, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Interaction.Show.BooleanValue booleanValue1 annotation( + Placement(visible = true, transformation(origin = {80, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + equation + connect(digitalInput1.y, booleanValue1.activePort) annotation( + Line(points = {{20, 0}, {54, 0}, {54, 0}, {58, 0}}, color = {255, 0, 255})); + connect(arduino1.boardConnector, digitalInput1.pinConnector) annotation( + Line(points = {{-60, 0}, {-20, 0}})); + Modelica.Utilities.Streams.print(String(booleanValue1.activePort)); + end ex1_push_button_status; + + model ex2_led_push_button + extends Modelica.Icons.Example; + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-60, 60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaEmbedded.Pins.DigitalOutput digitalOutput1(Pin = 9) annotation( + Placement(visible = true, transformation(origin = {-60, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaEmbedded.Pins.DigitalInput digitalInput1(Pin = 12) annotation( + Placement(visible = true, transformation(origin = {62, 3.55271e-15}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaEmbedded.Boards.customBoard customBoard1(BoardName = "Arduino UNO", Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, 3.55271e-15}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + equation + connect(customBoard1.boardConnector, digitalInput1.pinConnector) annotation( + Line(points = {{0, 0}, {44, 0}, {44, 0}, {42, 0}})); + connect(digitalOutput1.pinConnector, customBoard1.boardConnector) annotation( + Line(points = {{-40, 0}, {0, 0}, {0, 0}, {0, 0}})); + connect(digitalInput1.y, digitalOutput1.u) annotation( + Line(points = {{82, 0}, {94, 0}, {94, -40}, {-92, -40}, {-92, 0}, {-80, 0}, {-80, 0}}, color = {255, 0, 255})); + end ex2_led_push_button; + end Push_button; + + package Ldr + extends Modelica.Icons.ExamplesPackage; + + model ex1_ldr_read + extends Modelica.Icons.Example; + OpenModelicaEmbedded.Boards.Arduino arduino1(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {-60, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaEmbedded.Pins.AnalogInput analogInput1(MaxValue = 1024, MinValue = 0, Pin = 23, adcResolution = 12) annotation( + Placement(visible = true, transformation(origin = {-4.44089e-16, 4.44089e-16}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-60, 60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Interaction.Show.RealValue realValue1(use_numberPort = true) annotation( + Placement(visible = true, transformation(origin = {60, -8.88178e-16}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + equation + connect(analogInput1.y, realValue1.numberPort) annotation( + Line(points = {{20, 0}, {37, 0}}, color = {0, 0, 127})); + connect(arduino1.boardConnector, analogInput1.pinConnector) annotation( + Line(points = {{-60, 0}, {-20, 0}, {-20, 0}, {-20, 0}})); + Modelica.Utilities.Streams.print(String(realValue1.numberPort)); + annotation( + uses(Modelica(version = "3.2.2"))); + end ex1_ldr_read; + + model ex2_ldr_led + extends Modelica.Icons.Example; + OpenModelicaEmbedded.Pins.DigitalOutput digitalOutput1(Pin = 9) annotation( + Placement(visible = true, transformation(origin = {-60, 20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaEmbedded.Pins.AnalogInput analogInput1(MaxValue = 1023, MinValue = 0, Pin = 19) annotation( + Placement(visible = true, transformation(origin = {60, 20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-70, 68}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Sources.Constant const(k = 300) annotation( + Placement(visible = true, transformation(origin = {60, -70}, extent = {{20, -20}, {-20, 20}}, rotation = 0))); + Modelica.Blocks.Logical.Less less1 annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, -40}, extent = {{20, -20}, {-20, 20}}, rotation = 0))); + OpenModelicaEmbedded.Boards.customBoard customBoard1(BoardName = "Arduino UNO", Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, 20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + equation + connect(customBoard1.boardConnector, analogInput1.pinConnector) annotation( + Line(points = {{0, 20}, {40, 20}, {40, 20}, {40, 20}})); + connect(digitalOutput1.pinConnector, customBoard1.boardConnector) annotation( + Line(points = {{-40, 20}, {0, 20}, {0, 20}, {0, 20}})); + connect(const.y, less1.u2) annotation( + Line(points = {{38, -70}, {32, -70}, {32, -56}, {24, -56}}, color = {0, 0, 127})); + connect(less1.y, digitalOutput1.u) annotation( + Line(points = {{-22, -40}, {-92, -40}, {-92, 20}, {-80, 20}}, color = {255, 0, 255})); + connect(analogInput1.y, less1.u1) annotation( + Line(points = {{80, 20}, {90, 20}, {90, -40}, {24, -40}}, color = {0, 0, 127})); + end ex2_ldr_led; + end Ldr; + + package DC_motor + extends Modelica.Icons.ExamplesPackage; + + model ex1_dcmotor_clock + extends Modelica.Icons.Example; + OpenModelicaEmbedded.Boards.Arduino arduino1(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {60, 4.21885e-15}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaEmbedded.Pins.AnalogOutput analogOutput1(MaxValue = 255, MinValue = 0, Pin = 9) annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, 20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaEmbedded.Pins.AnalogOutput analogOutput2(MaxValue = 255, MinValue = 0, Pin = 10) annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, -40}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {60, 60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Sources.Constant const(k = 0) annotation( + Placement(visible = true, transformation(origin = {-60, -40}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Sources.Pulse pulse1(amplitude = 255, period = 20, startTime = 5, width = 15) annotation( + Placement(visible = true, transformation(origin = {-60, 20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + equation + connect(analogOutput2.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{20, -40}, {60, -40}, {60, 0}, {60, 0}})); + connect(analogOutput1.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{20, 20}, {60, 20}, {60, 0}, {60, 0}, {60, 0}})); + connect(const.y, analogOutput2.u) annotation( + Line(points = {{-38, -40}, {-22, -40}, {-22, -40}, {-20, -40}}, color = {0, 0, 127})); + connect(pulse1.y, analogOutput1.u) annotation( + Line(points = {{-38, 20}, {-22, 20}, {-22, 20}, {-20, 20}}, color = {0, 0, 127})); + end ex1_dcmotor_clock; + + model ex2_dcmotor_both + extends Modelica.Icons.Example; + OpenModelicaEmbedded.Boards.Arduino arduino1(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {60, 4.21885e-15}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {60, 60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaEmbedded.Pins.DigitalOutput digitalOutput1(Pin = 8) annotation( + Placement(visible = true, transformation(origin = {1.33227e-15, 26}, extent = {{-14, -14}, {14, 14}}, rotation = 0))); + OpenModelicaEmbedded.Pins.DigitalOutput digitalOutput2(Pin = 9) annotation( + Placement(visible = true, transformation(origin = {4, -40}, extent = {{-14, -14}, {14, 14}}, rotation = 0))); + Modelica.Blocks.Sources.BooleanPulse booleanPulse1(period = 20) annotation( + Placement(visible = true, transformation(origin = {-65, 25}, extent = {{-13, -13}, {13, 13}}, rotation = 0))); + Modelica.Blocks.Sources.BooleanPulse booleanPulse2(period = 20, startTime = 10) annotation( + Placement(visible = true, transformation(origin = {-60, -40}, extent = {{-14, -14}, {14, 14}}, rotation = 0))); + equation + connect(booleanPulse1.y, digitalOutput1.u) annotation( + Line(points = {{-50, 26}, {-14, 26}}, color = {255, 0, 255})); + connect(digitalOutput1.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{14, 26}, {60, 26}, {60, 0}})); + connect(booleanPulse2.y, digitalOutput2.u) annotation( + Line(points = {{-44, -40}, {-10, -40}}, color = {255, 0, 255})); + connect(digitalOutput2.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{18, -40}, {60, -40}, {60, 0}})); + end ex2_dcmotor_both; + + model ex3_dcmotor_loop + extends Modelica.Icons.Example; + OpenModelicaEmbedded.Boards.Arduino arduino1(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {60, 4.21885e-15}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaEmbedded.Pins.AnalogOutput analogOutput1(MaxValue = 255, MinValue = 0, Pin = 9) annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, 18}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaEmbedded.Pins.AnalogOutput analogOutput2(MaxValue = 255, MinValue = 0, Pin = 10) annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, -40}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {60, 60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Sources.Pulse pulse1(amplitude = 255, period = 10, startTime = 5, width = 30) annotation( + Placement(visible = true, transformation(origin = {-60, 20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Sources.Pulse pulse2(amplitude = 255, period = 10, startTime = 10, width = 20) annotation( + Placement(visible = true, transformation(origin = {-60, -40}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + equation + connect(pulse1.y, analogOutput1.u) annotation( + Line(points = {{-38, 20}, {-20, 20}, {-20, 18}}, color = {0, 0, 127})); + connect(analogOutput1.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{20, 18}, {20, 39}, {60, 39}, {60, 0}})); + connect(pulse2.y, analogOutput2.u) annotation( + Line(points = {{-38, -40}, {-20, -40}, {-20, -40}, {-20, -40}}, color = {0, 0, 127})); + connect(analogOutput2.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{20, -40}, {60, -40}, {60, 0}, {60, 0}})); + end ex3_dcmotor_loop; + end DC_motor; + + package Potentiometer + extends Modelica.Icons.ExamplesPackage; + + model ex1_pot_threshold + extends Modelica.Icons.Example; + OpenModelicaEmbedded.Pins.AnalogInput analogInput1(MaxValue = 1023, MinValue = 0, Pin = 23, adcResolution = 12) annotation( + Placement(visible = true, transformation(origin = {28, 50}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaEmbedded.Pins.DigitalOutput digitalOutput1(Pin = 9) annotation( + Placement(visible = true, transformation(origin = {-50, 90}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {70, 70}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaEmbedded.Pins.DigitalOutput digitalOutput2(Pin = 10) annotation( + Placement(visible = true, transformation(origin = {-50, 50}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Logical.GreaterEqualThreshold greaterEqualThreshold1(threshold = 0) annotation( + Placement(visible = true, transformation(origin = {70, 10}, extent = {{10, -10}, {-10, 10}}, rotation = 0))); + Modelica.Blocks.Logical.GreaterEqualThreshold greaterEqualThreshold2(threshold = 320) annotation( + Placement(visible = true, transformation(origin = {70, -30}, extent = {{10, -10}, {-10, 10}}, rotation = 0))); + Modelica.Blocks.Logical.GreaterEqualThreshold greaterEqualThreshold3(threshold = 900) annotation( + Placement(visible = true, transformation(origin = {70, -70}, extent = {{10, -10}, {-10, 10}}, rotation = 0))); + Modelica.Blocks.Logical.Xor xor1 annotation( + Placement(visible = true, transformation(origin = {30, -10}, extent = {{10, -10}, {-10, 10}}, rotation = 0))); + Modelica.Blocks.Logical.Xor xor2 annotation( + Placement(visible = true, transformation(origin = {30, -50}, extent = {{10, -10}, {-10, 10}}, rotation = 0))); + OpenModelicaEmbedded.Pins.DigitalOutput digitalOutput3(Pin = 11) annotation( + Placement(visible = true, transformation(origin = {-50, 10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaEmbedded.Boards.customBoard customBoard1(BoardName = "Arduino UNO", Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {-10, 50}, extent = {{-14, -14}, {14, 14}}, rotation = 0))); + equation + connect(analogInput1.pinConnector, customBoard1.boardConnector) annotation( + Line(points = {{18, 50}, {-10, 50}})); + connect(digitalOutput1.pinConnector, customBoard1.boardConnector) annotation( + Line(points = {{-40, 90}, {-10, 90}, {-10, 50}})); + connect(digitalOutput2.pinConnector, customBoard1.boardConnector) annotation( + Line(points = {{-40, 50}, {-10, 50}})); + connect(digitalOutput3.pinConnector, customBoard1.boardConnector) annotation( + Line(points = {{-40, 10}, {-10, 10}, {-10, 50}})); + connect(xor1.y, digitalOutput3.u) annotation( + Line(points = {{20, -10}, {-72, -10}, {-72, 10}, {-60, 10}, {-60, 10}}, color = {255, 0, 255})); + connect(xor2.y, digitalOutput2.u) annotation( + Line(points = {{20, -50}, {-80, -50}, {-80, 50}, {-60, 50}, {-60, 50}}, color = {255, 0, 255})); + connect(greaterEqualThreshold3.y, digitalOutput1.u) annotation( + Line(points = {{60, -70}, {-90, -70}, {-90, 90}, {-60, 90}, {-60, 90}}, color = {255, 0, 255})); + connect(greaterEqualThreshold3.y, xor2.u2) annotation( + Line(points = {{60, -70}, {52, -70}, {52, -58}, {42, -58}, {42, -58}, {42, -58}}, color = {255, 0, 255})); + connect(greaterEqualThreshold2.y, xor2.u1) annotation( + Line(points = {{60, -30}, {52, -30}, {52, -50}, {42, -50}, {42, -50}}, color = {255, 0, 255})); + connect(greaterEqualThreshold2.y, xor1.u2) annotation( + Line(points = {{60, -30}, {52, -30}, {52, -18}, {42, -18}, {42, -18}}, color = {255, 0, 255})); + connect(greaterEqualThreshold1.y, xor1.u1) annotation( + Line(points = {{60, 10}, {50, 10}, {50, -10}, {42, -10}, {42, -10}}, color = {255, 0, 255})); + connect(analogInput1.y, greaterEqualThreshold1.u) annotation( + Line(points = {{38, 50}, {94, 50}, {94, 10}, {82, 10}, {82, 10}}, color = {0, 0, 127})); + connect(analogInput1.y, greaterEqualThreshold2.u) annotation( + Line(points = {{38, 50}, {94, 50}, {94, -30}, {82, -30}, {82, -30}, {82, -30}}, color = {0, 0, 127})); + connect(analogInput1.y, greaterEqualThreshold3.u) annotation( + Line(points = {{38, 50}, {94, 50}, {94, -70}, {82, -70}, {82, -70}}, color = {0, 0, 127})); + annotation( + uses(OpenModelicaEmbedded(version = "1.2"))); + end ex1_pot_threshold; + end Potentiometer; + + package Thermistor + extends Modelica.Icons.ExamplesPackage; + + model ex1_therm_read + extends Modelica.Icons.Example; + OpenModelicaEmbedded.Pins.AnalogInput analogInput1(MaxValue = 1023, MinValue = 0, Pin = 18) annotation( + Placement(visible = true, transformation(origin = {-4.44089e-16, 4.44089e-16}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-60, 60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaEmbedded.Boards.customBoard customBoard1(BoardName = "Arduino UNO", Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {-59, -1}, extent = {{-21, -21}, {21, 21}}, rotation = 0))); + equation + connect(customBoard1.boardConnector, analogInput1.pinConnector) annotation( + Line(points = {{-58, 0}, {-20, 0}, {-20, 0}, {-20, 0}})); + Modelica.Utilities.Streams.print(String(analogInput1.y)); + end ex1_therm_read; + + model ex2_therm_buzzer + extends Modelica.Icons.Example; + OpenModelicaEmbedded.Boards.Arduino arduino1(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, 20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaEmbedded.Pins.DigitalOutput digitalOutput1(Pin = 3) annotation( + Placement(visible = true, transformation(origin = {-60, 20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaEmbedded.Pins.AnalogInput analogInput1(MaxValue = 1023, MinValue = 0, Pin = 18) annotation( + Placement(visible = true, transformation(origin = {60, 20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-70, 68}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Sources.Constant const(k = 500) annotation( + Placement(visible = true, transformation(origin = {60, -70}, extent = {{20, -20}, {-20, 20}}, rotation = 0))); + Modelica.Blocks.Logical.Greater greater1 annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, -40}, extent = {{20, -20}, {-20, 20}}, rotation = 0))); + Modelica.Blocks.Interaction.Show.RealValue realValue1 annotation( + Placement(visible = true, transformation(origin = {40, 60}, extent = {{20, -20}, {-20, 20}}, rotation = 0))); + equation + connect(analogInput1.y, realValue1.numberPort) annotation( + Line(points = {{80, 20}, {90, 20}, {90, 60}, {64, 60}, {64, 60}}, color = {0, 0, 127})); + connect(greater1.y, digitalOutput1.u) annotation( + Line(points = {{-22, -40}, {-94, -40}, {-94, 20}, {-80, 20}, {-80, 20}}, color = {255, 0, 255})); + connect(analogInput1.y, greater1.u1) annotation( + Line(points = {{80, 20}, {92, 20}, {92, -40}, {24, -40}, {24, -40}}, color = {0, 0, 127})); + connect(greater1.u2, const.y) annotation( + Line(points = {{24, -56}, {32, -56}, {32, -70}, {38, -70}, {38, -70}}, color = {0, 0, 127})); + connect(arduino1.boardConnector, analogInput1.pinConnector) annotation( + Line(points = {{0, 20}, {40, 20}})); + connect(digitalOutput1.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{-40, 20}, {0, 20}})); + Modelica.Utilities.Streams.print(String(realValue1.numberPort)); + annotation( + uses(Modelica(version = "3.2.2"))); + end ex2_therm_buzzer; + end Thermistor; + + package Servo_motor + extends Modelica.Icons.ExamplesPackage; + + model ex1_servo_init + extends Modelica.Icons.Example; + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {70, 70}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaEmbedded.Boards.Arduino arduino1(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {78, 20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaEmbedded.Pins.Servo servo1(InputUnit = OpenModelicaEmbedded.Internal.Types.ServoUnit.None, MaxPulse = 1000000, MinPulse = 500000, Pin = 23) annotation( + Placement(visible = true, transformation(origin = {20, 20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Sources.Constant const(k = 0.1667) annotation( + Placement(visible = true, transformation(origin = {-40, 20}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + equation + connect(const.y, servo1.u) annotation( + Line(points = {{-18, 20}, {-4, 20}, {-4, 20}, {0, 20}}, color = {0, 0, 127})); + connect(servo1.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{40, 20}, {76, 20}, {76, 18}, {78, 18}, {78, 20}})); + annotation( + uses(Modelica_DeviceDrivers(version = "1.5.0"), OpenModelicaEmbedded(version = "1.2"), Modelica(version = "3.2.2"))); + end ex1_servo_init; + + model ex2_servo_reverse + extends Modelica.Icons.Example; + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {70, 70}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaEmbedded.Boards.Arduino arduino1(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {78, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaEmbedded.Pins.Servo servo1(InputUnit = OpenModelicaEmbedded.Internal.Types.ServoUnit.None, MaxPulse = 1000000, MinPulse = 500000, Pin = 3) annotation( + Placement(visible = true, transformation(origin = {20, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Sources.Pulse pulse2(amplitude = 0.5, offset = 0.5, period = 2, startTime = 6, width = 50) annotation( + Placement(visible = true, transformation(origin = {-80, -60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Math.Product product1 annotation( + Placement(visible = true, transformation(origin = {-40, 1.77636e-15}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Sources.Constant const(k = 0.5) annotation( + Placement(visible = true, transformation(origin = {-80, 60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + equation + connect(const.y, product1.u1) annotation( + Line(points = {{-58, 60}, {-36, 60}, {-36, 24}, {-80, 24}, {-80, 10}, {-64, 10}, {-64, 12}}, color = {0, 0, 127})); + connect(pulse2.y, product1.u2) annotation( + Line(points = {{-58, -60}, {-48, -60}, {-48, -24}, {-80, -24}, {-80, -12}, {-64, -12}, {-64, -12}}, color = {0, 0, 127})); + connect(product1.y, servo1.u) annotation( + Line(points = {{-18, 0}, {0, 0}, {0, 0}, {0, 0}}, color = {0, 0, 127})); + connect(servo1.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{40, 0}, {78, 0}})); + annotation( + uses(Modelica_DeviceDrivers(version = "1.5.0"), OpenModelicaEmbedded(version = "1.2"), Modelica(version = "3.2.2"))); + end ex2_servo_reverse; + + model ex3_servo_loop + extends Modelica.Icons.Example; + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {70, 70}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + OpenModelicaEmbedded.Boards.Arduino arduino1(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {78, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaEmbedded.Pins.Servo servo1(InputUnit = OpenModelicaEmbedded.Internal.Types.ServoUnit.None, MaxPulse = 1000000, MinPulse = 500000, Pin = 23) annotation( + Placement(visible = true, transformation(origin = {20, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica.Blocks.Sources.Ramp ramp1(duration = 10, height = 10, startTime = 5) annotation( + Placement(visible = true, transformation(origin = {-90, -70}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Math.RealToInteger realToInteger1 annotation( + Placement(visible = true, transformation(origin = {-50, -70}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Sources.Constant const(k = 0.11) annotation( + Placement(visible = true, transformation(origin = {-70, 68}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Math.Product product1 annotation( + Placement(visible = true, transformation(origin = {-28, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Math.IntegerToReal integerToReal1 annotation( + Placement(visible = true, transformation(origin = {-10, -70}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + equation + connect(integerToReal1.y, product1.u2) annotation( + Line(points = {{2, -70}, {14, -70}, {14, -36}, {-56, -36}, {-56, -6}, {-40, -6}, {-40, -6}}, color = {0, 0, 127})); + connect(realToInteger1.y, integerToReal1.u) annotation( + Line(points = {{-38, -70}, {-22, -70}, {-22, -70}, {-22, -70}}, color = {255, 127, 0})); + connect(ramp1.y, realToInteger1.u) annotation( + Line(points = {{-78, -70}, {-62, -70}}, color = {0, 0, 127})); + connect(const.y, product1.u1) annotation( + Line(points = {{-58, 68}, {-52, 68}, {-52, 6}, {-40, 6}, {-40, 6}}, color = {0, 0, 127})); + connect(product1.y, servo1.u) annotation( + Line(points = {{-16, 0}, {0, 0}, {0, 0}, {0, 0}}, color = {0, 0, 127})); + connect(servo1.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{40, 0}, {78, 0}})); + annotation( + uses(Modelica_DeviceDrivers(version = "1.5.0"), OpenModelicaEmbedded(version = "1.2"), Modelica(version = "3.2.2"))); + end ex3_servo_loop; + + model ex4_servo_pot + extends Modelica.Icons.Example; + OpenModelicaEmbedded.Boards.Arduino arduino1(Port = "/dev/ttyACM0") annotation( + Placement(visible = true, transformation(origin = {60, 3.10862e-15}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaEmbedded.Pins.Servo servo1(InputUnit = OpenModelicaEmbedded.Internal.Types.ServoUnit.None, MaxPulse = 1000000, MinPulse = 500000, Pin = 9) annotation( + Placement(visible = true, transformation(origin = {-3.55271e-15, 3.55271e-15}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + OpenModelicaEmbedded.Pins.AnalogInput analogInput1(MaxValue = 1, MinValue = 0, Pin = 16) annotation( + Placement(visible = true, transformation(origin = {-60, 3.55271e-15}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation( + Placement(visible = true, transformation(origin = {-60, 60}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); + equation + connect(analogInput1.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{-80, 0}, {-92, 0}, {-92, -52}, {60, -52}, {60, 0}, {60, 0}})); + connect(servo1.pinConnector, arduino1.boardConnector) annotation( + Line(points = {{20, 0}, {62, 0}, {62, 0}, {60, 0}, {60, 0}})); + connect(analogInput1.y, servo1.u) annotation( + Line(points = {{-40, 0}, {-16, 0}, {-16, 0}, {-20, 0}}, color = {0, 0, 127})); + annotation( + uses(OpenModelicaEmbedded(version = "1.2"), Modelica_DeviceDrivers(version = "1.5.0"))); + end ex4_servo_pot; + end Servo_motor; + end ArduinoExamples; + + + annotation( + preferredView = "info", + Diagram(coordinateSystem(extent = {{-148.5, -105}, {148.5, 105}}, preserveAspectRatio = true, initialScale = 0.1, grid = {5, 5})), + Documentation(info = "ModelPlug is a library that allows you to connect your simulations with the real world. It uses an Arduino board (or compatible) to send analog and digital signals to physical devices and receive signals from them.
+ ++
With ModelPlug, you can combine simulation models and real hardware. For example, you can get data from your hardware, design a control, and test it in real time.
++ +
You can build a real control panel and use it to control your simulation models.
+ +ModelPlug provides the following components:
++ | Inputs | ++ |
Analog input | +Reads analog values from the pins | ++ |
Digital input | +Reads digital values from the pins | ++ |
+ | Output | ++ |
Analog output | +Writes analog values to the pins | ++ |
Digital output | +Writes digital values to the pins | ++ |
Servo control | +Writes the angle to servo motors | ++ |
+ | Board Handlers | ++ |
Arduino | +Connects to Arduino boards like Arduino Uno, Arduino Mega 2560 | ++ |
Arduino Leonardo | +Connects to Arduino Leonardo boards and boards using native USB | ++ |
StandardFirmata | +Connects to Arduino-compatible boards | ++ |
CustomFirmata | +Connects to any board supporting Firmata | ++ |
ModelPlug connects with the boards using USB serial communication. In order to configure, read, and write to the board, ModelPlug uses the Firmata protocol v2.3 (http://www.firmata.org). This protocol allows you to connect not only to Arduinos, but also to many boards compatible with Arduino. Examples of other boards supporting the Firmata protocol are:
+ModelPlug wraps the functionality of Firmata by providing easy-to-use Modelica models that you can connect in your simulations.
+ModelPlug requires a board with Firmata Version 2.3 or higher.
+Currently ModelPlug does not support sensors that communicate through I2C or SPI with the board.
+The minimum synchronization interval is 1 ms; therefore, ModelPlug cannot have a sampling interval smaller than that. The standard Firmata allows a minimum sampling interval of 10 ms.
ModelPlug uses a serial protocol; therefore, the transfer speed is constrained by the serial port speed. This can be problematic when reading or writing too many inputs/outputs with a small sampling interval.
Ask questions about SystemModeler and ModelPlug
+ +Find out how to connect sensors and actuators to the Arduino
+ +Get details about the Firmata protocol
+ +The breadboard diagrams were created using Fritzing
+ ++
+
", revisions = ""), + version = "1.2", + Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {5, 5}), graphics = {Rectangle(visible = true, fillColor = {190, 53, 19}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, -100}, {100, 100}}, radius = 25), Polygon(visible = true, origin = {-17.857, -4.643}, fillColor = {128, 128, 128}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{42.857, 59.643}, {42.857, 64.643}, {37.857, 69.643}, {32.857, 69.643}, {-17.143, 69.643}, {-42.143, 54.643}, {-57.143, 34.643}, {-65.22199999999999, 4.643}, {-57.143, -25.357}, {-42.143, -45.357}, {-17.143, -60.357}, {32.857, -60.357}, {37.857, -60.357}, {42.857, -55.357}, {42.857, -50.357}}, smooth = Smooth.Bezier), Polygon(visible = true, origin = {-17.857, -4.643}, fillColor = {255, 255, 255}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{42.857, 59.643}, {42.857, 64.643}, {37.857, 69.643}, {30.028, 54.643}, {-12.143, 59.643}, {-37.143, 44.643}, {-50.141, 26.339}, {-55.168, 4.643}, {-52.143, -20.357}, {-42.143, -42.453}, {-17.143, -60.357}, {32.857, -60.357}, {37.857, -60.357}, {42.857, -55.357}, {42.857, -50.357}}, smooth = Smooth.Bezier), Rectangle(visible = true, origin = {50, 27.5}, lineColor = {128, 128, 128}, fillColor = {255, 255, 255}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-25, -12.5}, {25, 12.5}}), Rectangle(visible = true, origin = {50, -27.5}, lineColor = {128, 128, 128}, fillColor = {255, 255, 255}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-25, -12.5}, {25, 12.5}}), Polygon(visible = true, origin = {-23.077, -0.385}, fillColor = {191, 191, 191}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{38.077, 50.385}, {38.077, 55.385}, {33.077, 55.385}, {-6.923, 55.385}, {-26.923, 45.385}, {-41.923, 30.385}, {-50.213, 0.385}, {-41.923, -29.615}, {-26.923, -44.615}, {-6.923, -54.615}, {33.077, -54.615}, {38.077, -54.615}, {38.077, -49.615}}, smooth = Smooth.Bezier), Polygon(visible = true, origin = {-17.857, -4.643}, lineColor = {128, 128, 128}, fillColor = {128, 128, 128}, points = {{42.857, 59.643}, {42.857, 64.643}, {37.857, 69.643}, {32.857, 69.643}, {-17.143, 69.643}, {-42.143, 54.643}, {-57.143, 34.643}, {-65.22199999999999, 4.643}, {-57.143, -25.357}, {-42.143, -45.357}, {-17.143, -60.357}, {32.857, -60.357}, {37.857, -60.357}, {42.857, -55.357}, {42.857, -50.357}}, smooth = Smooth.Bezier)}), + Diagram(coordinateSystem(extent = {{-148.5, -105}, {148.5, 105}}, preserveAspectRatio = true, initialScale = 0.1, grid = {5, 5})), + uses(Modelica_DeviceDrivers(version = "1.5.0"), Modelica(version = "3.2.2"))); +end OpenModelicaEmbedded; diff --git a/package.order b/package.order new file mode 100644 index 0000000..5c5caaf --- /dev/null +++ b/package.order @@ -0,0 +1,6 @@ +GettingStarted +Pins +Boards +Examples +Internal +ArduinoExamples -- cgit