String input from serial input instead of static progmem?

mtdew1459
Posts: 1
Joined: Tue Mar 17, 2009 3:25 pm

String input from serial input instead of static progmem?

Post by mtdew1459 »

Hello there. So I have 3 of the 8x8 LED boards connected together. I love how they function and how simple it was to put everything together. Everything is working great, but I wasn't expecting to not be able to use a different input than to upload a new Arduino sketch with new strings to display. My programming skills are pretty beginner, but I have been studying your sample Arduino sketches for about three weeks. Unfortunately I still haven't been successful with getting the string input from a dynamic source instead of the static read only array in progmem.

I was curious if you or anybody else has had success with this. I anticipated to use these panels as a scrolling RSS reader or a notification system for various things. Do you have any code for a serial buffer input or any tips or ideas on how I might be able to accomplish this goal?

I know your time is valuable and I appreciate anybodies input.

----
I am using your BBB and have also used a new Arduino Duemilanove with the Atmega 328 chip.

I love your products and appreciate your hard work. Thanks again!

oz
Site Admin
Posts: 542
Joined: Mon May 12, 2008 4:19 pm

Re: String input from serial input instead of static progmem?

Post by oz »

Your RAM is limited so you're going to have fit your text (and program) into 1k or 2k with a 328.
Make sure you don't overrun the memory because this will kill your sketch (but not give you any warning or indication about what is going on).
So take little bites out of your RSS string at one time.

If you've got that RSS part going, send me your code and I'll show you how to splice it into what I've got.
Or alternately I could try and pull some live text off the tx line from Arduino IDE and send that.

The big picture would be to find where I'm reading the array and to try to splice in your own string there.

Paul

mbmosher
Posts: 6
Joined: Fri Mar 12, 2010 1:58 am

Re: String input from serial input instead of static progmem?

Post by mbmosher »

I am wondering about this two. Is there a way to just use the Serial Monitor in the Arduino desktop application to send new text to the display? Or even switch between two different strings in the code? Running panel.Begin more than once just seems to confuse it...

oz
Site Admin
Posts: 542
Joined: Mon May 12, 2008 4:19 pm

Re: String input from serial input instead of static progmem?

Post by oz »

mtdew1459,

I thought this was in dataman's library, I know he wrote some code to solve this problem. Other people have also said they bought boards to do this. I'll poke around and get back to you. In the meantime, dig through the library and see what you find.

Paul

dataman
Posts: 13
Joined: Fri Sep 04, 2009 1:12 pm

Re: String input from serial input instead of static progmem?

Post by dataman »

Yup, You're right Paul,
I covered this in example 6 of my library.
http://code.google.com/p/panel8x8/wiki/Panel8x8Control

Basically, Panel8x8 control is a text window,
Type in some text, and it appears on the panel.
Since I had this working pretty well,

I decided to code a Twitter Reader,
Same program, just fill in your user name and password,
This periodically scans twitter for your most recent activity,
Or that of your friends.

It would be fairly easy to modify the Twitter Reader into an RSS reader.
Panel8x8 control was writting in vb.net,
But the same techniques would work for any language that can output serial.
The key is Example 6 and the Panel8x8 library.

Panel8x8 is pretty flexible,
It's able to display either text or graphics to an 8x8 panel with ease.
Examples for Serial Updating, Direct Ethernet, Direct Wireless, and SD card updating are provided.

dataman
Posts: 13
Joined: Fri Sep 04, 2009 1:12 pm

Re: String input from serial input instead of static progmem?

Post by dataman »

From Panel8x8 Wiki:
http://code.google.com/p/panel8x8/wiki/Panel8x8Serial

To make the panels wait for serial data,
Run the following sketch on the arduino:

#include <Panel8x8Serial.h>
Panel8x8Serial panel;
char *buffer[512]=". ";
void setup(){panel.Begin(buffer,512,strlen(buffer),0);}
void loop(){panel.Loop();}

The command sequences are:
Esc C Clear Panels
Esc I + FrameDelay + Length + Text Load Text
Esc F + Version + Panels + FrameDelay + Data Load Animation to RAM
Esc L + Version + Panels + FrameDelay + Data Live Stream Animation
Esc S + Byte + Data Settings Mode (Future use)

