Académique Documents
Professionnel Documents
Culture Documents
http://www.control.aau.dk/~jdn/edu/courses/13-2/imperativ
http://sict.moodle.aau.dk
Based on C
Goal
Learn how to
Goal II
Basic C and
programming
Embedded
programming on
Arduino
Basic C part
GUI based:
Arduino environment
Embedded part
Arduino based
IO
Serial (rs232),i2c,..
Cheap
Arduino's
It is your choice
To be here
TODAY
10
11
12
Characteristics
Difficult to program
High salaries
64 kByte Ram
13
14
OS
GUI IO
NET
IO
HW
Imperativ Programming/JDN - Lecture 1
15
windows,linux,arduino,...
Save executable
In flash memory
...
16
Let's do it
/* A simple Program */
#include <stdio.h>
int main(void)
{
printf(Hello World\n);
}
17
18
19
SW Development method
20
21
22
23
24
double float_1;
int int_1, int_2; /* upper case is not equal lower case */
int main(void)
{
int_1 = 3;
int_2 = int_1 *3 44;
float_1 = int_1;
}
/* p.. of cake */
25
26
27
stdio.h
Input like
read_an_integer_from_keyboard
28
stdio.h - output
printf (hello);
%i : integer
%f : floating point
%c : character
29
int i,j,k;
i = 3 ; j = 4; k = 4444;
printf(%i%i%i,
i,j,k);
30
stdio.h - input
31
stdio.h - scanf
int a_number;
32
int i1,i2,i3;
scanf(%i %i %i, & i1, &i2, &i3 ) ;
33
Operator Hierarchy
Level x
+ -
Level x-1
* /
...
2 + 5 * 4 + 5 = ???
27 I guess
34
(())(())
Use ( ) to clarify:
((2*3) +5) / (3+7)
You can never use to many only to few ...
35
36
37