Smart O’clock: Discovering of programming on the arduino

To start this part about the programming of arduino, it’s necessary to explain the type of language. It’s a mix of C and C++. There are a lot of similarity with the C language that we learnt at school. Indeed at the beginning of the code all the variable are declared. After this the code can begin. Regarding to the declaration of the variable, the type has the same name: “void”, “int”,…

As in the C, it’s possible to use classic function such as “IF” or “FOR” but you can also create yourself your function.

About Processing

Processing is an open source language to write programs in other computers as an ARDUINO. It is useful to talk with the ARDUINO, to display or to save some data.

How does Processing language work ?

The processing interface is composed by 4 parts :

  • The toolbar with a row of buttons as start, stop, save,…
  • The text editor. It is the area to type the instructions in the form of text.
  • The message area is used to show the mistakes after the programmation when the program is run..
  • The console is used for technical details.

Until now, four functions are uncovered and every

The first function is RECT and it is used to draw rectangles. For this function 4 arguments must be specify : the left top position x and y, the lenght w and the width z.

Notation : RECT (x,y,w,z) ;

The second function is ELLIPSE is useful to draw ellipse. Like the RECT function, 4 arguments must be specify : the ellipse center x and y, the width w and the height z.

Notation : ELLIPSE (x,y,w,z) ;

The third and the fourth function are STROKE and FILL. STROKE is used to change the colours of line of shapes and FILL is useful to modify the colours inside shapes. About the colours code, every colour matches of a number. The numbers range is situated between 0 and 255. For exemple 0 is black and 255 is white.

These are the new knowledges that we learnt.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s