@@ -10,114 +10,120 @@ Please refer to the companion webiste to this project at:
10
10
https://www.state-machine.com/arduino
11
11
12
12
----
13
- # Software Installation
13
+ # Provided Library and Examples
14
14
15
- The QP adaptation for Arduino is distributed in a single ZIP
16
- archive ` qp-<ver>_arduino-1.8.x.zip ` , where ` <ver> ` stands for
17
- the version of the QP frameworks.
15
+ This repository contains one external library for ARM Cortex-M based Arduinos:
18
16
19
- You need to unzip the ` qp-<ver>_arduino-1.8.x.zip ` archive into your
20
- Arduino ` <Sketchbook> ` folder. To find out where your ` <Sketchbook> ` folder
21
- is, or to configure a different location for your ` <Sketchbook> ` folder,
22
- you need to open the Arduino IDE and select ` File|Preferences ` menu.
23
- The Sketchbook location will be shown at the top of the Preferences
24
- dialog box. Once you identify the ` <Sketchbook> ` folder, you simply unzip
25
- the whole ` qp-<ver>_arduino-1.8.x.zip ` archive to this folder.
17
+ - ` qp-arduino ` -- QP/C++ framework for Arduinos based on ARM Cortex-M
26
18
27
19
----
28
- # Provided Libraries and Examples
20
+ # Software Installation
29
21
30
- The archive ` qp-<ver>_arduino-1.8.x.zip ` contains two external libraries
31
- for SAM-based Arduinos:
22
+ The QP adaptation for Arduino may be used either with the [ Arduino
23
+ IDE] ( https://www.arduino.cc/en/software ) or with
24
+ [ PlatformIO] ( https://platformio.org/install/cli ) .
32
25
33
- - ` qpcpp_arm-cm ` -- QP/C++ framework for Arduinos based on ARM Cortex-M
34
- - ` qpn_avr ` -- QP-nano framework for Arduinos based on AVR
26
+ ## Download Library
35
27
36
- > ** NOTE:** ` qpn_avr ` is now obsolete. It is provided for backwards compatibility only!
28
+ The QP adaptation for Arduino can be downloaded in a single zip archive or
29
+ cloned to a local git repository.
37
30
38
- ----
39
- # Provided Tools
31
+ ### Zip File
40
32
41
- The archive also contains the QM modeling tool for Windows
33
+ https://github.com/QuantumLeaps/qp-arduino/ archive/refs/heads/master.zip
42
34
43
- - ` qm ` -- QM modeling tool for Windows 32/64-bit
35
+ ### Git
44
36
45
- ----
46
- # Directories and Files
37
+ ``` bash
38
+ git clone https://github.com/QuantumLeaps/qp-arduino.git
39
+ ```
40
+
41
+ ## Arduino IDE
42
+
43
+ You need to unzip the zip archive, or clone the git repository, into your
44
+ Arduino ` <Sketchbook> ` folder. To find out where your ` <Sketchbook> ` folder is,
45
+ or to configure a different location for your ` <Sketchbook> ` folder, you need to
46
+ open the Arduino IDE and select ` File|Preferences ` menu. The Sketchbook location
47
+ will be shown at the top of the Preferences dialog box. Once you identify the
48
+ ` <Sketchbook> ` folder, you simply unzip the whole zip archive, or clone the git
49
+ repository, to this folder, renaming the folder qp-arduino if necessary.
47
50
48
51
After the installation, your Arduino ` <Sketchbook> ` folder should look
49
52
as follows:
50
53
51
- <Sketchbook>/ - your Arduino Sketchbook folder
52
- ├───libraries/ - libraries folder
53
- │ ├───qpcpp_arm-cm/ - QP/C++ library for ARM Cortex-M based boards
54
- │ │ ├───examples/ - QP/C++ library examples
55
- │ │ │ ├───blinky-sam/ - Blinky example for SAM-Arduinos
56
- │ │ │ │ ├───blinky-sam.ino - Blinky code (generated by QM)
57
- │ │ │ │ └───blinky-sam.qm - Blinky model (for QM)
58
- │ │ │ ├───blinky2-sam/ - Blinky2 example for SAM-Arduinos
59
- │ │ │ │ ├───blinky2-sam.ino - Blinky2 code (generated by QM)
60
- │ │ │ │ └───blinky2-sam.qm - Blinky2 model (for QM)
61
- │ │ │ ├───blinky_bsp-sam/ - Blinky example with BSP for SAM
62
- │ │ │ │ ├───blinky_bsp-sam.ino - Blinky-BSP code (generated by QM)
63
- │ │ │ │ ├───blinky_bsp-sam.qm - Blinky-BSP model (for QM)
64
- │ │ │ │ ├───bsp.hpp - BSP header (generated by QM)
65
- │ │ │ │ └───bsp.cpp - BSP source (generated by QM)
66
- │ │ │ ├───blinky_bsp-teensy4/ - Blinky example with BSP for Teensy4
67
- │ │ │ │ ├───blinky_bsp-teensy4.ino - Blinky-BSP code (generated by QM)
68
- │ │ │ │ ├───blinky_bsp-teensy4.qm - Blinky-BSP model (for QM)
69
- │ │ │ │ ├───bsp.hpp - BSP header (generated by QM)
70
- │ │ │ │ └───bsp.cpp - BSP source (generated by QM)
71
- │ │ │ └───dpp_bsp-sam/ - DPP example with BSP for SAM
72
- │ │ │ ├───qview/ - DPP with QView demonstration
73
- │ │ │ ├───dpp_bsp-teensy4.ino - DPP-BSP code (generated by QM)
74
- │ │ │ ├───dpp_bsp-teensy4.qm - DPP-BSP model (for QM)
75
- │ │ │ ├───bsp.hpp - BSP header (generated by QM)
76
- │ │ │ └───bsp.cpp - BSP source (generated by QM)
77
- │ │ └───src/ - QP/C++ library source
78
- │ │
79
- │ └───qpn_avr/ - QP-nano library for AVR-based Arduinos
80
- │ ├───examples/ - QP-nano library examples
81
- │ │ ├───blinky/
82
- │ │ ├───blinky_bsp/
83
- │ │ ├───dpp/
84
- │ │ └───pelican/
85
- │ └───src/
86
- ├───qm/ - QM modeling tool
87
- │ ├───bin/ - QM binaries (executable and DLLs)
88
- │ │ └───qm.exe - QM executable for Windows
89
- │ └───html/ - QM documentation
90
- │ └───index.html
91
- │
92
- ├───QP-Arduino_GPL_Exception.txt - GPL exception for QP on Arduino
93
- └───README.md - this file
94
-
95
-
96
- > ** NOTE:** The QP-Arduino archive contains QM for Windows only. But QM is also
97
- available for Linux and MacOS hosts. If you wish to work on those operating
98
- systems, you will need to install QM separately, as described at:
99
- https://www.state-machine.com/qm/gs.html
54
+ ```
55
+ <Sketchbook>/
56
+ └── libraries
57
+ └── qp-arduino
58
+ ├── examples
59
+ │ ├── blinky-sam
60
+ │ ├── blinky2-sam
61
+ │ ├── blinky_bsp-sam
62
+ │ ├── blinky_bsp-teensy4
63
+ │ ├── dpp_bsp-sam
64
+ │ └── dpp_bsp-teensy4
65
+ └── src
66
+ └── qp-arduino
67
+ ```
68
+
69
+ ## PlatformIO
70
+
71
+ Unzip the zip archive or clone the git repository into any folder you prefer.
72
+
73
+ ----
74
+ # Additional Tools
100
75
76
+ The QM modeling tool may be downloaded and installed from:
77
+
78
+ https://www.state-machine.com/products/qm
101
79
102
80
----
103
81
# Working with the Examples
104
82
83
+ The intended way of working with the examples is to use the
84
+ [ QM modeling tool] ( https://www.state-machine.com/products/qm/ ) to modify
85
+ the ** models** (` .qm ` files) and then to ** generate code** from these
86
+ models.
87
+
88
+ In this scenario, the Arduino IDE or PlatformIO are used only to build and
89
+ upload the code to the Arduino board(s).
90
+
91
+ ## Arduino IDE
92
+
105
93
Assumming that you have installed the QP library in your ` <Sketchbook> `
106
94
folder, the examples provided in each QP library show up in the Arduino
107
95
IDE under the menu:
108
96
109
97
` File|Examples|Examples from Custom Libraries `
110
98
111
- The intended way of working with the examples is to use the
112
- [ QM modeling tool] ( https://www.state-machine.com/products/qm/ ) to modify
113
- the ** models** (` .qm ` files) and then to ** generate code** from these
114
- models. In this scenario, the Arduino IDE is used only to build and
115
- upload the code to the Arduino board(s).
116
-
117
99
> ** NOTE:** The preferences in the Arduino IDE should be set up to
118
100
** Use external editor** so that the IDE will update the code each time
119
101
it is re-generated by the QM modeling tool.
120
102
103
+ The Arduino IDE serial monitor may be used to observe the output of the dpp
104
+ examples.
105
+
106
+ ## PlatformIO
107
+
108
+ PlatformIO may be used either with its IDE or on the command line.
109
+
110
+ ### Command Line
111
+
112
+ Navigate inside the qp-arduino directory where the platformio.ini file is contained.
113
+
114
+ Modify the platformio.ini file to compile the example that you prefer.
115
+
116
+ Compile and upload the example with a command like this:
117
+
118
+ ``` bash
119
+ pio run -e teensy41 -t upload
120
+ ```
121
+
122
+ To use the serial monitor to observe the output of the dpp examples run:
123
+
124
+ ``` bash
125
+ pio device monitor
126
+ ```
121
127
122
128
----
123
129
## Example Documentation
0 commit comments