Author Topic: Axon II - Show Characters in the 7-segment Display  (Read 3812 times)

0 Members and 1 Guest are viewing this topic.

Offline webgeekTopic starter

  • Jr. Member
  • **
  • Posts: 32
  • Helpful? 0
Axon II - Show Characters in the 7-segment Display
« on: December 25, 2009, 10:31:11 PM »
Hi all, I don't know if this is of interest to people but I thought it was fun so I'm posting it here. The Axon II has a nice 7-segment display which I LOVE having but it's limited to showing only digits. I wanted to use it to show critical error information/limited text as well so I updated the Axon2.h file to include the code below. Just insert all this code at the end of line 379 and you should be good to go. Before someone critisizes how I did it, I followed the code already in the file - seems an odd way to set up that type of functionality to me, but I'm sure there is a technical reason for it. I wanted to change it to something like this instead:
Code: [Select]
updateDisplay(top, topLeft, topRight, middle, bottomLeft, bottomRight, bottom, dot); and it'd be used like this (for the letter 'A'):
Code: [Select]
updateDisplay(1, 1, 1, 1, 1, 1, 0, 0);rather than:
Code: [Select]
LED_on(&led_top);
LED_on(&led_top_left);
LED_on(&led_top_right);
LED_on(&led_middle);
LED_on(&led_bottom_left);
LED_on(&led_bottom_right);
LED_off(&led_bottom);
But either way, just insert this block starting at like 379 and then you can show characters as well as digits:
Code: [Select]
    // Start alphabet
    case 'A':
    case 'a':
LED_on(&led_top);
LED_on(&led_top_left);
LED_on(&led_top_right);
LED_on(&led_middle);
LED_on(&led_bottom_left);
LED_on(&led_bottom_right);
LED_off(&led_bottom);
break;
    case 'B':
    case 'b':
LED_off(&led_top);
LED_on(&led_top_left);
LED_off(&led_top_right);
LED_on(&led_middle);
LED_on(&led_bottom_left);
LED_on(&led_bottom_right);
LED_on(&led_bottom);
break;
    case 'C':
    case 'c':
LED_on(&led_top);
LED_on(&led_top_left);
LED_off(&led_top_right);
LED_off(&led_middle);
LED_on(&led_bottom_left);
LED_off(&led_bottom_right);
LED_on(&led_bottom);
break;
    case 'D':
    case 'd':
LED_off(&led_top);
LED_off(&led_top_left);
LED_on(&led_top_right);
LED_on(&led_middle);
LED_on(&led_bottom_left);
LED_on(&led_bottom_right);
LED_on(&led_bottom);
break;
    case 'E':
    case 'e':
LED_on(&led_top);
LED_on(&led_top_left);
LED_off(&led_top_right);
LED_on(&led_middle);
LED_on(&led_bottom_left);
LED_off(&led_bottom_right);
LED_on(&led_bottom);
break;
    case 'F':
    case 'f':
LED_on(&led_top);
LED_on(&led_top_left);
LED_off(&led_top_right);
LED_on(&led_middle);
LED_on(&led_bottom_left);
LED_off(&led_bottom_right);
LED_off(&led_bottom);
break;
    case 'G':
    case 'g':
LED_on(&led_top);
LED_on(&led_top_left);
LED_on(&led_top_right);
LED_on(&led_middle);
LED_off(&led_bottom_left);
LED_on(&led_bottom_right);
LED_on(&led_bottom);
break;
    case 'H':
    case 'h':
LED_off(&led_top);
LED_on(&led_top_left);
LED_off(&led_top_right);
LED_on(&led_middle);
LED_on(&led_bottom_left);
LED_on(&led_bottom_right);
LED_off(&led_bottom);
break;
    case 'I':
    case 'i':
LED_off(&led_top);
LED_on(&led_top_left);
LED_off(&led_top_right);
LED_off(&led_middle);
LED_on(&led_bottom_left);
LED_off(&led_bottom_right);
LED_off(&led_bottom);
break;
    case 'J':
    case 'j':
LED_off(&led_top);
LED_off(&led_top_left);
LED_on(&led_top_right);
LED_off(&led_middle);
LED_on(&led_bottom_left);
LED_on(&led_bottom_right);
LED_on(&led_bottom);
break; 
    case 'K':
    case 'k':
