'Serial' was not declared in this scope error message

I am new to Arduino and at the moment I am trying to just test my cap1188 8- key captouch but keep getting a scope error:

cap1188test:76:3: error: ‘Serial’ was not declared in this scope



exit status 1

I have scoured the web for an answer to this or guidance and gone through the code several times checking for ‘serial’ to make sure there is not a case issue. Please help.

cap1188test.ino (2.28 KB)

I don't think the print() methods of the Serial object are happy if you don't supply a parameter to the call. What happens if you change that empty call to:

  • Serial.println(' ');*

Compiler error message clearly states that the error is caused by the fact that there's no Serial, not by empty parameter list in println. Not all target boards provide Serial object.

What is your target board? ATtiny by any chance? You might have to use SoftwareSerial.

The code compiles fine on my Uno.

if you do Seriial.print() there will cause an error because there is nothing to print. Serial.println() will not cause an error as there is the \r and \n to print (tested many times).

I think the problem is more likely what @Montmorency has suggested - compiling for a microprocessor that does not have a hardware UART.