Difference between revisions of "ASEE 2013 Workshop"

From eLinux.org
Jump to: navigation, search
(Initial Page)
 
m (Warm Up: Initial page)
Line 13: Line 13:
 
[[File:PuTTYloging.jpg|thumbnail]]
 
[[File:PuTTYloging.jpg|thumbnail]]
  
 +
At this point you need to learn a few simple Linux commands for creating and displaying files. Once you know these commands it's easy to turn an LED on and off.
 +
 +
First, let's edit a file using the '''nano''' editor.  Nano is a simple editor that easy to learn. This will edit (and create) the file '''play'''.
 +
 +
bone$ '''nano play'''
 +
 +
Add a couple of lines of text to the file, it doesn't really matter what and then Exit. You can list the files in the current directory with '''ls''' and show the contents of a file with '''cat'''.
 +
bone$ '''ls'''
 +
Desktop  play
 +
bone$ '''cat play'''
 +
A couple of lines
 +
of text.
 +
 +
Use '''echo''' to print a line of text.
 +
bone$ '''echo This is a line of text'''
 +
This is a line of text
 +
 +
Here's a powerful operator.  You can take the output of any command and redirect it to a file with '''>'''.
 +
 +
bone$ '''echo This is a line of text > here'''
 +
bone$ '''cat here'''
 +
This is a line of text
 +
 +
We are almost there.  Use '''cd''' to change directories.  '''/''' is the top level directory.
 +
bone$ '''cd /'''
 +
bone$ '''ls'''
 +
bin  dev  home  lost+found  mnt  run  sys  usr
 +
boot  etc  lib  media      proc  sbin  tmp  var
 +
 +
If you ever get lost, '''cd''' alone takes you home.
 +
bone$ '''cd'''
 +
gone$ '''ls'''
 +
Desktop  here  play
 +
 +
Now you are ready to flash an LED.
  
 
== Blinking an LED ==
 
== Blinking an LED ==

Revision as of 18:03, 10 June 2013

thumb‎ Embedded Linux Class by Mark A. Yoder


Here are the labs for the afternoon Linux part of the ASEE 2013 Workshop

Warm Up

PuTTYconfiguration.jpg

Before we can interact with LEDs and switches we need to learn some simple Linux commands.

  1. On your host computer, running Windows, start up puTTY.
  2. If you get a Security Warning, click Run.
  3. Enter 192.167.7.2 in the Host Name field and click Open
  4. Login as root with no password.
  5. Enter ls to list what files you have. You shouldn't see much.
PuTTYloging.jpg

At this point you need to learn a few simple Linux commands for creating and displaying files. Once you know these commands it's easy to turn an LED on and off.

First, let's edit a file using the nano editor. Nano is a simple editor that easy to learn. This will edit (and create) the file play.

bone$ nano play

Add a couple of lines of text to the file, it doesn't really matter what and then Exit. You can list the files in the current directory with ls and show the contents of a file with cat.

bone$ ls
Desktop  play
bone$ cat play
A couple of lines
of text.

Use echo to print a line of text.

bone$ echo This is a line of text
This is a line of text

Here's a powerful operator. You can take the output of any command and redirect it to a file with >.

bone$ echo This is a line of text > here
bone$ cat here
This is a line of text

We are almost there. Use cd to change directories. / is the top level directory.

bone$ cd /
bone$ ls
bin   dev  home  lost+found  mnt   run   sys  usr
boot  etc  lib   media       proc  sbin  tmp  var

If you ever get lost, cd alone takes you home.

bone$ cd
gone$ ls
Desktop  here  play

Now you are ready to flash an LED.

Blinking an LED

Reading a Switch

Analog In

Pulse Width Modulation



thumb‎ Embedded Linux Class by Mark A. Yoder