LED_on(&led_top);
LED_on(&led_top_left);
LED_off(&led_top_right);
LED_on(&led_middle);
LED_on(&led_bottom_left);
LED_on(&led_bottom_right);
LED_off(&led_bottom);
break;
    case 'L':
    case 'l':
LED_off(&led_top);
LED_on(&led_top_left);
LED_off(&led_top_right);
LED_off(&led_middle);
LED_on(&led_bottom_left);
LED_off(&led_bottom_right);
LED_on(&led_bottom);
break;
    case 'M':
    case 'm':
LED_on(&led_top);
LED_off(&led_top_left);
LED_off(&led_top_right);
LED_on(&led_middle);
LED_on(&led_bottom_left);
LED_on(&led_bottom_right);
LED_off(&led_bottom);
break;
    case 'N':
    case 'n':
LED_off(&led_top);
LED_off(&led_top_left);
LED_off(&led_top_right);
LED_on(&led_middle);
LED_on(&led_bottom_left);
LED_on(&led_bottom_right);
LED_off(&led_bottom);
break;
    case 'O':
    case 'o':
LED_off(&led_top);
LED_off(&led_top_left);
LED_off(&led_top_right);
LED_on(&led_middle);
LED_on(&led_bottom_left);
LED_on(&led_bottom_right);
LED_on(&led_bottom);
break;
    case 'P':
    case 'p':
LED_on(&led_top);
LED_on(&led_top_left);
LED_on(&led_top_right);
LED_on(&led_middle);
LED_on(&led_bottom_left);
LED_off(&led_bottom_right);
LED_off(&led_bottom);
break;
    case 'Q':
    case 'q':
LED_on(&led_top);
LED_on(&led_top_left);
LED_on(&led_top_right);
LED_on(&led_middle);
LED_off(&led_bottom_left);
LED_on(&led_bottom_right);
LED_off(&led_bottom);
break;
    case 'R':
    case 'r':
LED_off(&led_top);
LED_off(&led_top_left);
LED_off(&led_top_right);
LED_on(&led_middle);
LED_on(&led_bottom_left);
LED_off(&led_bottom_right);
LED_off(&led_bottom);
break;
    case 'S':
    case 's':
LED_on(&led_top);
LED_on(&led_top_left);
LED_off(&led_top_right);
LED_on(&led_middle);
LED_off(&led_bottom_left);
LED_on(&led_bottom_right);
LED_on(&led_bottom);
break;
    case 'T':
    case 't':
LED_off(&led_top);
LED_on(&led_top_left);
LED_off(&led_top_right);
LED_on(&led_middle);
LED_on(&led_bottom_left);
LED_off(&led_bottom_right);
LED_on(&led_bottom);
break;
    case 'U':
    case 'u':
LED_off(&led_top);
LED_off(&led_top_left);
LED_off(&led_top_right);
LED_off(&led_middle);
LED_on(&led_bottom_left);
LED_on(&led_bottom_right);
LED_on(&led_bottom);
break;
    case 'V':
    case 'v':
LED_off(&led_top);
LED_on(&led_top_left);
LED_on(&led_top_right);
LED_off(&led_middle);
LED_on(&led_bottom_left);
LED_on(&led_bottom_right);
LED_on(&led_bottom);
break;
    case 'W':
    case 'w':
LED_on(&led_top);
LED_off(&led_top_left);
LED_off(&led_top_right);
LED_off(&led_middle);
LED_on(&led_bottom_left);
LED_on(&led_bottom_right);
LED_on(&led_bottom);
break;
    case 'X':
    case 'x':
LED_off(&led_top);
LED_on(&led_top_left);
LED_on(&led_top_right);
LED_on(&led_middle);
LED_on(&led_bottom_left);
LED_on(&led_bottom_right);
LED_off(&led_bottom);
break;
    case 'Y':
    case 'y':
LED_off(&led_top);
LED_on(&led_top_left);
LED_on(&led_top_right);
LED_on(&led_middle);
LED_off(&led_bottom_left);
LED_on(&led_bottom_right);
LED_on(&led_bottom);
break;
    case 'Z':
    case 'z':
