Hi all!
I have a Digispark with a thermometer shield I designed. Now, I would like to make some reading to the sensor and send them to the computer. I would like to have a bidirectional communication between the PC and the Digispark. To do so, I thought that the SoftSerialExample would be a good starting point. However, I encountered some issues. First, there was a compiling error in line:
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
Telling me that:
tmp/arduino_modified_sketch_408992/SoftSerialExample.ino: In function 'void setup()':
SoftSerialExample:32: error: no match for 'operator!' (operand type is 'TinyDebugSerial')
while (!Serial) {
^
/tmp/arduino_modified_sketch_408992/SoftSerialExample.ino:32:11: note: candidate is:
/tmp/arduino_modified_sketch_408992/SoftSerialExample.ino:32:11: note: operator!(bool) <built-in>
/tmp/arduino_modified_sketch_408992/SoftSerialExample.ino:32:11: note: no known conversion for argument 1 from 'TinyDebugSerial' to 'bool'
exit status 1
no match for 'operator!' (operand type is 'TinyDebugSerial')
However, given that this line is needed for Leornardo only I commented it. Next, however, more compiling errors appear:
SoftSerialExample:37: error: 'Serial' does not name a type
Serial.println("Goodnight moon!");
^
SoftSerialExample:40: error: 'mySerial' does not name a type
mySerial.begin(4800);
^
SoftSerialExample:41: error: 'mySerial' does not name a type
mySerial.println("Hello, world?");
^
SoftSerialExample:42: error: expected declaration before '}' token
}
^
exit status 1
'Serial' does not name a type
I am clueless on how to fix it. Could you please give me some guidance? I am using Arduino IDE 1.8.5 on an Ubuntu 14.04 LTS.
Thanks in advance!
Jusep