If I'm not mistaken, parameters are 2 byte integers, lobyte hibyte order

To send a text to the board using the panel 8x8 library,
Simply send <27>I<100><0><14><0>This is a test
Where <xx> is an unsigned character value.
<27> =Command Start
I =The command, send text
<100><0> =Delay 100
<14><0> 14 =Characters
This is a test = The payload

dataman
Posts: 13
Joined: Fri Sep 04, 2009 1:12 pm

Re: String input from serial input instead of static progmem?

Post by dataman »

Also note, and no offense intended,
Paul's Demo Code only works for 2 panels.

Panel8x8 Library has been tested with 10 panels.

mbmosher
Posts: 6
Joined: Fri Mar 12, 2010 1:58 am

Re: String input from serial input instead of static progmem

Post by mbmosher »

Ok, so it can do serial, wifi, ethernet, and sd updates, but it can't be updated just from the arduino itself? Like if I have motion sensor I couldn't get the panel to display X if there is motion and Y if there is not motion?

Also, I couldn't get this code to do anything besides scroll at dot:

#include <Panel8x8Serial.h>
Panel8x8Serial panel;
char *buffer[512]=". ";
void setup(){panel.Begin(buffer,512,strlen(buffer),0);}
void loop(){panel.Loop();}

I am typing this into the serial monitor: <27>I<100><0><14><0>This is a test

In your post you mention: Where <xx> is an unsigned character value. But I don't see <xx> anywhere in that code...

I also tried typing this into the serial monitor: <27>C
To clear the dot, but nothing happened. Not sure if that's how C is supposed to work.

If it matters, I'm using four panels, and RBBB, and a USB bub.

Ideally what I am going for is to read SMS messages of a cellphone via serial AT commands and display them on the 8x8s.

Thanks for the help!


Edit: Woah, ok, so I tried again and got this error: array must be initialized with a brace-enclosed initializer In function 'void setup()': Which I think is in refernece to the char *buffer. I was using the panel8x8serial example before, which just has char buffer

mbmosher
Posts: 6
Joined: Fri Mar 12, 2010 1:58 am

Re: String input from serial input instead of static progmem

Post by mbmosher »

No one knows how to do this?


Also, in looking at the .cpp code I think the new text escape character is T not I. But still, putting "<27>T<100><0><14><0>This is a test" into the serial monitor doesn't do anything, same scrolling dot.

mbmosher
Posts: 6
Joined: Fri Mar 12, 2010 1:58 am

Re: String input from serial input instead of static progmem

Post by mbmosher »

Ok, so in slowing down the serial code and throwing some Serial.prints in there I found that sr will never be 27 as Serial.read(sr) reads one character at a time, so I reset the Esc charater from '27' to 'E'. So now putting EC into the serial monitor actually does clear the panels. No luck getting new Text entry however with a line like ET1000140This is a test.

mbmosher
Posts: 6
Joined: Fri Mar 12, 2010 1:58 am

Re: String input from serial input instead of static progmem

Post by mbmosher »

Has no one been able to change the panel text without having to recode the arduino yet? Wild...

oz
Site Admin
Posts: 542
Joined: Mon May 12, 2008 4:19 pm

Re: String input from serial input instead of static progmem

Post by oz »

mbmosher,

There is an example for this in the library I believe. I've got a sign going that uses an Android phone to update the message on the sign - through our host board so I know it's fairly easy to do. I'll post the code for the sign and some video tomorrow when I get to work.

Paul

mbmosher
Posts: 6
Joined: Fri Mar 12, 2010 1:58 am

Re: String input from serial input instead of static progmem

Post by mbmosher »

Did you post that code somewhere or did I miss it? Thanks.

oz
Site Admin
Posts: 542
Joined: Mon May 12, 2008 4:19 pm

Re: String input from serial input instead of static progmem

Post by oz »

Nope - fell through the cracks - I'm also committed until Saturday.
I'll put it on the list for the weekend.

Paul

Post Reply