LED_on(&led_top);
LED_off(&led_top_left);
LED_on(&led_top_right);
LED_on(&led_middle);
LED_on(&led_bottom_left);
LED_off(&led_bottom_right);
LED_on(&led_bottom);
break;
    // end alphabet
For reference, I picked the letters from the representation here:
http://en.wikipedia.org/wiki/Seven-segment_display_character_representations

I know the code for the Axon II is on SourceForge under WebbotLib but I wasn't sure how people felt about contributors there so until I hear otherwise, I'll just post any changes I come up with here. Thanks and have fun!

Mike

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,659
  • Helpful? 169
    • Society of Robots
Re: Axon II - Show Characters in the 7-segment Display
« Reply #1 on: December 26, 2009, 12:26:55 AM »
I like this.

I'll see what I can do to get this officially added to WebbotLib.

Offline SmAsH

  • Supreme Robot
  • *****
  • Posts: 3,959
  • Helpful? 75
  • SoR's Locale Electronics Nut.
Re: Axon II - Show Characters in the 7-segment Display
« Reply #2 on: December 26, 2009, 05:24:52 AM »
Wow, i don't even have an axon 2 and i think this is great.
Well done mate ;)
Howdy

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,150
  • Helpful? 109
Re: Axon II - Show Characters in the 7-segment Display
« Reply #3 on: December 26, 2009, 06:53:09 AM »
I'll add it in to the next release but pack each character into a single byte stored in program flash memory
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline webgeekTopic starter

  • Jr. Member
  • **
  • Posts: 32
  • Helpful? 0
Re: Axon II - Show Characters in the 7-segment Display
« Reply #4 on: December 26, 2009, 09:55:57 PM »
Quote
I'll add it in to the next release but pack each character into a single byte stored in program flash memory
Ah, that's a much nicer solution than what I was suggesting. Seems like using a single byte plus a touch of logic to break that into segments dynamically will actually reduce the overall file size even with the rest of the alphabet included as you can remove all the different LED_on/off calls that are in there now to a single generic system.

One other request - can you add a method for animating text messages? Something like:
animateDisplay("this is my message", 500);
Where the input is a string/char[] and the number of milliseconds to display each character? I was going to add this to my code but didn't get around to it today. It would be really nice to add in there and would round out this bit of functionality nicely.

Anyways, thanks for the kind comments and for adding this into the library, it seemed generally useful to me and I'm glad others thought so too!

-Mike

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,659
  • Helpful? 169
    • Society of Robots
Re: Axon II - Show Characters in the 7-segment Display
« Reply #5 on: December 26, 2009, 11:48:17 PM »
Quote
One other request - can you add a method for animating text messages? Something like:
animateDisplay("this is my message", 500);
Man, you're on a role with good ideas lately!

I originally just imagined the display as a debugging tool, never thought of it displaying text messages!

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,150
  • Helpful? 109
Re: Axon II - Show Characters in the 7-segment Display
« Reply #6 on: December 27, 2009, 07:08:52 AM »
One other request - can you add a method for animating text messages? Something like:
animateDisplay("this is my message", 500);
Where the input is a string/char[] and the number of milliseconds to display each character? I was going to add this to my code but didn't get around to it today. It would be really nice to add in there and would round out this bit of functionality nicely.


I was planning to do that already - a Marquee display where you can set not only the delay between characters but also the pause after the last character before repeating with some 'magick value' that means don't repeat the message.

It will be declared as a 'Writer' function so that it can be called directly or used as the destination of an 'rprintf'.

Also, in the same way as 'error messages' can already be output to a UART, or the flashing dot of the segment display, then it will also be able to go to the segment display ie:  Error -10

Since the Marquee function will need to hold onto the text to be displayed in RAM (so that it can scroll as a background task) then I will need to limit the maximum length of the string. Perhaps a default of, say, 20 characters but allow the use to override it with a #define in their own program


Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,150
  • Helpful? 109
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline webgeekTopic starter

  • Jr. Member
  • **
  • Posts: 32
  • Helpful? 0
Re: Axon II - Show Characters in the 7-segment Display
« Reply #8 on: December 28, 2009, 07:56:26 AM »
Great, thanks! I'll test it out this morning on the Axon II and post a video with the results as soon as I get a chance.

