L ' Arduino IDE is an application platform written in Java , and is derived created by the IDE for the programming language and Processing for the project Wiring . It is designed to introduce artists and other newcomers to programming, fasting practice in software development. To enable the writing of source code . The card also includes a text editor has some special features such as syntax highlighting , control of the way, el ' indentation automatic. The editor is also able to compile and run the executable program in one pass and with a single click. Generally there is no need to create Makefile or run programs from the command line .
L ' integrated development environment Arduino is provided with a software library C / C + + called "Wiring" ( homonymous project Wiring ), which makes it much easier to implement common tasks in software input / output. Arduino programs are written in C / C + +, but in order to create an executable file, the user is not asked anything except define two functions :
- setup () - a function invoked only once at the beginning of a program that can be used for the initial settings
- loop () - a function called repeatedly until the card is turned off.
# include "WProgram.h"
# define LED_PIN 11
void setup ( ) {
pinMode ( LED_PIN , OUTPUT ) ; / / enable pin 11 for digital output
}
void loop ( ) {
digitalWrite ( LED_PIN , HIGH ) ; / / LED lights
delay ( 1000) ; / / wait 1 second (1000 milliseconds)
digitalWrite ( LED_PIN , LOW ) ; / / off LED
delay ( 1000 ) ; / / wait 1 second
} int main ( void) {
init ( ) ;
setup ( ) ;
for ( ;; )
loop ( ) ;
return 0;}
"WProgram.h" is the header file main library for Wiring, and function main () makes only three distinct calls: init (), defined in the same library, and functions setup () and loop (), defined by the user. The latter, as required, is automatically nested in a loop.
0 comments:
Post a Comment