Scilab Home Page | Wiki | Bug Tracker | Forge | Mailing List Archives | Scilab Online Help | File Exchange
ATOMS : Arduino details
Please login or create an account

Arduino

Arduino Communication through Serial
(3342 downloads for this version - 140816 downloads for all versions)
Details
Version
1.8
Author
Bruno JOFRET
Owner Organization
Scilab Enterprises
Maintainers
Chin Luh Tan
Samuel Gougeon
Yann Debray
Bruno Jofret
Categories
License
Creation Date
February 16, 2020
Source created on
Scilab 6.0.x
Binaries available on
Scilab 6.0.x:
Linux 64-bit Windows 64-bit
Scilab 6.1.x:
Linux 64-bit Windows 64-bit
Install command
--> atomsInstall("arduino")
Description
            This toolbox provides Arduino communication blocks for Xcos.

Source code hosted at : https://github.com/tanchinluh/arduino

Communication is performed through Serial port.



For version 1.8, the Arduino board must be flashed with the file
toolbox_arduino_v5.ino (shipped in the module and downloadable from the ATOMS
page).

TUTORIALS (in english)
----------------------
* Blinking LED Tutorial (created for older version, minor modification might be
required): 
https://atoms.scilab.org/toolboxes/arduino/1.5/files/Scilab_Arduino_Blinking_LED_Tutorial.pdf
* Temperature monitoring Tutorial:
 https://atoms.scilab.org/toolboxes/arduino/1.5/files/Scilab_Arduino_Temperature_monitoring_Tutorial.pdf

RESOURCES
---------
* Demosciences project (in french):
  http://www.demosciences.fr/projets/scilab-arduino

NOTE
----
* toolbox_arduino_v5.ino is shipped within the toolbox, including the
  MPU6050 bloc and filtering. Thanks to David VIOLEAU.

CHANGES 1.7.1 => 1.8
====================  
  BUGS FIXED
  * Fixed issue of extra figure popup when demo figure is on

  NEW FEATURES
  * Add command lines control support for common interface.
  * Translate help pages in english
  * Translate demos
  
  TODO:
  * Change the firmware to get multiple channels and sent all back to host for
performance improvement
  * Translate blocks interfaces and error messages

CHANGES 1.7 => 1.7.1
====================
  BUGS FIXED
  * Fixed 2206 Problem with Servo_Write Block
  * Restore MPU6050 block