-Mike

Offline webgeekTopic starter

  • Jr. Member
  • **
  • Posts: 32
  • Helpful? 0
Re: Axon II - Show Characters in the 7-segment Display
« Reply #9 on: December 28, 2009, 10:47:54 AM »
Ok, I created a new program to test this out with no luck. I downloaded the 1.13 webbotlib and dumped it on my machine, set up a new project and tried to compile - this is the result:
Code: [Select]
avr-gcc -mmcu=atmega640 -Wl,-Map=Test7Segment.map Test7Segment.o   -L"C:\projects\robots\webbotlib-1.13"  -lWebbot-ATMega640 -lc -lm  -o Test7Segment.elf
C:\projects\robots\webbotlib-1.13\libWebbot-ATMega640.a(segled.o): In function `marqueeIsActive':
/segled.h:86: multiple definition of `marqueeIsActive'
Test7Segment.o:C:\projects\robots\Test7Segment\..\webbotlib-1.13/sys/../segled.h:85: first defined here
C:\projects\robots\webbotlib-1.13\libWebbot-ATMega640.a(segled.o): In function `marqueeSetCharDelay':
/segled.h:89: multiple definition of `marqueeSetCharDelay'
Test7Segment.o:C:\projects\robots\Test7Segment\..\webbotlib-1.13/sys/../segled.h:89: first defined here
C:\projects\robots\webbotlib-1.13\libWebbot-ATMega640.a(segled.o): In function `marqueeSetEndDelay':
/segled.h:95: multiple definition of `marqueeSetEndDelay'
Test7Segment.o:C:\projects\robots\Test7Segment\..\webbotlib-1.13/sys/../segled.h:95: first defined here
C:\projects\robots\webbotlib-1.13\libWebbot-ATMega640.a(segledMarquee.o): In function `marqueeIsActive':
/segled.h:86: multiple definition of `marqueeIsActive'
Test7Segment.o:C:\projects\robots\Test7Segment\..\webbotlib-1.13/sys/../segled.h:85: first defined here
C:\projects\robots\webbotlib-1.13\libWebbot-ATMega640.a(segledMarquee.o): In function `marqueeSetCharDelay':
/segled.h:89: multiple definition of `marqueeSetCharDelay'
Test7Segment.o:C:\projects\robots\Test7Segment\..\webbotlib-1.13/sys/../segled.h:89: first defined here
C:\projects\robots\webbotlib-1.13\libWebbot-ATMega640.a(segledMarquee.o): In function `marqueeSetEndDelay':
/segled.h:95: multiple definition of `marqueeSetEndDelay'
Test7Segment.o:C:\projects\robots\Test7Segment\..\webbotlib-1.13/sys/../segled.h:95: first defined here

This is the program I'm using:
Code: [Select]
#include "sys/axon2.h"

void appInitHardware(void) {
uartInit(UART1, 230400);
}

TICK_COUNT appInitSoftware(TICK_COUNT loopStart){
return 0;
}

// This is the main loop
TICK_COUNT appControl(LOOP_COUNT loopCount, TICK_COUNT loopStart) {
return 0;
}

Obviously, it could be an error on my side but I don't see what I'm doing wrong there. I set up WinAVR as I've always done.

Mike

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,150
  • Helpful? 109
Re: Axon II - Show Characters in the 7-segment Display
« Reply #10 on: December 28, 2009, 01:21:37 PM »
Oops - I knew a Version 1.13 would be unlucky!!

I have just uploaded a version 1.13a

You may need to click the 'View all files' button to find it - as SourceForge delays making a new release available.
« Last Edit: December 28, 2009, 01:36:56 PM by Webbot »
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline webgeekTopic starter

  • Jr. Member
  • **
  • Posts: 32
  • Helpful? 0
Re: Axon II - Show Characters in the 7-segment Display
« Reply #11 on: December 28, 2009, 02:25:13 PM »
Closer, but still not quite there. This program causes the text "error " SOMETHING to print on the screen. It goes by a bit too fast to read. It looks like it's saying "error 5" but the middle segment isn't lit.
Code: [Select]
#include "sys/axon2.h"

void appInitHardware(void) {
}

