31.07.2015 Views

A-Teachers-Guide-to-the-Intel-Galileo-Final

A-Teachers-Guide-to-the-Intel-Galileo-Final

A-Teachers-Guide-to-the-Intel-Galileo-Final

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

29 | Beginning with ArduinoCodingOpen <strong>the</strong> Arduino IDE. Check that <strong>the</strong> COM port assigned <strong>to</strong> <strong>the</strong> <strong>Intel</strong>® board (go <strong>to</strong> DeviceManager <strong>to</strong> check), matches <strong>the</strong> correct COM port according <strong>the</strong> <strong>the</strong> IDE:Check also that <strong>the</strong> correct <strong>Intel</strong>® board has been selected:Copy and paste <strong>the</strong> code below. (You can alter <strong>the</strong> level of difficulty by changing <strong>the</strong> speed in <strong>the</strong>LED daisy chain coding.)/*Reaction GameTurns on a series of 5 yellow LEDs in sequence.There is a 6th green LED and <strong>the</strong> player must <strong>to</strong>uch <strong>the</strong> switch when <strong>the</strong>green LED lights up.This example code is in <strong>the</strong> public domain.*/// Assign variables <strong>to</strong> <strong>the</strong> inputs/outputsint greenLED = 1;int redLED = 2;int ledPin12 = 12;int ledPin11 = 11;int ledPin10 = 10;int ledPin9 = 9;int ledPin8 = 8;int ledPin7 = 7;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!