Skip to content Skip to sidebar Skip to footer

Upload a File to an Arduino Hrough a Serial Port

Near S4A

S4A is a Scratch modification that allows for simple programming of the Arduino open source hardware platform. It provides new blocks for managing sensors and actuators connected to Arduino. There is also a sensors study board similar to the PicoBoard 1.

The main aim of the project is alluring people to the programming world. The goal is also to provide a high level interface to Arduino programmers with functionalities such as interacting with a set of boards through user events.

The interface

An S4A program to control a low-cal-sensor Theremin, with record and playback capabilities

Arduino objects offer blocks for the basic microcontroller functionalities, analog and digital writes and reads, and also for higher level ones. You can find blocks to manage standard and continuous rotation servomotors:

In S4A, an Arduino lath is represented past a special kind of sprite. The Arduino sprite will automatically find the usb port where the board is continued.

It is possible to connect to multiple boards at the same time by merely calculation a new Arduino sprite.

Technical details

Supported boards

S4A works with Arduino Diecimila, Duemilanove and Uno. Other boards haven't been tested, but they may also work.

Connectivity

Components take to be connected in a particular way. S4A allows for 6 analog inputs (analog pins), two digital inputs (digital pins ii and 3), three analog outputs (digital pins 5, half dozen and 9), iii digital outputs (pins 10, 11 and 13) and iv special outputs to connect Parallax continuous rotation servomotors (digital pins 4, 7, viii and 12).

Yous can manage a board wirelessly past attaching an RF module to it, such equally Xbee.

S4A allows you to command as many boards as USB ports you accept.

Compatibility

S4A is backwards compatible with Scratch, so you tin open Scratch projects in information technology. All the same, yous won't be able to share your projects on the Scratch customs website considering doing so goes against the Scratch terms of use.

Have in business relationship that this compatibility doesn't work both ways, and so you won't be able to open an S4A project from within the original Scratch.

Using a PicoBoard along with an Arduino board is also supported.

Protocol

S4A interacts with Arduino by sending the actuator states and receiving sensor states every 75 ms, therefore the pulse width needs to exist greater than this fourth dimension flow. The data exchange follows the PicoBoard protocol and needs a specific program (firmware) to be installed in the board. Please refer to the Downloads section for farther instructions on how to practise so.

Documentation and Examples

Here y'all'll find all the documentation, videos, examples and exercices nosotros have created.

Workshop

A zip file with complete materials and exercices for a workshop can be downloaded hither:

Elisava Workshop Materials 2011

These materials were created and used by our team in an actual S4A course at the Elisava School of Design (Barcelona) in 2011.

Bones Examples

Here you'll find basic S4A examples, complete with the Arduino schematics and an .sb Scratch project file for you to download.

Button and LED

A uncomplicated example showing how to trigger an LED past pushing a push button.

Code

RGB LED

Using an RGB LED from Scratch.

Code

Button, LED and keeping country

An LED that switches country when we push button a button.

Lawmaking

Photoresistor and LED

Using the input of a photoresistor sensor to trigger an LED.

Code

Videos

Some of the post-obit demos are in Catalan or Spanish, but the images pretty much speak for themselves. Some of the videos have English subtitles likewise.

Full-featured Robot

A robot with a rotative camera, distance sensors and a remote command. It uses two arduino boards (remote command + robot), an XBee wireless module, iii IR sensors, a camera module and three servomotors.

S4A Workshop Introduction

This video serves every bit an introduction for the S4A workshops given at Citilab, but yous'll find a couple of demos of what can be achieved with our software.

Exercices

Music: A theremin-similar musical instrument

Domotics: A blind curtain controller

Robotics: A keyboard-driven car

For Developers

S4A Protocol Specs

Android

Hi Scratch for Arduino!

We have adult a simple Android application that can communicate with S4A through HTTP by ways of the remote sensors protocol in Scratch. You can download it here or by scanning the QR code below:

To use it, follow the instructions beneath:

  • In S4A, enable remote sensors (right click on any "Sensors" block)
  • In HiS4A (Android), type the local network IP of the PC where S4A is running (y'all can find that out through Edit > Evidence IP address), plus the prefix (just needed if you are connecting from more than one Android customer)
  • The buttons correspond to messages and the touchpad and slider to remote sensors
IMPORTANT! Both S4A as HiS4A must be connected to the aforementioned local network!

HTTP API

The Android application uses a very elementary protocol we developed on top of the Scratch HTTP message protocol, so it is also possible to interact to S4A from a browser or whatever other network enabled awarding.

You will first need to enable the remote sensors option in S4A (right click on any "Sensors" block).

Message Specification

Broadcast a bulletin:
http://[IP]:42001/broadcast=[bulletin-proper noun]

Send the value of a remote sensor (for example, the customer's accelerometer, mouse position, etc):
http://[IP]:42001/sensor-update=[sensor-name]=[value]

Update an S4A variable:
http://[IP]:42001/vars-update=[variable-name]=[value]

Examination web awarding

If you want to see the HTTP API in activeness, you lot can practice so from our exam webapp:

Hi S4A! from the Web

Using the example spider web application:

  • S4A variables whose proper noun starts with a plus sign (i.e. +playerName) are visible and modifiable from the web client
  • S4A variables whose name starts with a minus sign (i.e. -playerScore) are only visible (not modifiable) from the web client
  • S4A variables whose name doesn't commencement ether with a minus or plus sign are non visible from the spider web client
  • S4A letters whose name starts with a plus sign (i.e. +startGame) are visible from the web client
  • S4A letters whose proper name doesn't start with a plus sign are non visible from the web client

Changelog

Version 1.vi

    S4A:

  • Fixed upshot on cake watchers when displaying %t instead the sensor name
  • Stock-still event when analog input error non disappearing
  • Stock-still issues when creating new Arduino object and selecting an existing connection (thanks to Vaner Anampa, Erik Bartmann and many more for reporting this bug)
  • Changed default pins and their guild on Arduino blocks (equally earlier)
  • Merged servo blocks, now pins viii, 7 and four can exist used for standard and CR servomotors.
  • Added HTTP block (GET method) every bit requested by IMI ("Institut Municipal d'Informatica") of Barcelona
  • Updated some translation files. Thank you to:
    • Frederique Pinson - French (fr.po)
    • Miguel Bouzada - Galician (gl.po)
    • Fabio Albanese - Italian (it.po)
    • Sungkuk Lim - Korean (ko.po)
    • January Van den Bergh - Dutch (nl.po)
    • Vadim Litvenko - Russian (ru.po)
    • Johan Solve - Swedish (sv.po)

    Firmware:

  • Refactored reset pins
  • Merged code for standard and CR servos
  • Merged patch for Leonardo from Peter Mueller (many thanks for this!)

Version 1.v

  • Stock-still object collision problems (Arduino and non-Arduino)
  • Fixed bug related to persistent message error when stopping and resuming connexion with the board
  • Changed indexed primitives to named ones for better compatibility with new Squeak VMs (thanks to Miriam Ruiz for the patch)
  • Changed pin 12 from standard servo to normal digital output
  • Changed default pivot at digital on/off blocks from 13 to x
  • Added reset actuators block
  • Improved Catalan and Spanish translations

Version 1.4

  • Added full compatibility with HTTP protocol (Mail service AND Get), you can now send messages to S4A and watch/modify variable values from an Cyberspace browser (among other things). Meet Android section.
  • Added a "check for updates" option in "Aid" carte du jour, from now on at that place is no need to visit website to check for new versions
  • Linguistic communication is at present detected upon showtime launch (when Scratch.ini file doesn't exist). Also saved in same file if changed from language menu
  • Serial port where a board is continued opens correctly when S4A is launched
  • Fixed bug in Windows version, in which title bar didn't show the name and version of S4A when launched

Version 1.3

  • Stock-still compatibility with Arduino UNO on Linux (thanks to Jorge Gómez). Y'all will need to load the new firmware, besides updating the bootloader in some boards
  • Changed the sensor board names and their respective Arduino blocks to show existent pin numbers
  • Added server commands to "Edit" menu to manage network communication over sockets
  • Added compatibility for Android apps (HiS4A)
  • Improved Catalan and Spanish translations
  • Lots of bugfixes

Download and Install

Installing S4A requires y'all to install software both in your PC and your Arduino board. Here you'll find the detailed steps to get it upwards and running.

Installing S4A into your computer

S4A works in the three major consumer operating systems. Download and install the 1 that fits your configuration:

  • Windows
  • Mac
  • Linux (Debian)
  • Linux (Fedora) (version 1.5)
  • Raspbian (Debian for RaspberryPi) (version i.v)

Installing the Firmware into your Arduino

This firmware is a piece of software you lot need to install into your Arduino board to exist able to communicate with it from S4A.

  • Download and install the Arduino environment by post-obit the instructions on http://arduino.cc/en/Main/Software. Take in account Arduino Uno requires at least version 0022.
  • Download our firmware from here
  • Connect your Arduino board to a USB port in your calculator
  • Open up the firmware file (S4AFirmware16.ino) from the Arduino surround
  • In the Tools menu, select the board version and the serial port where the board is continued
  • Load the firmware into your lath through File > Upload

Arduino drivers

If you lot are a Microsoft Windows user, you may need to install the Arduino drivers into your computer:

Arduino drivers for Microsoft Windows

For Developers

S4A is free software distributed under an MIT license.

Since Scratch is actually a Squeak Smalltalk image, all of its code is actually shipped with the terminal user version itself. To access it, just shift + left click on the S4A "File" bill of fare and select "Exit User Mode". You're now in front end of a archetype Squeak 2.8 image, and have access to a Browser, Workspace and all tools you're used to.

Nonetheless, in the final user version some code has been compiled and you'll exist missing several variable and message argument names, which is why we are also providing y'all with a make clean source lawmaking image for developers, downloadable here:

S4A Developer Edition

Alternative download site

Since our VPS provider may sometimes exist downwards, we've set upwardly an alternative location for all files, including old versions:

S4A Dropbox binder

S4A Kit

Coming Before long!

As a response to requests past the S4A community, several of our students, and users around the earth, we are developing a series of kits that will provide the necessary hardware to get started with S4A, with preinstalled firmware and documentation.

These kits will come in incremental upgrades, so that you won't need to pay for components yous don't require for your project.

Stay tuned!

Often Asked Questions

General questions

Tin can the S4A firmware damage the board?

In fact, our "firmware" is just like whatsoever other Arduino sketch, then there is no risk at all. Of course, you tin upload other sketches to the board and and then upload the S4A firmware once again when needed.

Tin the S4A programs be pushed into the Arduino board?

There is currently no way to compile code into Arduino binaries. Information technology must exist said that S4A was conceived as an improvement of the older versions of Scratch (the ones that were developed in Smalltalk), to make learning how to program real-world objects easier to everyone, especially to children, by dealing with these real objects in the same way they'd deal with Scratch "normal objects", then they tin interact betwixt them. In other words, it was not made to program the board direct, but to help acquire programming and electronics at the same time.

Still, if what you desire is to just get rid of the USB cable, we recommend yous use a wireless device like XBee.

Can I change the pinout configuration?

Unfortunately, no. Pin configuration is hardcoded both in the firmware and in the source lawmaking of S4A, and the way S4A is made does not allow to change source lawmaking "on the wing". So, until nosotros find a amend style or enhance the advice protocol between the board and the program, the only way to customize the pinout is by changing both S4A source code and the firmware. There is a Castilian unofficial guide bachelor here (thanks to Borja Pérez).

Which boards does S4A back up?

S4A works with Arduino Diecimila, Duemilanove and Uno. Other boards haven't been tested, but they may besides work.

Will S4A piece of work on my PC?

S4A works on the three major consumer operating systems: Microsoft Windows, GNU/Linux and MacOS. Then yes, information technology volition most probably work on your PC.

Installation troubleshooting

I can't install it on 64-bit Ubuntu/Debian

The Debian version of S4A is packaged but for i386 systems. To go it working in a 64-flake version, y'all need to follow the following steps (in a terminal, as root):

Fist of all, enable i386 packages and install ia32-libs

dpkg --add-architecture i386
apt-become update
apt-get install ia32-libs

And so install S4A:

dpkg -i --force-architecture S4A16.deb

I'm having problems trying to install it on MacOS

Since MacOS 10.8 (Mountain Lion), Gatekeeper is set upwardly past default to allow downloaded applications merely from "Mac App Shop and identified developers". To install S4A, y'all'll need to change this option to "Anywhere".

More info here.

Lath connection troubleshooting

I've connected the board and S4A does not detect it

Make certain you lot take uploaded the latest S4A firmware to the board earlier starting S4A. To do this y'all'll demand the official Arduino IDE.

Delight follow the instructions on the Downloads section in this website.

Been there, done that. Board even so not detected

This is a mutual known event in Windows operating systems. Try stopping the connection with the board (right-click on sensor lath in S4A), unplugging the USB cable, plugging it once more and restarting the connection. If the programme still does not find the board, there may be a conflicting series COM port causing S4A to hang when trying to open up information technology. To avert this, try opening information technology directly (correct-click on sensor board and select serial port) or changing the assigned Arduino COM port through the Windows Device Director. For more aid on this issue, please visit this guide.

The Team

S4A has been developed at Citilab by the Edutec Enquiry Grouping, with the help of the Smalltalk.cat programming group and of collaborators similar Jorge Gómez, who leads the hardware and software educational projection at Miscela.

Marina Conde

Marina Conde got her bachelor degree in Computer Science in the Technical University of Catalonia (UPC) in 2009, and graduated as a Computer Engineer in 2012 in the aforementioned university.

While working at Citilab, she adult her outset final thesis, which consisted in building a framework to piece of work with Arduino boards from within the Pharo Smalltalk environment. Afterwards on, she used this project as the ground on which S4A was written.

Víctor Casado

Víctor chose to study Estimator Scientific discipline in the Autonomous University of Barcelona (UAB), merely after ii years he switched to the Castelldefels School of Engineering (EPSC) to class the technical degree on telecommunications.

While in that location, he had the opportunity to enter Citilab through an internship, where he later developed S4A, his final thesis.

Joan Güell

Joan is a biologist who, in his early on years, worked in the field of ecology. The need to analyze the generated information and nerveless data collection his arroyo to computing. He enrolled to his start programming class in 1975, when computers where still programmed by means of dial cards.

His main work in Citilab has been related to the field of preparation in 2 areas: teaching programming with Scratch, particularly to children, and educational activity computer skills to early on adult citizens.

Jose García

Jose studied advanced telecommunications technology, but started working at a publishing firm earlier completing his degree. During his time at the company, he worked on programming a wide variety of applications.

At Citilab, he discovered Scratch and Smalltalk, taking upwardly part of his programming work again. Afterwards, he joined different projects that aim to establish closer contact betwixt users and programming. He currently leads the Technological Education Research team Edutec.

Bernat Romagosa

In 2009, Bernat graduated as a technical engineer in Computer Scientific discipline at the Open up University of Catalonia (UOC). He learned Smalltalk at a course given by Jordi Delgado at Citilab in 2008, where he was later hired to build an online programming schoolhouse.

Since then, he's been involved in several programming projects in Citilab, including a social noesis management system and different educational applications.

Jordi Delgado

Jordi is an associate professor at the Software Departament of the Technical University of Catalonia (Universitat Politècnica de Catalunya). He belongs to the research group LARCA and teaches at the Barcelona School of Computer science.

He spends most of his time divulging, spreading the word of and programming in Smalltalk, an astonishing programming language that, you know, everyone should be using. He is a member of the board of the European Smalltalk Users Group (ESUG) and he leads the Smalltalk.cat local grouping.

Contact Usa

You can reach united states at scratch@citilab.eu to written report bugs or for any suggestions you lot may have.

mathewsandetter58.blogspot.com

Source: http://s4a.cat/

Post a Comment for "Upload a File to an Arduino Hrough a Serial Port"