Why am I receiving "error 'Serial' was not declared in this scope" when building my Arduino sketch?

Doh fixed it myself. Needed to include the SoftwareSerial library in the updated blink sketch. That piece of info is missing from the tutorial linked above.


For anyone coming after me, I ran into this problem, but no mention of SoftwareSerial was indicated. Rather (I know it sounds crazy) the answer was on this thread of the Arduino forums:

Throw some dummy code at the very top of your sketch (yes, even before includes). Mine:

char foo;

You need to include the SoftwareSerial Library in your updated sketch. In order to do this, go to the Sketch menu and scroll down through "Import Library..." to the SoftwareSerial Library, selecting it to add it.

Alternatively, add #include <SoftwareSerial.h> to the top of your sketch, the above does the same thing.

Tags:

Arduino