<
From version < 2.1 >
edited by aas2
on 2016/05/09 11:16
To version < 3.1 >
edited by aas2
on 2016/05/09 13:01
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -8,10 +8,8 @@
8 8  
9 9  == Overview ==
10 10  
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"]].
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 -Several open-source, third-party replacements for the offical Lego firmware have been developed. These support many well known programming languages, such as Java, C/C++, Python, Lua, etc. In the following we will use KIELER SCCharts to program Mindstorms running the Lego Java Operating System ([[leJOS>>url:http://www.lejos.org/||shape="rect"]]). Therefore we will first install leJOS NXJ and flash its firmware. Afterwards we will create a simple SCCharts project in KIELER that we will compile and deploy to the NXT brick.\\
14 -
15 15  ----
16 16  
17 17  == Download and Configure KIELER
... ... @@ -21,35 +21,28 @@
21 21  
22 22  **Note:** Java 1.8 is needed on all operating systems. With Java 1.7 not all plugins of KIELER will be loaded. **Furthermore on Windows**, you will need to download the **32 Bit version of KIELER** – even if you have a 64 bit operating system! Otherwise flashing the brick and uploading to the brick will fail.
23 23  
24 -=== The Eclipse plugin for leJOS ===
22 +=== The Arduino Eclipse Plugin ===
25 25  
26 -There is an Eclipse plugin for leJOS which adds a project creation wizard and launch configuration to the platform.
24 +There is an Eclipse plugin for Arduino, which makes it easy to create and deploy projects and to use the IDE features of the C/C++ Development Tools (CDT) when programming Arduino.
27 27  
28 -1. You have to install it via the Eclipse Marketplace (//Help > Eclipse Marketplace...//).
29 -OR
30 -1. Install the plugin manually (Help > Install new Software...). Use the following update site\\
31 -11. for NXT: [[http:~~/~~/www.lejos.org/tools/eclipse/plugin/nxj/>>url:http://www.lejos.org/tools/eclipse/plugin/nxj/||shape="rect"]]
32 -11. for EV3: [[http:~~/~~/www.lejos.org/tools/eclipse/plugin/ev3/>>url:http://www.lejos.org/tools/eclipse/plugin/ev3/||shape="rect"]]
26 +You have to install the plugin manually via **Help > Install new Software... **. Use the following update site: [[http:~~/~~/eclipse.baeyens.it/nightly>>url:http://eclipse.baeyens.it/nightly||shape="rect"]]
33 33  
34 -If you have an **NXT** **brick**, install the **leJOS NXJ** Plug-in. If you have an **EV3 brick**, install the **leJOS EV3** plugin.
28 +The installation might take a few minutes because it will install the Arduino Tools as well as required software such as the CDT. Furthermore it will download the newest version of the Arduino software and libraries.
35 35  
36 -[[image:attach:lejos_eclipse_plugin.png]]
37 -
38 -After the installation, the plugin requires a **little configuration**. Go to //Window > Preferences > leJOS NXJ// (//Window > Preferences > leJOS EV3 //respectively) and enter the base directory of your **leJOS** **installation** in the **NXJ_HOME field**.
39 -
40 -For EV3, the plugin requires the IP address to connect to the brick (it may work without, but its safer to directly set the name. Reduces headache ). Check **Connect to named brick** and enter the **IP adress** of the brick (displayed on the brick at startup).
41 -
42 42  ----
43 43  
44 44  == Creating an Example Project ==
45 45  
46 -The following shows how to create a project, which will turn on a light if a button is pressed.
34 +The following shows how to create a project, which will turn an LED on and off repeatedly.
47 47  
48 48  === Create a new project: ===
49 49  
50 50  1. Choose //File > New > Project > KIELER SCCharts > SCCharts Project//
51 -1. In the project creation wizard that opens, select //Mindstorms NXJ// or// Mindstorms EV3// (depending on your brick) as environment and hit //finish//
52 -1. The project wizard from the leJOS plugin opens. Set the project name to //Flashlight// and click //finish//.
39 +1. In the project creation wizard that opens, select //Arduino// as environment and hit //finish//
40 +1. The project wizard from the Arduino Eclipse Plugin opens. Set the project name to //Blinky// and click //next//.
41 +1. Set the configuration for your Arduino board. In the field //Upload Protocol// select //Default//.
42 +These settings can be changed later in the project preferences (Right click on project > Preferences > Arduino)
43 +1. Click //finish//.
53 53  1. The project is created and the model file is opened in an editor (This might take a few seconds).
54 54  
55 55  === Edit the model: ===
... ... @@ -57,30 +57,28 @@
57 57  Change the contents of the model file to the following code and save it.
58 58  
59 59  {{code language="sct" theme="Eclipse" title="Floodlight.sct"}}
60 -scchart Flashlight {
51 +scchart BlinkyModel {
61 61  
62 - @Wrapper TouchSensor, S4
63 - input bool button;
53 + @Wrapper Clock, "500"
54 + input bool clock;
64 64  
65 - @Wrapper Floodlight, S1
56 + @Wrapper DigitalWrite, "13"
66 66   output bool light;
67 67  
68 68   initial state lightOff
69 - --> lightOn with button / light = true;
60 + --> lightOn with clock / light = true;
70 70  
71 71   state lightOn
72 - --> lightOff with !button / light = false;
63 + --> lightOff with clock / light = false;
73 73  }
74 74  {{/code}}
75 75  
76 -This model will start in the state lightOff. If the button is pressed, it will turn on the light and change to the corresponding state, where the light is turned off, as soon as the button is not pressed anymore.
67 +This model will start in the state lightOff. If the variable //clock// is true, it will switch its state, going from off to on and from on to off. Thereby it sets the light variable so that the led will blink.
77 77  
78 -The annotations on the input and output variable are used to define which wrapper code is used to set / read them. **@Wrapper TouchSensor, S4** will set the input variable to true iff the touch sensor on the port S4 is pressed. **@Wrapper Floodlight, S1** on the output variable will turn on the red led of the light sensor that is attatched to port S1 iff the variable is true.
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**.
79 79  
80 80  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.
81 81  
82 -**Note:** The Floodlight of the EV3 has a pretty high latency when switching between on and off.
83 -
84 84  **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).**
85 85  **
86 86  
... ... @@ -88,7 +88,7 @@
88 88  
89 89  With the mouse over the SCT file in the project explorer, perform //Right Click > Run As > KiCo Compilation.//
90 90  
91 -A launch config is created, which compiles the model to Java code and creates wrapper code from the annotations in the model file. Afterwards this output is compiled and deployed to the Mindstorms brick, by using the launch shortcut from the leJOS plugin. If any errors occur, you can see them in the Console View.
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.
92 92  
93 93  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"]].
94 94  
... ... @@ -96,10 +96,6 @@
96 96  
97 97  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.
98 98  
99 -For sensors, the port has to be on of S1, S2, S3, S4.
100 -
101 -For motors / actuators the port has to be one of A, B, C, D.
102 -
103 103  |=(((
104 104  Snippet Name and Parameters
105 105  )))|=(((
... ... @@ -120,7 +120,7 @@
120 120  **Clock,** milliseconds
121 121  )))|(% colspan="1" %)(% colspan="1" %)
122 122  (((
123 -Sets a variable to true if the time in milliseconds passed
108 +Sets a variable to true if the time in milliseconds passed.
124 124  )))|(% colspan="1" %)(% colspan="1" %)
125 125  (((
126 126  input
... ... @@ -160,13 +160,13 @@
160 160  **Time**
161 161  )))|(% colspan="1" %)(% colspan="1" %)
162 162  (((
163 -Reads the elapsed time since program start
148 +Reads the elapsed time since program start in milliseconds.
164 164  )))|(% colspan="1" %)(% colspan="1" %)
165 165  (((
166 166  input
167 167  )))|(% colspan="1" %)(% colspan="1" %)
168 168  (((
169 -int
154 +unsigned
170 170  )))|(% colspan="1" %)(% colspan="1" %)
171 171  (((
172 172  
... ... @@ -187,10 +187,10 @@
187 187  input
188 188  )))|(% colspan="1" %)(% colspan="1" %)
189 189  (((
190 -int
175 +unsigned
191 191  )))|(% colspan="1" %)(% colspan="1" %)
192 192  (((
193 -Should be used on the very first input variable in the model, such that waiting is the last action in the tick loop.
178 +Should be used on the very first input variable in the model, so that waiting is the last action in the tick loop.
194 194  )))|(% colspan="1" %)(% colspan="1" %)
195 195  (((
196 196  timing.ftl
... ... @@ -197,16 +197,17 @@
197 197  )))
198 198  |(% colspan="1" %)(% colspan="1" %)
199 199  (((
200 -**Sleep**
185 +**Delay
186 +**
201 201  )))|(% colspan="1" %)(% colspan="1" %)
202 202  (((
203 -Lets the current thread sleep the time in milliseconds of the variable value.
189 +Lets the program delay the time in milliseconds of the variable value.
204 204  )))|(% colspan="1" %)(% colspan="1" %)
205 205  (((
206 206  output
207 207  )))|(% colspan="1" %)(% colspan="1" %)
208 208  (((
209 -int
195 +unsigned
210 210  )))|(% colspan="1" %)(% colspan="1" %)
211 211  (((
212 212  
... ... @@ -216,19 +216,20 @@
216 216  )))
217 217  |(% colspan="1" %)(% colspan="1" %)
218 218  (((
219 -**Print,** autoReset
205 +**SerialRate,** baud**
206 +**
220 220  )))|(% colspan="1" %)(% colspan="1" %)
221 221  (((
222 -Prints a string variable if the string is not empty. If autoReset is true then the string variable is set to the empty string after it has been printed
209 +Sets the baud rate for communication. This is done only in the initilization, not in the loop.
223 223  )))|(% colspan="1" %)(% colspan="1" %)
224 224  (((
225 225  output
226 226  )))|(% colspan="1" %)(% colspan="1" %)
227 227  (((
228 -string
215 +unsigned
229 229  )))|(% colspan="1" %)(% colspan="1" %)
230 230  (((
231 -autoReset is true per default.
218 +
232 232  )))|(% colspan="1" %)(% colspan="1" %)
233 233  (((
234 234  print.ftl
... ... @@ -235,10 +235,10 @@
235 235  )))
236 236  |(% colspan="1" %)(% colspan="1" %)
237 237  (((
238 -**DrawString,** x, y
225 +**Print**
239 239  )))|(% colspan="1" %)(% colspan="1" %)
240 240  (((
241 -Prints a string to the given x and y coordinate on the LCD.
228 +Prints a string variable if the string is not 0.
242 242  )))|(% colspan="1" %)(% colspan="1" %)
243 243  (((
244 244  output
... ... @@ -252,252 +252,53 @@
252 252  (((
253 253  print.ftl
254 254  )))
255 -|(% colspan="1" %)(% colspan="1" %)
256 -(((
257 -**Button, **buttonId
258 -)))|(% colspan="1" %)(% colspan="1" %)
259 -(((
260 -Sets a variable to true iff the button on the Mindstorms device is pressed.
261 -)))|(% colspan="1" %)(% colspan="1" %)
262 -(((
263 -input
264 -)))|(% colspan="1" %)(% colspan="1" %)
265 -(((
266 -bool
267 -)))|(% colspan="1" %)(% colspan="1" %)
268 -(((
269 -The buttonId has to be one of ENTER, LEFT, RIGHT
270 -)))|(% colspan="1" %)(% colspan="1" %)
271 -(((
272 -touch_and_buttons.ftl
273 -)))
274 -|(% colspan="1" %)(% colspan="1" %)
275 -(((
276 -**TouchSensor**, port
277 -)))|(% colspan="1" %)(% colspan="1" %)
278 -(((
279 -Sets a variable to true iff the touch sensor on the given port is pressed.
280 -)))|(% colspan="1" %)(% colspan="1" %)
281 -(((
282 -input
283 -)))|(% colspan="1" %)(% colspan="1" %)
284 -(((
285 -bool
286 -)))|(% colspan="1" %)(% colspan="1" %)
287 -(((
288 -
289 -)))|(% colspan="1" %)(% colspan="1" %)
290 -(((
291 -touch_and_buttons.ftl
292 -)))
293 -|(% colspan="1" %)(% colspan="1" %)
294 -(((
295 -**LightSensor,** port, percentValue
296 -)))|(% colspan="1" %)(% colspan="1" %)
297 -(((
298 -Reads  the value of a light sensor.
299 -
300 -If percentValue is true, the a percent value is retured, based on the light sensor calibration.
301 -)))|(% colspan="1" %)(% colspan="1" %)
302 -(((
303 -input
304 -)))|(% colspan="1" %)(% colspan="1" %)
305 -(((
306 -int
307 -)))|(% colspan="1" %)(% colspan="1" %)
308 -(((
309 -percentValue is not available on EV3
310 -)))|(% colspan="1" %)(% colspan="1" %)
311 -(((
312 -light.ftl
313 -)))
314 -|(% colspan="1" %)(% colspan="1" %)
315 -(((
316 -**CalibrateLightSensor,** port, signal
317 -)))|(% colspan="1" %)(% colspan="1" %)
318 -(((
319 -Calibrates a light sensors high or low values. This means if the variable is true, the current value of the light sensor is taken as its reference high / low value.
320 -)))|(% colspan="1" %)(% colspan="1" %)
321 -(((
242 +|(((
243 +**DigitalWrite,** pin
244 +)))|(((
245 +Sets the pin value to HIGH if the variable is true and to LOW otherwise.
246 +)))|(((
322 322  output
323 -)))|(% colspan="1" %)(% colspan="1" %)
324 -(((
248 +)))|(((
325 325  bool
326 -)))|(% colspan="1" %)(% colspan="1" %)
327 -(((
328 -signal has to be one of High, Low
329 -)))|(% colspan="1" %)(% colspan="1" %)
330 -(((
331 -light.ftl
332 -)))
333 -|(% colspan="1" %)(% colspan="1" %)
334 -(((
335 -**Floodlight,** port
336 -)))|(% colspan="1" %)(% colspan="1" %)
337 -(((
338 -Reads / Sets the state of the red lamp of the light sensor.
339 -)))|(% colspan="1" %)(% colspan="1" %)
340 -(((
341 -input
342 -
343 -output
344 -)))|(% colspan="1" %)(% colspan="1" %)
345 -(((
346 -bool
347 -)))|(% colspan="1" %)(% colspan="1" %)
348 -(((
250 +)))|(((
349 349  
350 -)))|(% colspan="1" %)(% colspan="1" %)
351 -(((
352 -light.ftl
252 +)))|(((
253 +read_and_write.ftl
353 353  )))
354 -|(% colspan="1" %)(% colspan="1" %)
355 -(((
356 -**RCXLamp,** port
357 -)))|(% colspan="1" %)(% colspan="1" %)
358 -(((
359 -Turns an RCX lamp on (variable is true) or off (variable is false)
360 -)))|(% colspan="1" %)(% colspan="1" %)
361 -(((
362 -output
363 -)))|(% colspan="1" %)(% colspan="1" %)
364 -(((
365 -bool
366 -)))|(% colspan="1" %)(% colspan="1" %)
367 -(((
368 -
369 -)))|(% colspan="1" %)(% colspan="1" %)
370 -(((
371 -light.ftl
372 -)))
373 -|(% colspan="1" %)(% colspan="1" %)
374 -(((
375 -**MotorSpeed,** port, brake
376 -)))|(% colspan="1" %)(% colspan="1" %)
377 -(((
378 -Reads / Sets the speed of the motor in degrees per minute. If the speed value is negative, the motor will drive backwards. If the speed is zero, the motor will actively brake until it stops (brake is true) or remove all power and rollout (brake is false).
379 -)))|(% colspan="1" %)(% colspan="1" %)
380 -(((
255 +|(((
256 +**DigitalRead,** pin
257 +)))|(((
258 +Sets the variable value to the pin state (HIGH or LOW).
259 +)))|(((
381 381  input
382 -
383 -output
384 -)))|(% colspan="1" %)(% colspan="1" %)
385 -(((
386 -int
387 -)))|(% colspan="1" %)(% colspan="1" %)
388 -(((
389 -brake is true per default.
390 -)))|(% colspan="1" %)(% colspan="1" %)
391 -(((
392 -motor.ftl
393 -)))
394 -|(% colspan="1" %)(% colspan="1" %)
395 -(((
396 -**MotorIsMoving,** port
397 -)))|(% colspan="1" %)(% colspan="1" %)
398 -(((
399 -Sets a variable to true iff the motor on the given port is moving.
400 -)))|(% colspan="1" %)(% colspan="1" %)
401 -(((
402 -input
403 -)))|(% colspan="1" %)(% colspan="1" %)
404 -(((
261 +)))|(((
405 405  bool
406 -)))|(% colspan="1" %)(% colspan="1" %)
407 -(((
263 +)))|(((
408 408  
409 -)))|(% colspan="1" %)(% colspan="1" %)
410 -(((
411 -motor.ftl
265 +)))|(((
266 +read_and_write.ftl
412 412  )))
413 -|(% colspan="1" %)(% colspan="1" %)
414 -(((
415 -**MotorRotation,** port
416 -)))|(% colspan="1" %)(% colspan="1" %)
417 -(((
418 -Lets a motor rotate the variable value in degrees. This is only done if the value is unequal zero. If the value is negative, the motor rotates backwards. The variable is set to zero afterwards, such that setting the variable once to a value //X//, will let the motor rotate //X// degrees.
419 -)))|(% colspan="1" %)(% colspan="1" %)
420 -(((
268 +|(((
269 +**Analog**Write, pin
270 +)))|(((
271 +Sets the voltage of the given analog IO pin via pulse-width modulation (PWM). Integers from 0 to 1023 are linearly mapped to an pseudo voltage from 0V to 5V.
272 +)))|(((
421 421  output
422 -)))|(% colspan="1" %)(% colspan="1" %)
423 -(((
274 +)))|(((
424 424  int
425 -)))|(% colspan="1" %)(% colspan="1" %)
426 -(((
276 +)))|(((
427 427  
428 -)))|(% colspan="1" %)(% colspan="1" %)
429 -(((
430 -motor.ftl
278 +)))|(((
279 +read_and_write.ftl
431 431  )))
432 432  |(% colspan="1" %)(% colspan="1" %)
433 433  (((
434 -**Beep,** volume
283 +**AnalogRead,** pin
435 435  )))|(% colspan="1" %)(% colspan="1" %)
436 436  (((
437 -Plays a beep sound as long as the variable is true.
286 +Reads the value of the given analog IO pin. Voltage from 0V to 5V is linearly mapped to an integer value from 0 to 1023.
438 438  )))|(% colspan="1" %)(% colspan="1" %)
439 439  (((
440 -output
441 -)))|(% colspan="1" %)(% colspan="1" %)
442 -(((
443 -bool
444 -)))|(% colspan="1" %)(% colspan="1" %)
445 -(((
446 -default volume is 10
447 -)))|(% colspan="1" %)(% colspan="1" %)
448 -(((
449 -sound.ftl
450 -)))
451 -|(% colspan="1" %)(% colspan="1" %)
452 -(((
453 -**Buzz,** volume
454 -)))|(% colspan="1" %)(% colspan="1" %)
455 -(((
456 -Plays a buzz sound as long as the variable is true.
457 -)))|(% colspan="1" %)(% colspan="1" %)
458 -(((
459 -output
460 -)))|(% colspan="1" %)(% colspan="1" %)
461 -(((
462 -bool
463 -)))|(% colspan="1" %)(% colspan="1" %)
464 -(((
465 -default volume is 10
466 -)))|(% colspan="1" %)(% colspan="1" %)
467 -(((
468 -sound.ftl
469 -)))
470 -|(% colspan="1" %)(% colspan="1" %)
471 -(((
472 -**BeepSequence,** direction, volume
473 -)))|(% colspan="1" %)(% colspan="1" %)
474 -(((
475 -Plays a sequence of tones in either ascending or descending tone frequency if the variable is true.
476 -
477 -The variable is set to false automatically.
478 -)))|(% colspan="1" %)(% colspan="1" %)
479 -(((
480 -output
481 -)))|(% colspan="1" %)(% colspan="1" %)
482 -(((
483 -bool
484 -)))|(% colspan="1" %)(% colspan="1" %)
485 -(((
486 -direction has to be one of Up, Down
487 -
488 -default volume is 10
489 -)))|(% colspan="1" %)(% colspan="1" %)
490 -(((
491 -sound.ftl
492 -)))
493 -|(% colspan="1" %)(% colspan="1" %)
494 -(((
495 -**UltrasonicSensor,** port
496 -)))|(% colspan="1" %)(% colspan="1" %)
497 -(((
498 -Reads the distance that an ultrasonic sensor measures.
499 -)))|(% colspan="1" %)(% colspan="1" %)
500 -(((
501 501  input
502 502  )))|(% colspan="1" %)(% colspan="1" %)
503 503  (((
... ... @@ -507,63 +507,21 @@
507 507  
508 508  )))|(% colspan="1" %)(% colspan="1" %)
509 509  (((
510 -ultrasonic.ftl
298 +read_and_write.ftl
511 511  )))
512 -|(% colspan="1" %)(% colspan="1" %)
513 -(((
514 -**Gyro,** port, mode
515 -)))|(% colspan="1" %)(% colspan="1" %)
516 -(((
517 -Reads the value of a gyroscope.
518 -)))|(% colspan="1" %)(% colspan="1" %)
519 -(((
520 -input
521 -)))|(% colspan="1" %)(% colspan="1" %)
522 -(((
523 -int
524 -)))|(% colspan="1" %)(% colspan="1" %)
525 -(((
526 -Not available on NXT
527 527  
528 -mode hat to be one of Angle, Rate
529 -)))|(% colspan="1" %)(% colspan="1" %)
530 -(((
531 -gyro.ftl
532 -)))
533 -|(% colspan="1" %)(% colspan="1" %)
534 -(((
535 -**CalibrateGyro,** port, autoReset
536 -)))|(% colspan="1" %)(% colspan="1" %)
537 -(((
538 -Resets a gyroscope if the variable is true.
539 -
540 -If autoReset is true, the variable is set to false automatically.
541 -)))|(% colspan="1" %)(% colspan="1" %)
542 -(((
543 -output
544 -)))|(% colspan="1" %)(% colspan="1" %)
545 -(((
546 -bool
547 -)))|(% colspan="1" %)(% colspan="1" %)
548 -(((
549 -autoReset is true per default
550 -)))|(% colspan="1" %)(% colspan="1" %)
551 -(((
552 -gyro.ftl
553 -)))
554 -
555 -
556 -
557 557  ----
558 558  
559 -== Using the Remote Console (RConsole) ==
303 +== Using the Serial Monitor ==
560 560  
561 -The display of the **NXT brick** is rather small compared to a Monitor. To ease debugging, one can print to a Remote Console (RConsole), if the USB cable is connected. This enables easier collection for example of sensor data.
305 +The Arduino Eclipse Plugin has a Serial Monitor (Window > Show View > Other > Arduino > Serial monitor view). Here you can open connections to serial ports and read and write to them.
562 562  
563 -To use the RConsole, **uncomment** the **RConsole** lines in the wrapper code template **Main.ftl**. Start the **nxjconsoleviewer** tool in the bin directory of your **leJOS installation**. Now, when **starting the application**, the brick tries to connect with the nxjconsoleviewer. **Press the //Connect//** button. If connected succesfully, RConsole.println(...) commands will be written to this window.
307 +To open a connection, click the plus button and select the serial port you want to conenct to as well as the serial rate that is used to transmit data. Click //OK.//
564 564  
565 -The **EV3 brick** has a similar feature. However it does not require any code changes. Just run the ev3console program in the bin directory of your leJOS installation from command line. The output of the brick will be printed to this command line.
309 +The output of all open connections will be combined in the text editor.
566 566  
311 +[[image:attach:Screenshot_20160509_125654.png]]
312 +
567 567  ----
568 568  
569 569  == Problem Solving ==
... ... @@ -580,52 +580,13 @@
580 580  Solution
581 581  )))
582 582  |(((
583 -leJOS EV3 does not support Java 8
329 +The upload protocol is not set
584 584  )))|(((
585 -"java.lang.UnsupportedClassVersionError"
331 +avrdude: Error: Could not find USBtiny device (0x1781/0xc9f)
332 +)))|(((
333 +You launch a project and there is no different behaviour although there are changes in code.
586 586  
587 -"unsupported major.minor version"
335 +You try to launch the project and compilation finishes successful. However The upload fails because the upload protocol is not correctly configured.
588 588  )))|(((
589 -You compile the sources in your project with Java 8 and upload them to the brick. However the lejos EV3 does not support Java 8
590 -)))|(((
591 -Go to the project properties and switch to Java 7 (Right Click on project > Properties > Java Compiler > Compiler compliance level)
337 +Go to the project properties and select //Default// in the field //Upload Protocol// (Right click on project > Properties > Arduino > Arduino Board Selection)
592 592  )))
593 -|(% colspan="1" %)(% colspan="1" %)
594 -(((
595 -Uploading to the brick does not respond
596 -)))|(% colspan="1" %)(% colspan="1" %)
597 -(((
598 -
599 -)))|(% colspan="1" %)(% colspan="1" %)
600 -(((
601 -You compile a file successfully and when uploading the result, the connected brick is found. Anyway the upload does not terminate and does not react.
602 -)))|(% colspan="1" %)(% colspan="1" %)
603 -(((
604 -Flash the brick with the current leJOS firmware. If the brick is recognized correctly and the attempt to upload a compiled file fails then the firmware on the brick might be outdated.
605 -)))
606 -|(% colspan="1" %)(% colspan="1" %)
607 -(((
608 -Compilation and uploading works from command line but not when using KIELER
609 -)))|(% colspan="1" %)(% colspan="1" %)
610 -(((
611 -This Java instance does not support a 32-bit JVM. Please install the desired version.
612 -)))|(% colspan="1" %)(% colspan="1" %)
613 -(((
614 -You can compile and upload code to the brick using the command line tools but when using KIELER an error message apprears because Java does not support 32-bit JVM.
615 -)))|(% colspan="1" %)(% colspan="1" %)
616 -(((
617 -Set the LEJOS_NXT_JAVA_HOME environment variable, such that it points to an 32-bit JDK and is visible for GUI applications (or at least KIELER). The process to do so differs on every OS. As alternative, execute KIELER from terminal.
618 -)))
619 -|(% colspan="1" %)(% colspan="1" %)
620 -(((
621 -Brick does nothing after program finished and prints "Program exit"
622 -)))|(% colspan="1" %)(% colspan="1" %)
623 -(((
624 -
625 -)))|(% colspan="1" %)(% colspan="1" %)
626 -(((
627 -A program was uploaded and finished without errors. Afterwards the brick prints "Program exit" but does not open the main menu.
628 -)))|(% colspan="1" %)(% colspan="1" %)
629 -(((
630 -This is normal behaviour if uploading a program in debug mode instead run mode (//Debug As// instead //Run As// in Eclipse). To get back to the main menu, press the ENTER and ESCAPE button of the brick at the same time.
631 -)))
Confluence.Code.ConfluencePageClass[0]
Id
... ... @@ -1,1 +1,1 @@
1 -16810566
1 +17399847
URL
... ... @@ -1,1 +1,1 @@
1 -https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/16810566/Arduino and SCCharts
1 +https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/17399847/Arduino and SCCharts