Arduino Tutorial: the most important bases


Handicraft and passionate inventors have long been a term, because the compact microcontroller in the box format It can be used for numerous projects. In addition, it offers beginners and children a great way for To familiarize programming and electric engineering with programming and electric engineering topics And to obtain relatively quickly visible results. In our Arduino tutorial we explain the Basic notions on Arduino programming and shows how they do without the previous knowledge Perform the first simple projects Candies.

What is a sketch?

The programs are indicated as a sketch at Arduino. These are simple text files with the ending *.ino, which can be opened by double clicking in the Arduino.

How can I import programs on my Arduino?

The Arduino card can be connected to the computer using a USB port to reproduce program codes. The development environment of the Arduino Ide source or the Arduino web editor for the transmission is also necessary.

What previous knowledge do I need to program a Arduino?

Even if you've never worked with circuits and plug -in cards, you can get a finished program on your Arduino. In addition to the examples of Arduino Ide, you will also find numerous arduino Tedeschi tutorials, projects, videos and internet instructions with already finished Arduino programs that you just have to load on your microcontroller.

1. Arduino Tutorial in German: the foundations of Arduino programming

It has the Arduino card Different analog and digital entrances and outputs and can be connected to the computer using a USB port, To reproduce the program codes. There are also several strips of pen Connection of display, measurement tools, LEDs and allow other devices to the Council.

Good to know: A microcontroller is nothing more than a small processor with memory in which the program code is archived and accessible during the execution. It can only work through a program and is therefore particularly suitable for projects in which simple activities must be performed continuously.

Some models are already already Equipped with an internal network interfaceIf necessary, you can Ethernet and WiFi also adapt to the shield. These are electronic expansion cards that Simply on the Arduino card without welding Or another shield is put. As for the price, however, they are equipped with an Ethernet shield significantly cheaper far than the WLAN variant.

https://www.youtube.com/watch?v=6jpewo1s4mc

1.1. Development and sketch environment

Die The programs are indicated in the Arduino as a sketch And they are nothing but simple text files with the final *.ino. In order to import a sketch on your Arduino, you need the source -Saland Arduino ide or Arduino web editor development environment. The Arduino ide, which is basically A simplified variant of C or C ++ It acts for Windows, Linux and MacOS.

A Sketch is always made up of three blocks:

  • Block 1: Here is the Elements of the program createdincluding data types (int, byte, boolean, long etc.). If and what definitions must be inserted it is always dependent on the program in question.
  • Block 2 (configuration): In this area, the input and output pins are transmitted to the card. Will do so Go through a start once And it must also be determined if there are no definitions in it.
  • Block 3 (loop): This block contains all parts of the sketch that are passed permanently. THE Loop is developed from top to bottom And it starts again after each race. The one in the contained therein So the code is located In a permanent cycle.

https://www.youtube.com/watch?v=rvvxxmgfygs

2. Arduino Tutorial: simple example projects with instructions

Even if they I have never worked with circuits and bakeries You can take some steps on your Arduino Nudo hardware Bring a finished program to run. In this section you will find some simple Arduino projects for unprecedented beginners for which you Already Code finished in the Arduino idea can use.

Good to know: A breadboard is a slatin that can be used to set circuited circuits using it.

2.1. Flashing joints

For this project we would like A LED inside and outside every second rhythmSo let the eyelids beat. On Pin 13 of the Arduino Involved a LED for test purposesThis often flashes when connecting the card and that we can also plan ourselves.

Arduino a board

Set up

  1. Download – if not already done – Arduino software downwards and install them.
  2. Then connect The Arduino card that uses a USB cable with the computer. It should be from the computer Recognized and set automatically.
  3. Start the Arduino software and put the type of card «Tools/card“Fest.
  4. Configure the connection via «Tools/door“. As a rule, this is the Connection with the name of your card.
  5. The setting is complete. Now you can Start programming or import a finished code.

The flashing LED code is already included in the Arduino ID as a standard example. You can find it under «File -> Examples -> Basic notions -> Blink“.

// Die Setup-Funktion läuft einmalig beim Einschalten oder Reset.

void setup() {

  // Initialisieren des digitalen Pin LED_BUILTIN als Ausgang.

  pinMode(LED_BUILTIN, OUTPUT);

}

// Die Schleifenfunktion läuft kontinuierlich

