Escolar Documentos
Profissional Documentos
Cultura Documentos
2016
Users guide
Arduino simulator 1.4
Xevro
2016
1. Introduction
The Arduino UNO Simulator is made for quick testing of small projects. there is still further
developed in order to obtain the widest possible I/O functions. The Arduino Simulator is designed to
test a program quickly with the Arduino UNO without really having connections to external I/O
(buttons, potentiometers, display, power, ...).
Almost all of the I/O is present on the simulator so that we can test all of your programs on the
monitor screen.
To be use the simulator we need 2 programs.
The JAVA program
- The Arduino simulation program
The Arduino software
For the Java program, we need Java download on our PC or laptop, you can find the download link
on the website of Xevro.
Xevro
2016
2. Arduino software
For we start with using the Arduino simulation program we need the Arduino software, it is also free available
on the website: http://arduino.cc/en/Main/Software
Because we work with a serial connection through the USB port of your PC or laptop, we also have a
USB driver that we can pick up the following websites:
For a 32bit processor use the RXTXcomm.jar and the rxtxSerial.dll
These two files need to stand on a specific place:
Xevro
2016
If the rxtxSeriall.dll" are not set on the right place than will the simulator not
start.
Program Files
If we want to run the setup Arduino Simulator, you need to install the simulator in the folder
C:\ProgramFiles\ArduinoSimulator" because all documents referring to this folder.
Xevro
Examples Structure serial message between the Arduino UNO and Arduino Simulator (java)
1.
2.
3.
4.
5.
2016
Xevro
2016
Data: 0 - 15
(char)
End of message: LF
Example with button 1:
If one of the "push 1" button on the screen will get this message to serial Arduino UNO as follows:
" I001111 " this means that the input 0 to "1" state, I00 is the first input as we work in the program input from 0
to 13.
Keep in mind so that " 0", the first input in the program.
Xevro
2016
The Arduino program works with instructions that the I/O read and write this we must now convert to serial
communication means that we have to write these new instructions.
We do not want too much change the real instructions we have our new instructions given the same text but
instead a small initial letter, we have chosen to take this as a capital.
Example:
digitalWrite(12, HIGH);
become DigitalWrite(12, HIGH);
O121111
Using instructions, the first letter is now a case of removing the tip:
Instructions Arduino
Instructions Simulator
digitalWrite(x,y);
DigitalWrite(x,y);
digitalRead(x);
DigitalRead(x);
analogWrite(x,y);
AnalogWrite(x,y);
analogRead(x);
AnalogRead(x);
myservo.write(x);
myservowrite(x);
Serial.print(x);
Serialprint(x);
tone(x,y ,z);
Tone(x,y ,z);
noTone (x);
NoTone(x);
lcd.setCursor(x,y);
lcdsetCursor(x,y);
lcd.print(long x);
lcdLprint(x);
lcd.print(x);
lcdprint("x");
lcd.autoscroll();
lcdautoscroll();
lcd.noAutoscroll();
lcdnoAutoscroll();
lcd.clear();
lcdclear();
lcd.display();
lcddisplay();
lcd.noDisplay();
lcdnoDisplay();
lcd.blink();
lcdblink();
lcd.noBlink();
lcdnoBlink();
lcd.write(x);
lcdwrite(x);
lcd.rightToLeft();
lcdrightToLeft();
lcd.leftToRight();
lcdleftToRight();
lcd.home();
lcdhome();
Xevro
lcd.cursor();
lcdscrollDisplayLeft();
lcdscrollDisplayRight();
lcdcursor();
lcd.scrollDisplayRight(); =
lcd.scrollDisplayLeft();
2016
So we can just replace Arduino instructions into the simulator instruction and our newly written program
(Arduino sketch) testing with the simulator on the PC.
Afterwards, if the program is tested, one can Simulator instructions substituted back into the original
instructions of Arduino, leaving the real I/O Arduino UNO is functioning again. (Instruction turns orange).
attention:
In each sketch are the instructions changed, only the in and outputs connect on the screen.
Dont forget to select the Com-port! (Blink)
The coupling it inputs - and outputs can be found in the Arduino software.
With Restore you can store the settings for later:
Xevro
2016
b.
a.
Uploading of a new program to the Arduino UNO
Start the Arduino application
Select board Arduino UNO
Select the serial port
Upload the program into the Arduino UNO
Opmerking: The BaudRate on the simulator is 9600.
Xevro
2016
6.2 Set the Com port
First you need to select the COM port of the USB port that is used by the Arduino. You can see which COM port
it is. (selected COM port turns red).
Before the selection
Attention:
-
At start-up, we also see the state of the simulator at the bottom of the COM port:
Once you have selected the correct COM port changes to this text:
If you choose the wrong COM port or there is no Arduino connected than you get this message:
Xevro
The Arduino UNO has 14 digital I/O pins we can configure this pins into inputs or outputs I/O.
This pins get symbolic images as D0 to D13 and the text change red if its select.
We have 8 buttons, this buttons can set to one of the inputs D0 D13, After the
selection change the color green.
7.2 Buttons
-
There are text boxes to set a little information.
7.3 Leds
-
7.4 Buzzer
-
The buzzer can select to a digital output of D0 D13.
When we send a signal on the output pin we get 1 second sound.
The pitch can be changed with using the slider. (0 - 10KHz)
There is a text box for comments.
2016
Xevro
2016
8.2 Sound detector
-
The sound detector may be coupled to one of the 6 analog inputs A0A5 (value of 0 <-> 1023), The combobox
change into yellow after selection.
This detector records no sound just responding to a noise level adjustable with the slider.
Once the recording is started it will be nothing more to serve on the screen because it is continuously listened
to the microphone.
When the noise level is exceeded, the progress bar will show the noise level in percent.
Once detection has addressed this value is (value of 0 <-> 1023) sent to the Arduino, which can also be read on
the simulator.
Xevro
2016
There are 2 analogue outputs which first met slider and one filled progress bar
Both of these outputs can be coupled separately to one of each analog output 6 PWM 3, 5, 6, 9, 10 and 11
(value of 0 <-> 1023)
The combobox change into pink after selection.
There is a text box for comments.
The analog output can be read on the simulator.
9.2 Sound generator
-
The sound generator can be coupled to one of the 6 analog outputs PWM 3, 5, 6, 9, 10 and 11
(value of 0 < -> 1023)
The combobox change into pink after selection.
There is a text box for comments.
The analog output of the Arduino can be read on the simulator.
9.3 Servo
-
The servo is automatically connecting to the output D12 after pressing on the button.
There is a text box for comments.
On the big screen we can see the analog output value (servo mode) from the Arduino UNO.
Xevro
The display is paired automatically connect to the outputs D4-7 and D11,
D12
The display has 2 rows and functions almost like the real display.
Attention:
The difference with the real display is the bottom row starts from right to
left, this one should keep in mind during programming. Its also not possible
to separately control the pixels.
Attention: No double use of I/O possible if this happen then we get this message:
2016
Xevro
2016
The squarewave generator can connect to one of the 6 inputs A0 A5, this inputs (A0 A5) need
to decelared in a digital input.
The squarewave generator can make a squarewave with a frequency of 0,1 to 10Hz.
As soon as you press the button, er come a slider where you can set the frequency of the square
wave.
Attention:
No double use of I/O possible if this happen then we get this message:
Xevro
2016
Xevro
2016
Save
Restore
Example settings Parking: - 2 buttons, 2 Leds, 1 display, 1 servo, 1 progress bar,
Xevro
Input Screen Resolution (attention: when you give a number you need to press
ENTER)
2016
Xevro
2016
14. Languages
15. Instructions
The instructions stand under: Instructions Arduino UNO Simulator in Help: