<
From version < 4.1 >
edited by aas2
on 2016/05/18 23:47
To version < 7.1 >
edited by aas2
on 2017/08/11 15:21
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -10,6 +10,12 @@
10 10  
11 11  Arduino is a project and community wich creates open-source software and open-source hardware. The Arduino boards and software are well suited for novices and expierenced programmers alike to create digital devices. In the following we will see how to develop applications for the Arduino boards using SCCharts together with the [[Arduino Eclipse Plugin>>url:http://eclipse.baeyens.it/||shape="rect"]]. Therefore we will first download and setup the development environment and afterwards create and upload a small example project.
12 12  
13 +If you want to learn the SCCharts langugage first, you can follow these links:
14 +
15 +* [[Introduction to SCCharts>>doc:SCCharts]]
16 +* [[The Textual SCCharts Language SCT>>doc:Textual SCCharts Language SCT]]
17 +* [[SCCharts Examples>>doc:Examples]]
18 +
13 13  ----
14 14  
15 15  == Download and Configure KIELER
... ... @@ -50,10 +50,10 @@
50 50  {{code language="sct" theme="Eclipse" title="Floodlight.sct"}}
51 51  scchart BlinkyModel {
52 52  
53 - @Wrapper Clock, "500"
59 + @Wrapper Clock, 500
54 54   input bool clock;
55 55  
56 - @Wrapper DigitalWrite, "13"
62 + @Wrapper DigitalWrite, 13
57 57   output bool light;
58 58  
59 59   initial state lightOff
... ... @@ -68,23 +68,24 @@
68 68  
69 69  The annotations on the input and output variable are used to define which wrapper code is used to set / read them. **@Wrapper Clock, "500"** will set the input variable to true for one tick every 500ms. **@Wrapper DigitalWrite, "13"** will set pin 13 to HIGH if the variable is true and to LOW if it is false. We assume that an **LED is connected** to the Arduino board on **pin 13**.
70 70  
71 -The available wrapper code snippets are defined in the //snippets// directory of the project in ftl files (FreeMarker template files). The table below gives an overview of the available wrapper code snippets.
77 +The available wrapper code snippets are defined in the //assets// directory of the project in ftl files (FreeMarker template files). In the default configuration of a new SCCharts project for Arduino, the file //main.ftl// is processed to create the entry point of the program. Thus it includes other templates containing the available code snippets. The table below gives an overview of the available wrapper code snippets.
72 72  
73 -**Note: **To view ftl files with highlighting, you may want to install the //FreeMarker IDE// feature from the JBoss Tools. However, this is not necessary to work with KIELER. JBoss Tools is available in the Eclipse Market Place and via update site. The update site for Eclipse Luna is [[http:~~/~~/download.jboss.org/jbosstools/updates/stable/luna/>>url:http://download.jboss.org/jbosstools/updates/stable/luna/||shape="rect"]] . Note that only the //FreeMarker IDE// feature is required (Abridged JBoss Tools > FreeMarker IDE).**
79 +**Note: **To view ftl files with highlighting, you may want to install the //FreeMarker IDE// feature from the JBoss Tools. However, this is not necessary to work with KIELER. JBoss Tools is available in the Eclipse Market Place and via update site. The update site for stable releases is [[http:~~/~~/download.jboss.org/jbosstools/neon/stable/updates/ >>url:http://download.jboss.org/jbosstools/neon/stable/updates/||rel="nofollow" shape="rect" class="external-link"]]. Note that only the //FreeMarker IDE// feature is required (Abridged JBoss Tools > FreeMarker IDE).**
74 74  **
75 75  
76 -=== Launch the project: ===
82 +=== Build the project: ===
77 77  
78 -With the mouse over the SCT file in the project explorer, perform //Right Click > Run As > KiCo Compilation.//
84 +After the modeling is done, the project can be built. Select //Project > Build Project//. This will create a new folder //kieler-gen// with the compiled model file. Further the wrapper code is processed. After the build finished sucessfully, the ino file for the project has been updated with the new wrapper code for the model, and thus the project can be deployed to the Arduino board. The Eclipse Arduino Plugin provides an upload button for this task in the toolbar.
79 79  
80 -A launch config is created, which compiles the model to C code and creates wrapper code from the annotations in the model file. Afterwards this output is compiled and deployed to the Arduino board, by using the launch shortcut from the Arduino Plugin. If any errors occur, you can see them in the Console View.
86 +=== Simulating the model ===
81 81  
82 -For a deeper understanding of the project launch and initialization, take a look at the [[wiki page for Prom>>url:http://rtsys.informatik.uni-kiel.de/confluence/pages/viewpage.action?pageId=13762626||shape="rect"]].
88 +A simulation of models is created as part of a build inside //kieler-gen/sim/bin//. To use these simulations, first change to the Simulation Perspective, which provides new buttons in the toolbar. The executables in the //bin// folder can then be launched via //Right Click > KIELER Simulation//. The output of a running simulation can be seen in the Data Pool View.
83 83  
84 84  === Available Wrapper Code Snippets ===
85 85  
86 86  There are several wrapper code snippets that can be used as annotations on input and output variables in the model file. These snippets are inserted in the main file template as part of the project launch. The available snippets are listed below.
87 87  
94 +(% class="wrapped" %)
88 88  |=(((
89 89  Snippet Name and Parameters
90 90  )))|=(((
... ... @@ -154,7 +154,7 @@
154 154  unsigned
155 155  )))|(% colspan="1" %)(% colspan="1" %)
156 156  (((
157 -
164 +\\
158 158  )))|(% colspan="1" %)(% colspan="1" %)
159 159  (((
160 160  timing.ftl
... ... @@ -195,7 +195,7 @@
195 195  unsigned
196 196  )))|(% colspan="1" %)(% colspan="1" %)
197 197  (((
198 -
205 +\\
199 199  )))|(% colspan="1" %)(% colspan="1" %)
200 200  (((
201 201  timing.ftl
... ... @@ -215,7 +215,7 @@
215 215  unsigned
216 216  )))|(% colspan="1" %)(% colspan="1" %)
217 217  (((
218 -
225 +\\
219 219  )))|(% colspan="1" %)(% colspan="1" %)
220 220  (((
221 221  print.ftl
... ... @@ -234,7 +234,7 @@
234 234  string
235 235  )))|(% colspan="1" %)(% colspan="1" %)
236 236  (((
237 -
244 +\\
238 238  )))|(% colspan="1" %)(% colspan="1" %)
239 239  (((
240 240  print.ftl
... ... @@ -248,7 +248,7 @@
248 248  )))|(((
249 249  bool
250 250  )))|(((
251 -
258 +\\
252 252  )))|(((
253 253  read_and_write.ftl
254 254  )))
... ... @@ -261,7 +261,7 @@
261 261  )))|(((
262 262  bool
263 263  )))|(((
264 -
271 +\\
265 265  )))|(((
266 266  read_and_write.ftl
267 267  )))
... ... @@ -274,7 +274,7 @@
274 274  )))|(((
275 275  int
276 276  )))|(((
277 -
284 +\\
278 278  )))|(((
279 279  read_and_write.ftl
280 280  )))
... ... @@ -292,7 +292,7 @@
292 292  int
293 293  )))|(% colspan="1" %)(% colspan="1" %)
294 294  (((
295 -
302 +\\
296 296  )))|(% colspan="1" %)(% colspan="1" %)
297 297  (((
298 298  read_and_write.ftl
... ... @@ -316,6 +316,7 @@
316 316  
317 317  The following presents typical issues and how to solve them.
318 318  
326 +(% class="wrapped" %)
319 319  |=(((
320 320  Issue
321 321  )))|=(((
Confluence.Code.ConfluencePageClass[0]
Id
... ... @@ -1,1 +1,1 @@
1 -18776103
1 +32145474
URL
... ... @@ -1,1 +1,1 @@
1 -https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/18776103/Arduino and SCCharts
1 +https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/32145474/Arduino and SCCharts