CHANGES 1.6.2 => 1.7
====================
  BUGS FIXED
  * Fixed Scilab 6 compatibility issues
  * Change the serial to Scilab from char to double to solved ascii issues.
  * Fixed port >9 not supported issue
  
  NEW FEATURES
  * Multiple boards support (Set to 2 currently as more board yields slow
response)
  * Linux/MacOS(?) Support (Thanks to Nikolay Strelkov link in http://forge.scilab.org/index.php/p/arduino/issues/1556/)

  
  TODO:
   * Change the firmware to get multiple channels and sent all back to host for
performance improvement
   * Translate help pages in english
   * Translate blocks interfaces and error messages
   * Translate demos

CHANGES 1.5 => 1.6.2
====================
 BUGS FIXED
 * toolbox_arduino_v4.ino file shipped in the module was bad.
   Replaced with the right file.
 * ARDUINO_pre_simulate() was expecting arduino_v3.ino instead of 
   arduino_v4.ino and yielded an error 'Il faut charger avec le logiciel
   arduino le sketch toolbox_arduino_v3.ino dans la carte Arduino'
   when actually dealing with the v.4
 * The DESCRIPTION file that was removed from v.1.4 is actually 
   needed to instal the module offline. Restored.
 * Demos: Examples for Scilab 6.0 are displayed with wrong ports 
   positions with Scilab 5.5. The versions for Arduino 1.1 are 
   restored in the binary for the Scilab 5.5.
  
TODO:
  * Extend the module to Linux users (through the serial toolbox based on TCL)
  * Translate help pages in english
  * Translate blocks interfaces and error messages
  * Translate demos
            
Files (6)
[1.81 MB]
Linux 64-bit binary for Scilab 6.1.x
Linux binary for Scilab Arduino 1.8 (Scilab 6.1)

[1.81 MB]
Linux 64-bit binary for Scilab 6.0.x
Linux binary for Scilab Arduino 1.8
[1.25 MB]
Source code archive

[1.80 MB]
Windows 64-bit binary for Scilab 6.1.x
Windows binary for Scilab Arduino 1.8 (Scilab 6.1)
[1.80 MB]
Windows 64-bit binary for Scilab 6.0.x
Windows binary for Scilab Arduino 1.8
[40.87 kB]
Miscellaneous file
Firmware for Arduino to match Scilab Arduino Module 1.8
News (0)
Comments (8)     Leave a comment 
Comment from Olmer Garcia-bedoya -- March 3, 2020, 08:04:12 PM    
Spanish Tutorial 
https://youtu.be/CJgPg6oiC1Q
Comment from Christoph Weber -- March 25, 2020, 03:11:03 PM    
Dear all,

I sucessfully installed the arduino toolbox and I also flashed
"toolbox_arduinio_v5.ino" on the UNO but download of my "blinking
example" in xcos failes.
Connection with com3 serial bus is working, but no function. 
Scilab gives me the information:
"You have to load the toolbox_arduino_v5-x.ino sketch with the arduino software in
the
Arduino board"
Scilab Console says:
""communication with card 1 on com 3 is ok"
Serial port closed SUCCESSFULLY.

  "Error occurred in pre_xcos_simulate: Cancelling simulation."
 at line 80 of function pre_xcos_simulate"
Any ideas?
Why do I have to deliver "toolbox_arduino_v5-x.ino". And where can I find this
file?

Kind regards
Christoph
Answer from Chin Luh Tan -- March 26, 2020, 01:21:37 AM    
This answer has been deleted.
Answer from Chin Luh Tan -- March 26, 2020, 01:42:40 AM    
Hi, 

We have notice some issue running the board for 1st time after uploading the 
"toolbox_arduinio_v5.ino". Could you try the command line functions below?

Execute following line by line.

--> h = open_serial(1,3,115200);
--> cmd_digital_out(h,13,0);
--> cmd_digital_out(h,13,1);
--> close_serial(h);

This should turn off the on board LED, and then turn it on again. 

It this fail, repeat the second time after closing the serial. 

Let us know the outcome.

Thanks.

Chin Luh
ByteCode
Comment from Christoph Weber -- March 26, 2020, 07:30:58 AM    
Hi Chin,

thank you for your reply.

these lines work properly. LED switches on and off.

Xcos-model runs now on my UNO!
Also Data is stored in the Workspace/Variable-Space in Scilab. Great!

Kind regards

Christoph

Kind regards
Chris
Answer from Chin Luh Tan -- March 26, 2020, 07:54:19 AM    
great to hear that. 

rgds,
CL
Answer from Chin Luh Tan -- March 26, 2020, 12:36:35 PM    
great to hear that. 

rgds,
CL
Comment from David Schumacher -- March 30, 2020, 09:29:41 PM    
Hi all,

  I just installed Scilab 6.1.0, Arduino IDE 1.8.11 and Arduino toolbox 1.8 in order to use
my Arduino Leonardo. I don't manage to run a very simple XCos simulation (to blink a LED).

  First, I tried to upload toolbox_arduino_V5.ino, but compilation failed with many
warnings and notes around MPU6050 library.

  Nevertheless, I try to execute Xcos simulation. Few seconds after starting, the scilab
message "You have to load the toolbox_arduino_v5-x.ino sketch with the arduino
software in the Arduino board" is displayed." ... It's logic because first step
is failed.

  Could you please tell me if Arduino Leonardo is compatible ? What are MPU6050 library
pre-requisites ? Am I missed a step to configure Scilab / Arduino ? 

Thank you very much for your help.

Best regards,

David
Answer from Chin Luh Tan -- March 31, 2020, 03:20:15 AM    
One of the user did a nice video on this, it is in Spanish, but should be no problem to 
get the info you need. please refer to his video. 

/////////
Comment from Olmer Garcia-bedoya -- March 3, 2020, 08:04:12 PM    
Spanish Tutorial 

https://youtu.be/CJgPg6oiC1Q

/////////

Rgds,
CL
Comment from David Schumacher -- March 31, 2020, 01:50:04 PM    
This comment has been deleted.
Comment from David Schumacher -- March 31, 2020, 02:34:29 PM    
Thank you Chin for this link. I missed it during my first read of the forum. 
Comment from Tomonori Mashimo -- May 7, 2020, 07:03:11 PM    
Hello,

I am using Arduino module under the following environment.
Windows 10 pro japanese
Scilab 6.1.0 atoms arduino 1.8
arduino ide 1.8.12

I'm trying ANALOG_WRITE_SB.
From 0 to 128 works fine.
However, if you enter 129 or more, 0 is output.

Here are the results I checked.
Scilab5.5.2 + atoms arduino 1.6.2 works fine.

Probably ascii () behaves differently in Scilab 5.x and Scilab 6.x.

http://bugzilla.scilab.org/show_bug.cgi?id=16142
In the above URL, ARDUINO_ANALOG_READ_sim.sci is modified to change temp = ascii (values);

to temp = values ​​;.

Maybe a similar fix is ​​needed for ARDUINO_ANALOG_WRITE_sim.sci.
line 16
            code_sent = "W" + ascii (48 + block.rpar (1)) + ascii
(255);
line 19
            code_sent = "W" + ascii (48 + block.rpar (1)) + ascii
(abs (ceil (u1)));

Maybe this is a problem under Japanese Windows environment. I have no other environment so

I couldn't confirm.

Could someone please confirm?

Kind regards
Tomonori Mashimo
Leave a comment
You must register and log in before leaving a comment.
Email notifications
Send me email when this toolbox has changes, new files or a new release.
You must register and log in before setting up notifications.