IntelAcademic_IoT_Lab_01_Arduino_side

Download Report

Transcript IntelAcademic_IoT_Lab_01_Arduino_side

Intel Do-It-Yourself Challenge
Lab 1: Intel Galileo’s Arduino side
Nicolas Vailliet
www.Intel-Software-Academic-Program.com
[email protected]
Intel Software
2014-02-01
Prerequisites and objectives
We assume that:
- You are able to download an archive, to unzipped it and run a program under
the OS you’re familiar to.
- You are able to read pieces of code and comments written in a C-like language.
Our objective are:
- Given a laptop, a Galileo board, its power supply and USB cable, and the Arduino
IDE archive, you’ll be able to plug all these tools together and run a demo which
will blink the on-board LED.
- Given the previously stated tools, a LED and a simple sensor, you’re able to run a
demo program to blink the LED according to the sensor state.
In general,
Our goal is to provide a simple overview of what you can realize with an Arduino
board. It also gives you material to compare Arduino side and Linux side of the Intel
Galileo board.
Before you start
What do you need?
Desktop OS
We assume you’re under Microsoft Windows.
Linux and Mac users should not have any problem to do the same.
Hardware
- An Intel Galileo Development Board.
- The box comes with power supply and cable.
- USB cable (with a B connector to plug on Galileo and your laptop).
- A blue LED and a bi-directional flexible bend sensor,
You do not need a microSD card for this practical class.
Software
Intel Galileo Arduino SW (IDE and drivers) archive unzipped.
https://communities.intel.com/docs/DOC-22226
Galileo’s Arduino side
Plug – Boot – Connect
Step 1
Plug the power supply and wait for the USB green LED to be on.
Do not proceed to step 2 until it’s green (booting).
Step 2
Connect the USB cable
to the USB client port,
not the USB host port.
Checking step (under Linux only)
Try this command: ls –la /dev | grep ACM
You’ll see a new Linux device called /dev/ttyACM
Development Environment
Installing Galileo drivers for Windows
- Tell Windows that drivers are in arduino-1.5.3/drivers.
- Once the driver is installed, start the Arduino IDE.
- Select the COM port in Tools > Serial Port.
Development Environment
Running an Arduino demo
- Open the Blink demo: Files>Examples>01.Basics>Blink
- A new window is opened, click on Validate and Upload
- Look at the LED on the board! It’s blinking!
Does not work?
Path too long?
Check your IDE is in a short path. For example, more your
IDE to C:\ or / (Linux fs root) and try again.
Port COM is not in the menu?
If you cannot see the serial port, it means Galileo is not
installed correctly. Under Windows, go to the device
manager (Control panel) to handle the problem.
Please not for Linux
Under Linux, select ttyACM instead of COM in the menu.
Conclusion
Arduino hardware and software compatibility
- Arduino library is available for Galileo, except functions
that were using directly Atmega assembly language.
- Arduino shields can be connected and used on Galileo.
Linux is not so far…
- On Galileo, a sketch is executed by the firmware or by a
Linux service.
- It’s all implemented in C and open source.
Next step
Booting the board with an embedded Linux
We’re going to explain how to install and run Linux on Galileo.
Doing the same little project with Linux
When you write an Arduino sketch, it’s run by a very tiny Linux,
stored on the board. So, with a Linux system on a microSD card,
we can do the same thing!
Integrating Galileo in bigger projects
Galileo is able to use USB, control motors, LED strips.
It can also run a server and send/receive orders from
anything! (an Android tablet?)
License Creative Commons – By 3.0
You are free:
• to Share — to copy, distribute and transmit the work
• to Remix — to adapt the work
• to make commercial use of the work
Under the following conditions:
• Attribution — You must attribute the work in the manner specified by the author or licensor (but
not in any way that suggests that they endorse you or your use of the work).
With the understanding that:
• Waiver — Any of the above conditions can be waived if you get permission from the copyright
holder.
• Public Domain — Where the work or any of its elements is in the public domain under applicable
law, that status is in no way affected by the license.
• Other Rights — In no way are any of the following rights affected by the license:
–
–
–
•
Your fair dealing or fair use rights, or other applicable copyright exceptions and limitations;
The author's moral rights;
Rights other persons may have either in the work itself or in how the work is used, such as publicity or
privacy rights.
Notice — For any reuse or distribution, you must make clear to others the license terms of this
work. The best way to do this is with a link to this web page.
http://creativecommons.org/licenses/by/3.0/