void loop() {

  digitalWrite(LED_BUILTIN, HIGH);   // Schaltet die LED ein (HIGH ist der Spannungspegel)

  delay(1000);                       // warte für 1 Sekunde

  digitalWrite(LED_BUILTIN, LOW);    // Schaltet die LED aus (LOW ist der Spannungspegel)

  delay(1000);                       // warte für 1 Sekunde

}

Code charge

  1. To activate the program, upload the code Above [STRG] + [U] AND «Sketch/loading“O The little arrow at the top left of the Arduino table.
  2. After a while a message appears that the The loading is complete.
  3. Die Led now flashes every rhythm of 1 second. Of course you can also the values change as desired.

Like you with Arduino it can allow an external LED to dwellShow the following video:

https://www.youtube.com/watch?v=x8nf0pdydyq

2.2. LED switch with button

In another standard sketch of ide, the LED is activated by pressing a button («File -> Examples -> Digital -> button «).

// Konstanten (const) ändern sich nicht.

// Sie werden hier verwendet, um Pin Nummern festzulegen:

const int buttonPin = 2;     // Pin des Tasters

const int ledPin =  13;      // Pin der LED

// Variablen ändern sich:

int buttonState = 0;         // Variable zum Lesen des Tastenstatus

void setup() {

  // Initialisieren des LED-Pin als Ausgang:

  pinMode(ledPin, OUTPUT);

  // Initialisieren des Tasters als Eingang:

  pinMode(buttonPin, INPUT);

}

void loop() {

  // Lese den Status des Tastenwerts:

  buttonState = digitalRead(buttonPin);

  // Überprüfe, ob der Taster gedrückt ist.

  // Wenn dies der Fall ist, ist der buttonState HIGH:

  if (buttonState == HIGH) {

    // schalte LED ein

    digitalWrite(ledPin, HIGH);

  } else {

    // schalte LED aus

    digitalWrite(ledPin, LOW);

  }

}

In addition to the Arduino card, a Broadboard, a button, a LED, in addition to the Arduino card is required A resistance with 220 ohm and four connection cables.

THE Circuit diagram Furthermore, it seems follows:

Arduino LED button circuit

However, it becomes much more demanding With two buttons and a dimmable LED:

https://www.youtube.com/watch?v=g9ff6utqmsy

3. Arduino Tutorial: more information

Now you have learned like you Get programs on your ArduinoHow a sketch is structured and what you can do with a breadboard. With these foundations you can practically Move all projects from the Internet. In most cases, however, it is reduced to using Finite Arduino sampling programs e Equip only the Plug card -in consequently.

You can find online An entire series of projects with finished program codesLike the following:

On the other hand, you must be clear for the programming completely their codes More interested in electronic bases and scripting language. In addition to the example projects included (integrated examples), the numerous English and Germans are also suitable for this Arduino tutorial, instructions and video from the Internet. These are even available in different levels of difficulty From beginners to Arduino professional hobbyists and experts.

https://www.youtube.com/watch?v=s0ezmlnwus

1 star

2 stars

3 stars

4 stars

5 stars

(39 votes, media: 4.60 out of 5)

Loading …

latest posts published

5k player-love of another audio/video reader

The market for multimedia players actually seems saturated. In addition to the funds on board ...

Search Lookeen 10 desktop replaces Windows Search

When Windows users look for files on your PC, the integrated search function is usually ...

How to improve battery life in Samsung Galaxy S6

Today the most productive smartphone in the world is the Samsung Galaxy S6, whose high ...

The perfect game pc in the test – What should really be able to do

Each player is worried about the purchase of a new game PC in advance. What ...

How many cups of the CPU really need it

Today's processors are mostly equipped with several CPU cores. However, the number varies significantly. In ...

What is the modern configuration guest?

In Windows updates, the modern installation host process repeatedly appears, which slows down the system, ...

Why do memory stick folders appear as shortcuts?

Nowadays we can meet the virus, which transforms all the folders from the Memory stick ...

O & O & Partitionation Particione Profession in version 3

The O & O software, supplier of numerous hard drive products such as O & ...

How to find the right calendar app

The smartphone as a constant partner is the ideal place to organize our appointments. Most ...

These companies benefit from the software solution

Each project is standing and falls with its organization. Therefore, a simple and clear solution ...

Leave a Reply

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *