Hello all.
Looking at the example from Arduino libraries master_reader.
I took the example provided and as writen it seems to work until I try the Serial.print(c) outside the brackets.
Code slightly modified. line 1, 11, 17-20
1 char c;
2
3 #include <Wire.h>
4
5 void setup() {
6 Wire.begin(); // join i2c bus (address optional for master)
7 Serial.begin(57600); // start serial for output
8 }
9
10 void loop() {
11 Wire.requestFrom(11, 9); // request 6 bytes from slave device #8
12
13 while (Wire.available()) { // slave may send less than requested
14 char c = Wire.read(); // receive a byte as character
15 Serial.print(c); // print the character
16 }
17 Serial.println();
18 Serial.println('c');
19 Serial.println(c);
20 Serial.println('d');
21
22 delay(500);
23 }
If I run serial monitor now I don't get any printout for line 19. Why is that?
c
d
-11.1022;
c
d
-11.1022;
c
d
-11.1022;
c
d
Thanks for the input.