Pages: [1]   Go Down
Author Topic: Help w/ Project 2 - Spaceship Interface Code  (Read 2811 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm starting the second project and get the response "void setup()" as an error.  I've written all the code as it is (or as I think it is) in the book, but something is wrong.  "void setup()" is the error I get when I include the text from the top shaded box on page 37 of book:

void setup () {
}

void loop () {
}

When I delete the text from the top shaded box on page 37, I get this error instead: "switchState" was not declared in this scope.
I considered starting with code in the second shaded box because it has a "1" next to the first line... my thinking is this should be the first line of code.  Still, no-worky.

With this error, "switchState" was not declared in this scope, the following line is highlighted in yellow: if (switchState == LOW) {

How do I get this code to work?  The on-line videos of the code for this project at RS look different than what's in the book, but I've got the book and want to use it for instruction.  Thanks.
« Last Edit: March 08, 2013, 02:19:23 pm by CharF » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Problem is solved.

If anyone has the same problem, I found code for this project by clicking A) Arduino icon, B) File, C) Examples, D) 10.StarterKit, and then E) p02_SpaceshipInterface

Uploading this sketch made made project #2 work.  It looks like the codes for all projects are listed here, and don't have to be typed by the user.

Good luck with your projects!
Logged

Pages: [1]   Go Up
Jump to: