Arduino + LCD + PHP, Part 2

The epic adventure with Arduino, LCDs, and PHP continues. I’ve finally made some progress in terms of breaking up the words and lines appropriately. It felt like a huge achievement, since I had been trying to figure out this line-break thing for quite a while.

You can check the majority of the progress in the video below, and all of the steps along the way are below! Don’t mind the nonsensical example texts. So first off, I figured out I needed to send Arduino very specific information to know where to line break.

I used PHP wordwrap to break words appropriately, then sent Arduino a * to identify a line break.

Doing it this way also helped to make it more obvious where words needed to be wrapped, including when there was punctuation.

I used a SwitchCase to do some tests — I did this at first just to test to make sure the Serial port was receiving the appropriate information and to ensure that Arduino could act on receiving letters.

Then, I changed the code to be a bit to actually do what I needed it to do — in this case, set the cursor to the next line.

There was some trial and error along the way, the text wasn’t moving to the appropriate lines.

You can see, I was really just piecing this together from other code examples … but it turned out to help a lot and set the groundwork for this to work how I wanted.

Finally, the text being wrapped like it needed to!!!

A close up of the glory.

This code worked to print out each character.

Another random text, just to make sure this was working and not just a fluke.

I added some more switch cases to start identifying a page break, that is, spanning the text over two screens.

You can see here some of the testing I was doing in PHP.

And some more of the testing, having output into a browser so I could make sure that it was doing what I wanted it to.

And here’s the result — a 140 character message automatically spans across two screens and knows where to break words to span accordingly. Since then, I was speaking with Mike Beauchamp (ex-Windsorite / DIY tech genius) and he provided some interesting ideas in terms of how to work the communication portion of this project. Could be very useful, so I included a couple of those links below.

Next steps that I’ve already begun include working towards using PHP to parse a text file (I figure that’s one possibility to hold the text messages and Twitter tweets), or alternatively using an RSS feed to deliver both to the LCD (that is, assuming the email part of the text message configuration I’m currently considering could do that).

Annotated Bibliography

http://www.sparkfun.com/commerce/categories.php?c=66 (ideas from Mike Beauchamp)

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1227581530/0 (ideas from Mike Beauchamp)

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1264895784/9 (serial communication with PHP)

http://www.tizag.com/phpT/php-string-strpos.php (string position tutorial)

http://www.arduino.cc/en/Tutorial/TextString (potential to use Arduino rather than PHP for string manipulation)

http://www.tizag.com/phpT/fileread.php (open a text file and read data from it)

http://veritrope.com/tips/export-apple-mail-messages-and-notes-to-text-files/2 (export mail messages to text file)

http://www.tech-recipes.com/rx/878/check-google-e-mail-gmail-from-an-rss-feed/ (check gmail as rss feed)

http://googlesystem.blogspot.com/2008/03/feed-for-unread-gmail-messages.html (more info on gmail rss feeds, needs feed authentication)

http://davidwalsh.name/gmail-php-imap (php + imap + gmail output)

http://g33k.wordpress.com/2009/02/04/check-gmail-the-python-way/ (gmail + python)

http://www.hashbangcode.com/blog/disemvoweling-php-function-1077.html (disemvoewling PHP)

I would like to thank the Canada Council for the Arts for their generous support.

Tagged:

Related Posts: Parsing RSS Feeds for the Arduino + LCD + PHP project More Arduino + LCD + PHP fun Getting Things to Talk: Arduino + LCDs

Previous: « Next: »


Leave a Reply






Location

Windsor from Google Maps' perspective

Windsor, Ontario (South of Detroit)

SRSI: June 11 to July 11

The Storefront Residencies for Social Innovation invites the radical re-imagining of the possibilities in occupying a vacant storefront in the heart of Windsor for one month.

See the entire schedule here!!!

Mailing List


 

Activity

Follow us on Twitter

