Its my 1st post here, I hope this code helps somebody I know it did me to write it, also I have some questions about taking the serial data from my robodruino and passing it to my adruino contolling my 24x16matrix. Also very interested if somebody can explain simply how to shorten the length of the demo bitmap data area in the demo16x24scroll by WestfW. I have made my own data for this but I cant identify what variable makes the area size for the bitmap? The demo data is the ladybits and I want to use less area than it uses somehow. would apreciate any help. Adz
// FigureOut Sure2416 v1.0 // Sure Green 24x16 Adz Kiss version.
// Copied ideas from all the Example democode and documentation I could find. Unfortunately found some examples would not work.
// Read many Adruino Forum threads and I noticed that many people like me found the example code hard to read and were
// asking for a kiss style explination of what is going on, I found to do this was enlightening in many ways about the
// board especially the offset referred too in the code but was hard to envisage, I hope this helps others to do so and
// clarify things about this board, mine is the oldest style green one from sure.
// I would especially like to understand the many function libraries and thier uses created by Miles Burton,Bill Westfield,etc,etc.
// I am trying to make my own font files with his notes with limited success.
// However from reading the forums its not easy to figure out thier great work, for many like me still learning as we go.
// Much Respect, Many Thanks and of course all apropriate Credits etc to all creators and contributors for thier
// respective efforts and code snippets.
// Premise is that board is divided into six 8x8 led modules arranged in 2high 3wide
// this creates 3 columns of 8leds wide by 16 high comprised of 6 individual (8x8 led modules)
// Column1 Column2 Column3 Y coordinate number
// |00000000||00000000||00000000|0
// |00000000||00000000||00000000|1
// |00000000||00000000||00000000|2
// |00000000||00000000||00000000|3
// |00000000||00000000||00000000|4
// |00000000||00000000||00000000|5
// |00000000||00000000||00000000|6
// |00000000||00000000||00000000|7 {76543210 16 to 8 25 to 17?why not this?}
//Top X coodinate number [6543210-1 14 to 7 22 to 15] not phone number as the website assumes
// Top left middle right 8x8's
// |00000000||00000000||00000000|8
// |00000000||00000000||00000000|9
// |00000000||00000000||00000000|10
// |00000000||00000000||00000000|11
// |00000000||00000000||00000000|12
// |00000000||00000000||00000000|13
// |00000000||00000000||00000000|14
// |00000000||00000000||00000000|15
//Bottom X coodinate [6543210-1 14 to 7 22 to 15 {wierd offset? are they all like this?)
// Bottom left middle right 8x8's
// I used this style of template as a key to the led on(*) and off(0) in the code.
// I will refer to the led positions in this format to clarify the led positions in relation to x,y adressing in code.
// I will add variables to use as columns later to display sensor data as 3 line graphs using the bars in this demo.
// My actual use for my display board and this code is to attempt to display visually the 3 Ultrasonic pings of my robot.
// I have 3*URM37 Ping sensors running on a robodruino, I hope to pass the data from them to this code in the future.
// I am working on representing the shape of the ultrasonic waves from my 3 sensors this way using the pulse fade effect.
// hopefully between brightness levels and 16 divisions I can represent my 3 distance sensors
#include "Sure2416.h"
void setup () // flow chart from page 17 of datasheet
{
ht1632_displayInit();
ht1632_clearScreen();
}
void columnon()
{
ht1632_clearScreen();
byte x,y, bits;
char intensity;
for (x=24,y=16;y>=0;y--) {// as this loop decrements starting at 16 lines draw on bottom rows working up each time y goes down
// therefore if y is >8 then in bottom panel
for (intensity=0; intensity <= 14; intensity++) { // intensity lowest to highest
ht1632_sendcmd(HT1632_CMD_PWM + intensity);
delay(LONGDELAY/64); // change the pulse intensity lowest to highest speed here,4/8/15/32/64/128/256 I tried them all
} //Bottom Panels starts here
// 6543210-1 (coordinatex) // Led Positions on Line on bottom left 8x8
ht1632_setPixel(-1,15+y,1); // 0000000* strange thing is left column extreme right led requires -1 to set on
ht1632_setPixel(0,15+y,1); // 000000*0 zero starts on 2nd led from right
ht1632_setPixel(1,15+y,1); // 00000*00 then they go across back towards the left
ht1632_setPixel(2,15+y,1); // 0000*000 as you increase x value
ht1632_setPixel(3,15+y,1); // 000*0000 this offset seems very odd to me
ht1632_setPixel(4,15+y,1); // 00*00000 I wonder if all of them are wired/setup this way?
ht1632_setPixel(5,15+y,1); // 0*000000 Never thought I would need to use a -1 was surprized.
ht1632_setPixel(6,15+y,1); // *0000000
// draw line at base of middle column on bottom middle 8x8
ht1632_setPixel(7,15+y,1); // 0000000*
ht1632_setPixel(8,15+y,1); // 000000*0
ht1632_setPixel(9,15+y,1); // 00000*00
ht1632_setPixel(10,15+y,1); // 0000*000
ht1632_setPixel(11,15+y,1); // 000*0000
ht1632_setPixel(12,15+y,1); // 00*00000
ht1632_setPixel(13,15+y,1); // 0*000000
ht1632_setPixel(14,15+y,1); // *0000000
// draw line at base of right column on bottom right 8x8
ht1632_setPixel(15,15+y,1); // 0000000*
ht1632_setPixel(16,15+y,1); // 000000*0
ht1632_setPixel(17,15+y,1); // 00000*00
ht1632_setPixel(18,15+y,1); // 0000*000
ht1632_setPixel(19,15+y,1); // 000*0000
ht1632_setPixel(20,15+y,1); // 00*00000
ht1632_setPixel(21,15+y,1); // 0*000000
ht1632_setPixel(22,15+y,1); // *0000000
{ if (y<=8&&y>=0){// if y is <=8 then line position in top panel // yes I could have 1/2ed the code here but its the Kiss version.
//Top Panels starts here// Led Positions on Line across each column
// 6543210-1(coordinatex)// left column on top left 8x8
ht1632_setPixel(-1,15+y,1); // 0000000* anybody else think this is strange? right led requires -1 to set on
ht1632_setPixel(0,15+y,1); // 000000*0
ht1632_setPixel(1,15+y,1); // 00000*00
ht1632_setPixel(2,15+y,1); // 0000*000
ht1632_setPixel(3,15+y,1); // 000*0000
ht1632_setPixel(4,15+y,1); // 00*00000
ht1632_setPixel(5,15+y,1); // 0*000000
ht1632_setPixel(6,15+y,1); // *0000000
// middle column middle 8x8 middle column on top middle 8x8
ht1632_setPixel(7,15+y,1); // 0000000*
ht1632_setPixel(8,15+y,1); // 000000*0
ht1632_setPixel(9,15+y,1); // 00000*00
ht1632_setPixel(10,15+y,1); // 0000*000
ht1632_setPixel(11,15+y,1); // 000*0000
ht1632_setPixel(12,15+y,1); // 00*00000
ht1632_setPixel(13,15+y,1); // 0*000000
ht1632_setPixel(14,15+y,1); // *0000000
// right column right 8x8 right column on top right 8x8
ht1632_setPixel(15,15+y,1); // 0000000*
ht1632_setPixel(16,15+y,1); // 000000*0
ht1632_setPixel(17,15+y,1); // 00000*00
ht1632_setPixel(18,15+y,1); // 0000*000
ht1632_setPixel(19,15+y,1); // 000*0000
ht1632_setPixel(20,15+y,1); // 00*00000
ht1632_setPixel(21,15+y,1); // 0*000000
ht1632_setPixel(22,15+y,1);} // *0000000
}
for (intensity=14; intensity >= 0; intensity--) { // intensity highest to lowest
ht1632_sendcmd(HT1632_CMD_PWM + intensity);
delay(LONGDELAY/8); // change the pulse intensity highest to lowest speed here,4/8/15/32/64/128/256 I tried them all
}
}
}
void loop ()
{
columnon();
}