Squirrels have fuzzy tails.
0 Members and 1 Guest are viewing this topic.
updateDisplay(top, topLeft, topRight, middle, bottomLeft, bottomRight, bottom, dot);
updateDisplay(1, 1, 1, 1, 1, 1, 0, 0);
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);
// 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
I'll add it in to the next release but pack each character into a single byte stored in program flash memory
One other request - can you add a method for animating text messages? Something like:animateDisplay("this is my message", 500);
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.
avr-gcc -mmcu=atmega640 -Wl,-Map=Test7Segment.map Test7Segment.o -L"C:\projects\robots\webbotlib-1.13" -lWebbot-ATMega640 -lc -lm -o Test7Segment.elfC:\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 hereC:\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 hereC:\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 hereC:\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 hereC:\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 hereC:\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
#include "sys/axon2.h"void appInitHardware(void) { uartInit(UART1, 230400);}TICK_COUNT appInitSoftware(TICK_COUNT loopStart){ return 0;}// This is the main loopTICK_COUNT appControl(LOOP_COUNT loopCount, TICK_COUNT loopStart) { return 0;}
#include "sys/axon2.h"void appInitHardware(void) {}TICK_COUNT appInitSoftware(TICK_COUNT loopStart){ rprintf("test\n"); return 0;}// This is the main loopTICK_COUNT appControl(LOOP_COUNT loopCount, TICK_COUNT loopStart) { return 0;}
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.
#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 loopTICK_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;}
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.
Quote1) 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?