TICK_COUNT appInitSoftware(TICK_COUNT loopStart){

rprintf("test\n");

return 0;
}

// This is the main loop
TICK_COUNT appControl(LOOP_COUNT loopCount, TICK_COUNT loopStart) {
return 0;
}

Let me know what you'd like me to do to test if further for you and I will. BTW: I'm available via all the major IM services if you want to reach me directly for testing. ICQ/AOL: 3488062, MSN: [email protected] Yahoo: mikegrundvig Skype: mikegrundvig

Feel free to contact me directly if you want some more interactive debugging. Thanks!

Mike

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,150
  • Helpful? 109
Re: Axon II - Show Characters in the 7-segment Display
« Reply #12 on: December 29, 2009, 11:27:24 AM »
There is a new Version 1.13b on sourceforge. This just 'fixes' the LED segment issue on the Axon II.

Since I dont yet have an Axon II  to test against then perhaps webgeek, or someone, could let me know if it works using his example code in the previous post!!

Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline webgeekTopic starter

  • Jr. Member
  • **
  • Posts: 32
  • Helpful? 0
Re: Axon II - Show Characters in the 7-segment Display
« Reply #13 on: December 30, 2009, 11:36:29 PM »
Sorry for the delay in response - I've been a bit ill and not really on much. I just tested it and it appears to work great. The digits all look good. I'd suggest slowing the default down a bit though as it's very hard to read at that speed. The letters require some interpretation in some cases. Since it's configurable it's not a problem for now but it'd be a nice tweak for a future release. Great job on incorporating that. Thanks!

Mike

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,150
  • Helpful? 109
Re: Axon II - Show Characters in the 7-segment Display
« Reply #14 on: December 31, 2009, 02:20:24 PM »
I'd suggest slowing the default down a bit though as it's very hard to read at that speed.
Perhaps you could experiment with the two values in sys/Axon2.h (ie the delay between chars, and the delay between repeating the text line). Let me know what works well and I'll change for the next release.

The letters require some interpretation in some cases.
The letters "should" be as per your original post - but obviously chars with diagonals are always a problem - eg "W".  But let me know of any changes.
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline webgeekTopic starter

  • Jr. Member
  • **
  • Posts: 32
  • Helpful? 0
Re: Axon II - Show Characters in the 7-segment Display
« Reply #15 on: December 31, 2009, 09:38:06 PM »
The biggest problem letters are W, M, and N. Then U and V can be confusing between each other - same with X and K. I simply used the letters from that Wikipedia article I linked. I think they are basically as good as it's going to get, it's just you can't sight read them effectively so the speed needs to be a bit slower to interpret them properly. I'll do some testing tomorrow and recommend a speed - I'll also post a video as well for kicks. Thanks!

-Mike

Offline webgeekTopic starter

  • Jr. Member
  • **
  • Posts: 32
  • Helpful? 0
Re: Axon II - Show Characters in the 7-segment Display
« Reply #16 on: January 01, 2010, 11:11:34 PM »
Ok, I've played with it a little bit and have some results.

1) Doubling both delays makes it far easier to read and follow without feeling too slow in general. So that'd be my suggested starting point for timing.

2) It looks like the USB data dumping process doesn't work anymore. For instance, the following program displays properly on the 7-segment display (mostly - see next point) but it doesn't write out to the terminal like I thought it would.

3) There appears to be a 40(?) character limit to the length of message? I guess I don't see much of a reason for this. In the program below, the last sentence only writes to the word "kept " and then starts over.

It's getting closer :) Thanks!

Mike

Offline webgeekTopic starter

  • Jr. Member
  • **
  • Posts: 32
  • Helpful? 0
Re: Axon II - Show Characters in the 7-segment Display
« Reply #17 on: January 01, 2010, 11:19:26 PM »
Oops, forgot the program:
Code: [Select]
#include "sys/axon2.h"

void appInitHardware(void) {
uartInit(UART1, (BAUD_RATE)115200);
}

TICK_COUNT appInitSoftware(TICK_COUNT loopStart){

marqueeSetCharDelay(&marquee, (TICK_COUNT)500000);
marqueeSetEndDelay(&marquee, (TICK_COUNT) 0);

return 0;
}

int pass = 1;

