Operácie

Acrob001: Rozdiel medzi revíziami

Z SensorWiki

(Nová stránka: == 1. Úloha == Spustite vývojové prostredie kliknutím na ikonu Obrázok:ArduinoIcon.png. Najprv spravte základné nastavenia - t.j. typ riadiacej jednotky s ktorou budeme ...)
 
Riadok 1: Riadok 1:
== 1. Úloha ==
+
== Setup ==
  
  
Spustite vývojové prostredie kliknutím na ikonu [[Obrázok:ArduinoIcon.png]]. Najprv spravte základné nastavenia - t.j. typ riadiacej
+
The Arduino integrated development environment (IDE) is run using the icon [[Obrázok:ArduinoIcon.png]] on Your desktop.  
jednotky s ktorou budeme pracovať:
 
  
[[Obrázok:ArduinoBoardSetting01.png|center]]
+
First You have to perform the basic settings: the type of Your board and serial port to which is it connected.
  
a sériový port, cez ktorý budeme s jednotkou komunikovať a nahrávať do nej programy cez tzv. ''bootloader''. Keďže používame prevodník
 
USB na sériovú linku, musíme predtým zistiť, aké číslo portu pridelil OS Win:
 
  
[[Obrázok:ArduinoPortSetting01.png|center]]
+
Go to the menu and select Tools -> Board -> Arduino Diecimila, Duemilanove or Nano w/ Atmega168.
Potom vložte nasledovný program:
+
This is the type of the board we will use.
  
<source lang="c">
+
[[Obrázok:ArduinoBoardSetting01.png|center]]
void setup()
 
{
 
Serial.begin(9600);
 
}
 
  
void loop()
+
Then, again from the main menu select Tools -> Ports -> COMx where x is a number of Your serial port to which is the board connected.
{
+
This port is used for communication, sending and receiving messages and also for program download using special firmware ''bootloader''.
Serial.println("Hello, World!");
+
We use the USB/Serial converter, so it is necessary to know, which number is given by the operating system Windows
}
 
</source>
 
  
Malo by to vyzerať takto:
+
[[Obrázok:ArduinoPortSetting01.png|center]]
 
 
[[Obrázok:ArduinoIDE01.png|center]]
 
 
 
Potom program skompilujte [[Obrázok:ArduinoButtonCompile.png|29px]], uložte [[Obrázok:ArduinoButtonSave.png|29px]]
 
a nahrajte do riadiacej jednotky [[Obrázok:ArduinoButtonUpload.png|29px]]. Ak je nahratie úspešné, program sa spustí
 
automaticky. Aby ste videli, ako funguje, otvorte si zabudovaný terminál [[Obrázok:ArduinoButtonTerminal.png|29px]].
 
 
 
Malo by to vyzerať takto:
 
 
 
[[Obrázok:ArduinoIDE02.png|center]]
 
 
 
Všimnite si, že program je rozdelený do dvoch blokov. Sekcia <TT>setup()</TT> sa spustí len
 
raz pri štarte programu. Obvykle sú tu nastavenia, definície a konfigurácia hardvéru.
 
Potom program pokračuje nekonečnou slučkou <TT>loop ()</TT>. Tu je definovaná základná činnosť
 
robota.
 
  
 +
You are ready for Your first programm!
  
[[Acrob|Späť do menu]] | [[Acrob02|Pokračovanie...]]
+
[[Acrob|Home]] | [[Acrob002|Next >]]

Verzia zo dňa a času 07:15, 12. jún 2010

Setup

The Arduino integrated development environment (IDE) is run using the icon ArduinoIcon.png on Your desktop.

First You have to perform the basic settings: the type of Your board and serial port to which is it connected.


Go to the menu and select Tools -> Board -> Arduino Diecimila, Duemilanove or Nano w/ Atmega168. This is the type of the board we will use.

ArduinoBoardSetting01.png

Then, again from the main menu select Tools -> Ports -> COMx where x is a number of Your serial port to which is the board connected. This port is used for communication, sending and receiving messages and also for program download using special firmware bootloader. We use the USB/Serial converter, so it is necessary to know, which number is given by the operating system Windows

ArduinoPortSetting01.png

You are ready for Your first programm!

Home | Next >