Conversations

  • Justin: I really like the distinction you pointed out between play and help. Looks like an amazingly fun time and all the better that you...
  • Rosina: yes. talk about this tomorrow/today?
  • Justin: Yeah, I think it could be very cool. You’re thinking about that lenticular rabbit you on posted on a while back as a...
  • Rosina: Serious? I would be down for it!
  • Justin: Rosina, awesome idea! The foot traffic there in both directions would really lend itself to this. Let’s do it.
  • Rosina: you know, looking at the stairs i thought a lenticular type thing would be kind of cool to see. Perhaps a two-sided message of...
  • darren: I was able to go for my usual ride to the end of Russell in the west end, thanks to the humidity finally going down a bit....
  • leesa: fantastico! i miss srsi already. congrats everyone.

Archives

Tags

3D 100 ways abandoned activism advertisements air airport algorithm Ambassador Bridge analog annotate architecture arduino art artist Artspace automobile awesome baking balloons banner banners battery BCL Bench bicycle bike bikes billboard billboards bio Blog book border brainstorm buildings bus Canada casino cellphone chalk Chattanooga cities city citynoise code collaboration collaborative collective community computer computers conference Conflux construction consultancy context costume crafts create here cross-border communication crowd-sourcing data database demo design Detroit development DIY documentary documentation downtown drawing driving ecohouse economy EC Row editing electricity electronics energy environment eric boucher event exhibition exploring extended field trip fake fashion fence fieldtrip fire firefox flagging tape font free friends gallery gambling game garbage garden gardening geography google google earth google maps graffiti grants grass green Green Corridor guerilla hack Halloween hardware history house how to HQ ice ideas image imagination Indian Road inflatable infrastructure install installation inter-city interactive internet intervention interventions interview kids Kitchener knitting LCD Lebel LED letters light lights list lists machine magnetic magnets make mapping maps materials math message michelles Michigan micro-residency mind map moss movie music nature neighbourhood news newspaper newspapers New York new york city night office hours open source opportunity paint painting paper paperwork parade park parking garage parking ticket participation party pedagogy performance perspective Peterborough photographs photography PHP pixel planning plant planters plants plastic bags pollution Portland postcards post office presentation project projection projector projects proposal psychogeography public public art public domain public realm public space pulp radio Rain reading reblog recycle remote research residency resistors reuse ribbons river roof rope Sandwich Save the City school screening sculpture sculptures security seed bombs seeds sign signage snow social practice software soldering sound Soundart space spray paint SRSI stencil stencils stickers storefront story strategic plan street street art street art submissions suburb summer surveillance sustainability sweaters tags talk tape tea technology test tetris text Text In-Transit time-lapse tools Toronto transit transmit travel tree trees tshirts tv Twitter university urban video visualization walk walking wall water Waterloo website wheat paste window Windsor wireless workshop writing youth youtube

Our Recent Research

Research Description

Broken City Lab is an interdisciplinary creative research group that tactically disrupts and engages the city, its communities, and its infrastructures to reimagine the potential for action in a collapsing post-industrial city.

Save the City

Broken City Lab: Save the City
5 months of community events to imagine how to save this city.

Subscribe

Broken City Lab RSS icon Blog RSS

Broken City Lab RSS icon Comments RSS

Events

The Storefront Residencies for Social Innovation: Launching June 11, 2010 June 11 to July 11, 2010

How to Save a City May 21, 2010 - 7pm

Open Engagement, Group Work: The Collective Impetus May 14-17, 2010

Things Worth Saving April 11 & 27th, 2010

Creative Cities Summit: Using Art to Change Cities in Lexington, Kentucky Apr 7-9, 2010

» More Events...

Cross-Border Communication

Cross-Border Communication: We're In This Together
Cross-Border Communication is an interventionist performance series based on the desperate need to communicate with Detroit from Windsor.

Most Read Posts

Contact

info@brokencitylab.org

Bookmarks

What We're Reading

Links

Meta