element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Sci Fi Your Pi
  • Challenges & Projects
  • Design Challenges
  • Sci Fi Your Pi
  • More
  • Cancel
Sci Fi Your Pi
Blog Sci Fi Your Pi: PiDesk - Project Update #7
  • Blog
  • Forum
  • Documents
  • Files
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: fvan
  • Date Created: 31 May 2015 7:45 PM Date Created
  • Views 447 views
  • Likes 5 likes
  • Comments 1 comment
  • design_challenge
  • touch_motion_controls
  • touch_motion_control
  • sci_fi_your_pi
Related
Recommended

Sci Fi Your Pi: PiDesk - Project Update #7

fvan
fvan
31 May 2015

Previous posts for this project:

  • Sci Fi Your Pi: PiDesk - Project Description
  • Sci Fi Your Pi: PiDesk - Project Update #1
  • Sci Fi Your Pi: PiDesk - Guide: Setting Up the Raspberry Pi 2
  • Sci Fi Your Pi: PiDesk - Project Update #2
  • Sci Fi Your Pi: PiDesk - Review: Bare Conductive Touch Board
  • Sci Fi Your Pi: PiDesk - Project Update #3
  • Sci Fi Your Pi: PiDesk - Guide: Stepper Motors with Gertbot
  • Sci Fi Your Pi: PiDesk - Project Update #4
  • Sci Fi Your Pi: PiDesk - Project Update #5
  • Sci Fi Your Pi: PiDesk - Guide: Controlling NeoPixels with the Raspberry Pi A+/B+
  • Sci Fi Your Pi: PiDesk - Project Update #6

 

  • Project Update

 

Project Update

 

There was some nice weather in Belgium the past week, and I took the opportunity to prepare the garden for summer. Mowing the lawn, planting some herbs, cleaning the terrace, etc ... This means that I didn't make a whole lot of progress on my project this week, but it doesn't mean I didn't do anything either. For this week's update, I've been combining some components I got up and running in the previous weeks, more specifically: the Touch Board and the Raspberry Pi with LED strip.

 

I hooked up the Touch Board via USB to the Raspberry Pi and had it send PLAYX (where X is the number of the electrode pressed) messages to the Pi over serial. Listing the tty devices, I determined the Touch Board was the "ttyACM0" device.

 

pi@PiDesk ~ $ ls -l /dev/tty
tty        tty17      tty26      tty35      tty44      tty53      tty62
tty0       tty18      tty27      tty36      tty45      tty54      tty63
tty1       tty19      tty28      tty37      tty46      tty55      tty7
tty10      tty2       tty29      tty38      tty47      tty56      tty8
tty11      tty20      tty3       tty39      tty48      tty57      tty9
tty12      tty21      tty30      tty4       tty49      tty58      ttyACM0
tty13      tty22      tty31      tty40      tty5       tty59      ttyAMA0
tty14      tty23      tty32      tty41      tty50      tty6       ttyprintk
tty15      tty24      tty33      tty42      tty51      tty60

 

I installed "minicom" to verify the expected serial messages where being received by the Pi.

 

pi@PiDesk ~ $ sudo apt-get install minicom
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  lrzsz
The following NEW packages will be installed:
  lrzsz minicom
0 upgraded, 2 newly installed, 0 to remove and 22 not upgraded.
Need to get 420 kB of archives.
After this operation, 1189 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://mirrordirector.raspbian.org/raspbian/ wheezy/main lrzsz armhf 0.12.21-5 [106 kB]
Get:2 http://mirrordirector.raspbian.org/raspbian/ wheezy/main minicom armhf 2.6.1-1 [314 kB]
Fetched 420 kB in 2s (173 kB/s)
Selecting previously unselected package lrzsz.
(Reading database ... 78547 files and directories currently installed.)
Unpacking lrzsz (from .../lrzsz_0.12.21-5_armhf.deb) ...
Selecting previously unselected package minicom.
Unpacking minicom (from .../minicom_2.6.1-1_armhf.deb) ...
Processing triggers for man-db ...
Processing triggers for menu ...
Setting up lrzsz (0.12.21-5) ...
Setting up minicom (2.6.1-1) ...
Processing triggers for menu ...

 

Using the minicom command with parameter "s", the serial port information can be configured. I specified the correct interface and baudrate and could see the messages coming in.

 

pi@PiDesk ~ $ sudo minicom -s

 

imageimage

 

To be able to read from the serial interface from Python, I tried to install the "python-serial" module. It turned out to be pre-installed.

 

pi@PiDesk ~/rpi_ws281x/python/examples $ sudo apt-get install python-serial
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-serial is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 22 not upgraded.

 

After taking the "strandtest.py" NeoPixel strip example and modifying it to react to serial input, the PLAY messages could trigger the LED strip. It does not yet make a distinction between the buttons being pressed, but the mechanism itself is working.

 

pi@PiDesk ~/rpi_ws281x/python/examples $ sudo python button.py
Press Ctrl-C to quit.
PLAY0
PLAY0
PLAY0
PLAY1
PLAY4
PLAY7
PLAY0

 

The Python script reading the serial input and triggering the LED strip can be found here:

 

And finally, a short demo:

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

  • Sign in to reply

Top Comments

  • fvan
    fvan over 10 years ago +1
    Added a short demo video.
  • fvan
    fvan over 10 years ago

    Added a short demo video.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube