element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • 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
Raspberry Pi
  • Products
  • More
Raspberry Pi
Blog TFTweet: Alamode connects Arduino shield to the Raspberry Pi
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Raspberry Pi requires membership for participation - click to join
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
GPIO Pinout
Raspberry Pi Wishlist
Comparison Chart
Quiz
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: fustini
  • Date Created: 13 Dec 2012 5:02 AM Date Created
  • Views 1245 views
  • Likes 3 likes
  • Comments 1 comment
Related
Recommended
  • source_code
  • rpibeginner
  • raspberry_pi
  • alamode
  • adafruit
  • arduino

TFTweet: Alamode connects Arduino shield to the Raspberry Pi

fustini
fustini
13 Dec 2012
imageWant to build this project?
View Parts

 

I finally got a got a chance a couple weeks ago to experiment with my Alamode from Wyolum.  It's an The specified item was not found.-compatible board with an ATMega328 that sits on top of the Raspberry Pi.  It has has headers for Arduino shields and also features a real-time clock and microSD card reader:

image

The setup for the Alamode on the Pi is pretty simple when following Wyolum's Getting started guide.  Essentially, you'll need to install the Arduino package via apt and then download and run the Alamode setup script.  The setup script disables the system console on the Pi's serial port in /etc/inittab.  The Pi's serial port is instead used to upload sketches onto the Alamode's ATMega328 and also used for communication (such as with the Arduino IDE's serial monitor).

 

I don't typically have my Pi hooked up to a display, but instead log into it remotely from my laptop via ssh to work on my projects in the shell.  It turned out to be simple to be able to display the Arduino IDE (running on the Pi) on my laptop.  My laptop is running Linux (Ubuntu 12.04), so I just had to edit /etc/ssh/ssh_config to uncomment ForwardX11Trusted and ensure it was set to yes:

 

Host *
#  ForwardAgent no
#  ForwardX11 no
ForwardX11Trusted yes
#  RhostsRSAAuthentication no
#  RSAAuthentication yes
<snip>

 

This allows the GUI applications running on the Pi to be displayed on my laptop and controlled by the laptop's keyboard and mouse.  I then just have to log into the Pi via ssh with the "-X" to enable X11 (e.g. XWindows) forwarding:

 

afustini@lappy486:~$ ssh -X pi@192.168.1.245

 

After logging in, I simply type "arduino" at the shell prompt, hit enter, and the Arduino IDE appears on my laptop:

image

The Arduino IDE works as usual and there is an entry in Tools->Board for the AlaMode (which uploads the sketch via the Pi's serial port):

image

Last year I bought an Adafruit 2.8" TFT LCD touchscreen shield but never really found a project for it.  I've been working a lot with the Pi lately and have wanted a small LCD that could display crisp text and graphics (unlike "fuzzier" composite-input LCDs).  The Alamode presented me with the opportunity to use the TFT Arduino shield, but this time with the power of a Linux behind it thanks to the Pi.

 

My previous project displayed tweets on a character LCD connected to a Pi, so I figured I would try to adapt it for the Pi, Alamode & TFT shield sandwich:

image

To start off, I went through Adafruit's 2.8" TFT shield tutorial to download all the necessary Arduino libraries onto the Pi and run the example sketches to get a handle on what the TFT shield can do.  I then started changing their graphicstest.pde example to see what text size I liked as I wanted to be sure I could fit the Twittter max of 140 characters.  The TFT library will automatically wrap the cursor around to the next line so you only have to be concerned about when the screen is full.  Here's the bulk of the main loop:

 

 

It waits for characters over the serial port from the Pi and then just writes them to the display.  If there is a newline (\n), then the screen will be cleared and the cursor moved to the top left.  The Python script running on the Pi writes the tweets to the serial port with a newline at the end of each tweet.  Here's the full tftweet sketch:

 

https://github.com/pdp7/tweetypi/blob/master/tftweet/tftweet.ino

 

The Python script that I mentioned is based on the HashTagDisplay class from my earlier character LCD project but without more complicated character LCD display logic.  This is the gist of how tweets are written to the serial port:

 

 

The full alatweet.py script is located here:

 

https://github.com/pdp7/tweetypi/blob/master/alatweet.py

 

And here's a video of it all in action displaying tweets for hashtag #raspberrypi:

 

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

 

 

Cheers,

Drew

http://twitter.com/pdp7

 

(note: this is a not an entry for the Double Your Memory Challenge)


 

 

element14
Product Name*DescriptionBuy All Parts
Raspberry Pi Model B with SD Card Raspberry Pi model B and 8GB SD Card with NOOBS preinstalled
Optical Mouse Basic USB optical mouse
Raspberry Pi Power Supply 120-240v to 5V power supply with micro USB connector
Keyboard Basic USB keyboard
Adafruit Touchscreen shield 2.8” TFT LCD touchscreen shield for Arduino
Additional Parts
Product Name*Description
AlaMode expansion boardArduino compatible expansion board for Raspberry Pi

 

*Products and resources listed are listed to help members build their own Pi Projects. They are suggestions and listed for educational purposes. For substitutions of any parts, please post a question asking the original author.
  • Sign in to reply

Top Comments

  • Former Member
    Former Member over 12 years ago +1
    The presence of real-time clock and microSD card reader makes this a sweet deal. Hope all popular Arduino shields fit and work on Alamode. Thanks for the heads up.
  • Former Member
    Former Member over 12 years ago

    The presence of real-time clock and microSD card reader makes this a sweet deal. Hope all popular Arduino shields fit and work on Alamode. Thanks for the heads up.

    • 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