Download Print this page

Intel Galileo Hardware Manual page 7

Biobots
Hide thumbs Also See for Galileo:

Advertisement

Hardware
You only need to tell the microcontroller the pin's mode once, so it should go in your setup function.
Your code should now look like this:
void setup() {
// put your setup code here, to run once:
pinMode(13, OUTPUT);
//set pin 13 to output, pin 13 is the built-in
led
}
void loop() {
// put your main code here, to run repeatedly:
}
Notice that I wrote a comment after the code I wrote. This helps me know what I was doing when I wrote it,
and it makes it easier to come back to the program.
At this point it is a good idea to check for mistakes. A quick way to do that is press the "verify" button
which is the checkmark in the upper left-hand corner. This checks your code and sees if there are any very
large mistakes. Those errors will show up in the bottom console screen, where it will let you know if there is
anything wrong. Since you've only wrote one line of code, the problem is most likely there.
After making sure there aren't any errors, try to make a few errors. See what shows up in the bottom black
window if you change something around (Lesson 1 Figure 5). Then go back to the working code.
Lesson 1 Figure 5
Hardware 7

Advertisement

loading