This the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Getting Started

Everything you need to know to get started using Automaduino!

Want to start coding using Automaduino? Great! Find out about the editor interface and what you need to do to generate code.

Overview

Arduino Editor Interface

The interface consists of the following parts:

Component Drawer
This drawers consists of all component states you can use. To find out more about the components visit the Components Page.
Start Point
The Start Point is the entry for your program. You need to connect it to a state for the code to be able to run.
State
A state consists of component and a function. The state executes the function for its assigned component. Find out more about states here.
Transition
A transition connects two states and determines how and when to move from one state to the next. There are multiple different transition types. Find out more about transitions here.
Pin Assignment
This opens the Pin Assignment dialogue. This is necessary as the Arduino needs to know to which pin your component is connected. If there is a state on the canvas that does not have a pin assigned a warning is shown.
Code
Here the code for the Arduino is shown! The code is automatically generated if you add a state or connect two states. It also works as a text editor if you want to change the code.
Code Style
The code style menu allows you to select different code styles for the generator. This for advanced programmers. All Code Styles are explained in this section.

Pin Assignment

If you click on the pin assignment button a dialogue will open. Here you can assign the pins for the components on the board.

Pin Assignment example

First add a new component, then select a pin number and a component type. If you have done this successfully you can drag a state from the list at the bottom and add it to the component.

If you’re done save your assignments by clicking on the submit button.

Tipp: You can rename your states so you know exactly which state you are assigning!

Copy Code

To use your code you have to copy it. You can always select all code in the editor by hand, but there is also a shortcut in the editor menu.

Copy code using the editor shortcut

If your editor is closed there is a shortcut available at the bottom of the closed drawer. Next to it is also a shortcut to the pin assigment.

Copy code with a closed code editor

Arduino IDE

To upload a sketch to the Arduino you need to install the Arduino IDE.

If you’ve done this successfully, open the IDE and select your board type. The default one is “Arduino Uno”.

Board selection Menu

Next connect your board via USB to your computer. Then select your board in the port selection. The correct port should have the board name next to it.

Port Selection Menu

Then you can copy the code of the Automaduino editor and paste it into the Arduino editor. To upload a sketch press the upload button while your Arduino is connected. That’s it!

Upload Button

For a full example head over to the blink page.

1 - Blink Example

This example teaches you how to generate the code for the blink program!

The blink program is the Hello World program for the Arduino. We use a single LED and turn it on and off again with a slight delay. As a result the LED will blink, hence the name. If done correctly we can verify that our Arduino is working correctly and the connection is working.

Scheme

To get started grab a LED and a resistor. Connect the LED to Pin 7 and use a breadboard to connect the GND pin with the resistor and LED.

See the scheme below on an example for the connections.

Connection scheme for the blink program

Sketch

Now we first think about how our automata should look like. Use a pen and paper and try to sketch what is happening. An example automata is shown below.

Blink sketch example

Add States

Now we’re going to translate our sketch to the Automaduino. For this we add two states to our canvas: A LED that is on and a LED that is off.

Blink states

Add Transitions

We’re now going to connect the states. We start by connecting the start point with the ON state. After we turned the LED on, we want to wait a short time and then turn it off. To do this we connect it with the OFF state and select a delay of 1000 ms. To repeat our blink we connect back to the ON state.

Blink transitions

Assign Pins

To finish our code generation we need to assign pins. We open the dialogue and add a LED component on pin 7. We then assign both available states to this component and submit.

Full blink example

Upload

Now copy the code into the Arduino IDE and upload the sketch as detailed in the Getting Started guide. If you connected the LED correctly it should now blink! You successfully programmed an Arduino!

Full Example