Hello. We're artists working through collaborative social practice and creative research to understand the ways in which locality is shaped and enacted in the city.

Arduino + LCD + PHP, Part 2

IMG 7336 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.

IMG 7338 Arduino + LCD + PHP, Part 2

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

IMG 7340 Arduino + LCD + PHP, Part 2

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

IMG 7345 Arduino + LCD + PHP, Part 2

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.

IMG 7359 Arduino + LCD + PHP, Part 2

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.

IMG 7360 Arduino + LCD + PHP, Part 2

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

IMG 7361 Arduino + LCD + PHP, Part 2

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.

IMG 7365 Arduino + LCD + PHP, Part 2

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

IMG 7368 Arduino + LCD + PHP, Part 2

A close up of the glory.

IMG 7369 Arduino + LCD + PHP, Part 2

This code worked to print out each character.

IMG 7370 Arduino + LCD + PHP, Part 2

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

IMG 7372 Arduino + LCD + PHP, Part 2

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

IMG 7376 Arduino + LCD + PHP, Part 2

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

IMG 7379 Arduino + LCD + PHP, Part 2

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.

CCFA bar Arduino + LCD + PHP, Part 2

  • Facebook
  • Twitter
  • del.icio.us

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






Mailing List


 

  • Facebook
  • Twitter
  • del.icio.us

Recent Comments

  • Justin Langlois: That’s way better! Nice call. How about this instead of my news one? -An understanding of the feeling of...
  • Michelle Soulliere: MR ALLAN’S! How about instead of Fox news let’s say WDET radio. Detroit Public Television?
  • Andy: Memories of Tiger Stadium. The White Stripes. Very olf freeways. Abundance of steel infrastructure. $29 or 2/$50. Hotel Yorba.
  • Andy: Utrecht, hardwood floors and Call Phone are amazing.
  • Justin Langlois: “Instant street cred” is amazing. Good call on the Detroit News … I guess there’s something...
  • Michelle Soulliere: Nice ones! However, I would say that Detroit news is a reason why I DON’T like Detroit as opposed to liking it....
  • Justin Langlois: Wooo! Nice start, Michelle… I’ll add: -A sense of utter possibility -Rumours about rumrunning -Architectural...
  • Michelle: love y’all! MAKE THIS…..BALANCE.

Archives

Tags