]> git.piffa.net Git - sketchbook_andrea/blob - programming/operators/operator_1_basic/operator_1_basic.ino
operatori + analog
[sketchbook_andrea] / programming / operators / operator_1_basic / operator_1_basic.ino
1 /*
2   Operatori base
3  
4  */
5
6 int a = 5;
7 int b = 10;
8 int c = 20;
9
10 void setup()                    // run once, when the sketch starts
11 {
12   Serial.begin(9600);           // set up Serial library at 9600 bps
13
14   Serial.println("Here is some math: ");
15
16   Serial.print("a = ");
17   Serial.println(a);
18   Serial.print("b = ");
19   Serial.println(b);
20   Serial.print("c = ");
21   Serial.println(c);
22
23   Serial.print("a + b = ");       // add
24   Serial.println(a + b);
25
26   Serial.print("a * c = ");       // multiply
27   Serial.println(a * c);
28
29   Serial.print("c / b = ");       // divide
30   Serial.println(c / b);
31
32   Serial.print("b - c = ");       // subtract
33   Serial.println(b - c);
34
35   Serial.print("b modulo a = ");       // Calculates the remainder when one integer is divided by another. 
36   Serial.println(b % a);
37
38   Serial.print("8 modulo 3 = ");       // Calculates the remainder when one integer is divided by another. 
39   Serial.println(8 % 3);
40 }
41
42 void loop()                     // we need this to be here even though its empty
43 {
44 }
45
46