// This is the main loop
TICK_COUNT appControl(LOOP_COUNT loopCount, TICK_COUNT loopStart) {

if(!marqueeIsActive(&marquee)) {
if(pass == 1) {
rprintf("abcdefghijklmnopqrstuvwxyz0123456789\n");
pass++;
} else if(pass == 2) {
rprintf("Axon 2 rocks!\n");
pass++;
} else if(pass == 3) {
rprintf("The jaded zombies acted quietly but kept driving their oxen forward\n");
pass = 1;
} else {
rprintf("error\n");
}
}

return 10;
}

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,150
  • Helpful? 109
Re: Axon II - Show Characters in the 7-segment Display
« Reply #18 on: January 02, 2010, 04:27:59 PM »

1) Doubling both delays makes it far easier to read and follow without feeling too slow in general. So that'd be my suggested starting point for timing.
Ok will change the defaults in the next release

2) It looks like the USB data dumping process doesn't work anymore. For instance, the following program displays properly on the 7-segment display (mostly - see next point) but it doesn't write out to the terminal like I thought it would.
The error reporting process goes to the status LED (For the Axon II thats the flashing decimal point) and also to one output stream - as set by the last call to setErrorLog. For the Axon II the output stream goes to the LED marquee, but you can change it to the UART by calling setErrorLog with the appropriate parameters.


3) There appears to be a 40(?) character limit to the length of message? I guess I don't see much of a reason for this. In the program below, the last sentence only writes to the word "kept " and then starts over.
The reason is that the text is displayed as a background process. So I need to allocate a text buffer in global RAM to save the current message - and therefore it has to have a finite size. The default is 40 chars but you can increase it, if you can afford the RAM, by defining MARQUEE_SIZE before including anything. ie for an 80 character buffer use
#define MARQUEE_SIZE 80


Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,150
  • Helpful? 109
Re: Axon II - Show Characters in the 7-segment Display
« Reply #19 on: January 02, 2010, 06:16:15 PM »

2) It looks like the USB data dumping process doesn't work anymore. For instance, the following program displays properly on the 7-segment display (mostly - see next point) but it doesn't write out to the terminal like I thought it would.
Think I may have misunderstood your question. If you mean that you expected your rprintf to also go to the PC via a uart then - then answer is 'no - rprintf has never done that by default'.  It will only happen if you use an rprintfInit to redirect the rprintf output to the uart of your choice.

rprintf only sends its output to one place. So if you want to send the output to the marquee AND to a UART then you will need to call rprintfInit passing the address of a routine that sends the character to the marquee and to the UART. If you need an example then let me know.

Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,659
  • Helpful? 169
    • Society of Robots
Re: Axon II - Show Characters in the 7-segment Display
« Reply #20 on: January 05, 2010, 01:10:23 AM »
Quote
1) Doubling both delays makes it far easier to read and follow without feeling too slow in general. So that'd be my suggested starting point for timing.
What if some default speed was there, but the user can call a command to change the default speed if they wanted?

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,150
  • Helpful? 109
Re: Axon II - Show Characters in the 7-segment Display
« Reply #21 on: January 05, 2010, 06:27:48 AM »
Quote
1) Doubling both delays makes it far easier to read and follow without feeling too slow in general. So that'd be my suggested starting point for timing.
What if some default speed was there, but the user can call a command to change the default speed if they wanted?

There are commands to change the inter-character delay ie scroll speed, 'marqueeSetCharDelay', and also to change the delay before the message repeats 'marqueeSetEndDelay'.

However if the current default is 'too fast' then I will change it to the value webgeek mentioned as its then one less thing for the user to have to do at the start of their program
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,659
  • Helpful? 169
    • Society of Robots
Re: Axon II - Show Characters in the 7-segment Display
« Reply #22 on: January 26, 2010, 02:30:39 AM »
I made up a demo, made a video of it, and added demo source code to the Axon II code examples.

Also, I found that 0.6s was the minimum amount of time my brain needed to read per character in a marquee (without knowing what the marquee is in advance). So Webbot changed the default to 0.6s. My demo code shows how to easily change it if desired.

You'll see a number set, a character set (I left out non-alphabetical characters), and a three word marquee at the end.

Axon II LED Display Demo

 


Get Your Ad Here