Go Down

Topic: Custom character generator for 16x Freetronics LCD+keypad (Read 8673 times) previous topic - next topic

aarondc

May 04, 2013, 08:02 am Last Edit: Aug 02, 2013, 03:19 am by aarondc Reason: 1
Download: https://dl.dropboxusercontent.com/u/85621331/custom%20char.zip

I wanted to add some custom characters, and it was fiddly designing them by hand. I also wanted to see what the text lines looked like without constantly counting characters in strings.

So I wrote a little utility to help. I am curious if anyone would be interested in the app - it's Windows only, sorry.

It looks like this:



If there's any interest, I just need somewhere to upload it. If there's something better already in existence, great, please let me know :D

Windows serial port monitor: Tellurium | Arduino serial port debugging library: DBG | Cusom LCD char generator | Technical questions will only be answered in forum threads

aarondc

I'm probably going to write some other utilities as I get into Arduino development, so it would be good to know if there's any interest in sharing them with the community.

They're written in Delphi and use custom VCL components, so releasing source is not really an option, but am happy to release them as freeware.

Also: please let me know if there is a better place to post these sorts of messages.
Windows serial port monitor: Tellurium | Arduino serial port debugging library: DBG | Cusom LCD char generator | Technical questions will only be answered in forum threads

codlink

Neat little program.  You could upload it to somewhere like sourceforge or github.  Is it stand-alone or do you have an installer?  You could technically zip it up and upload to any file sharing site.

If you give a link to the download, I would use it..
//LiNK

Graynomad

That's quite nice, which way does the data entry work, I assume clicking on the "dots" in the graphic changes the code snippet.

Also can it generate a 2-dimensional array for X number of chars?

Doesn't matter what you do, people always want more eh :)
______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

aarondc


That's quite nice, which way does the data entry work, I assume clicking on the "dots" in the graphic changes the code snippet.

Also can it generate a 2-dimensional array for X number of chars?

Doesn't matter what you do, people always want more eh :)
______
Rob


Yeah that's right. Click a dot and the code is updated. The 16x2 only allows 8 custom characters so doing them individually seemed good enough. I had lots of other ideas to enhance it but KISS is working as I focus on the Arduino programming :)

If / when I upload it I will post a link.

Have struggled with the Arduino IDE  :-/ I am designing a replacement for that in my head. Eesh!
Windows serial port monitor: Tellurium | Arduino serial port debugging library: DBG | Cusom LCD char generator | Technical questions will only be answered in forum threads

codlink


Have struggled with the Arduino IDE  :-/ I am designing a replacement for that in my head. Eesh!


Might want to consider the  Arduino Enhanced Release 1.0.4 - http://arduino.cc/forum/index.php/topic,118440.0.html

And also using Notepad++ for the editor - http://arduino.cc/forum/index.php/topic,160456.0.html
//LiNK

Graynomad

#6
May 05, 2013, 05:32 pm Last Edit: May 05, 2013, 07:27 pm by Graynomad Reason: 1
Quote
Have struggled with the Arduino IDE  :-/ I am designing a replacement for that in my head. Eesh!

There are 3-4 nice alternatives already so don't knock yourself out doing another one.

Quote
focus on the Arduino programming

Yes it's easy to get distracted making tools and get nothing done on the original project.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

aarondc



Have struggled with the Arduino IDE  :-/ I am designing a replacement for that in my head. Eesh!


Might want to consider the  Arduino Enhanced Release 1.0.4 - http://arduino.cc/forum/index.php/topic,118440.0.html

And also using Notepad++ for the editor - http://arduino.cc/forum/index.php/topic,160456.0.html


Yeah was just perusing the Arduino enhanced thread. Still ugly as sin ;)

I use Notepad++ for my web programming, so yes, a good suggestion.
Windows serial port monitor: Tellurium | Arduino serial port debugging library: DBG | Cusom LCD char generator | Technical questions will only be answered in forum threads

aarondc

#8
May 07, 2013, 10:54 am Last Edit: May 07, 2013, 02:21 pm by aarondc Reason: 1

Quote
Have struggled with the Arduino IDE  :-/ I am designing a replacement for that in my head. Eesh!

There are 3-4 nice alternatives already so don't knock yourself out doing another one.

Quote
focus on the Arduino programming

Yes it's easy to get distracted making tools and get nothing done on the original project.

______
Rob


Can you suggest any more IDEs?

Also: the serial monitor is kinda bare minimum. I downloaded RealTerm and that's interesting.

Any suggestions for serial comms app?

ETA: I stalked you over to ozelecforum, see you mentioned netbeans. Also learnt you can embed assembler! weeeee!! My first ever project out of uni was a serial port IVT accessible circular buffer data capture TSR for a POS system, all written in assembler. Good to know.

Am keen on getting into some solar / wind energy stuff, so will be joining ozelec at some stage to get the lowdown there too.
Windows serial port monitor: Tellurium | Arduino serial port debugging library: DBG | Cusom LCD char generator | Technical questions will only be answered in forum threads

codlink

Found an online generator.  http://mikeyancey.com/hamcalc/lcd_characters.php
//LiNK

johnft


I wanted to add some custom characters, and it was fiddly designing them by hand. I also wanted to see what the text lines looked like without constantly counting characters in strings.

So I wrote a little utility to help. I am curious if anyone would be interested in the app - it's Windows only, sorry.

It looks like this:



If there's any interest, I just need somewhere to upload it. If there's something better already in existence, great, please let me know :D




Hi Aaron

That looks like a great app, we'd be happy to host that for you if you like. Email john at freetronics dot com.
http://www.freetronics.com

dvarela

Great app, no doubt about it, but can you se the build character in the lines?
If you could that would be an amazing app!


enhzflep

Looks quite nice. My only perceived draw-back is it's non-portability.

I played with something similar a few weeks back. First for designing custom characters for 1602 lcds, then later for either 1bit or 16bit images for 16bit tft screens. I can post them if anybody has a use for them.

Here's something I threw-together over something to eat for lunch. Tested under Win7, Raspian, Linux Mint - Chrome or Chromium in all cases.

lcdHelper.html
Code: [Select]
<!DOCTYPE html>
<html>
<head>
<script>
function byId(e){return document.getElementById(e);}
function newEl(tag){return document.createElement(tag);}
function newTxt(txt){return document.createTextNode(txt);}
function toggleClass(element, newStr)
{
index=element.className.indexOf(newStr);
if ( index == -1)
element.className += ' '+newStr;
else
{
if (index != 0)
newStr = ' '+newStr;
element.className = element.className.replace(newStr, '');
}
}
function forEachNode(nodeList, func)
{
var i, n = nodeList.length;
for (i=0; i<n; i++)
{
func(nodeList[i], i, nodeList);
}
}

function hasClass(el, classStr)
{
if ( (el.className.indexof(classStr) == 0) || (el.className.indexof(" "+classStr) != -1) )
return true;
return false;
}

function addClass(el, classStr)
{
el.className += " " + classStr;
}

function removeClass(el, classStr)
{
var index = el.className.indexOf(classStr);
if (index != -1)
{
if (index != 0)
classStr = " " + classStr;
el.className = el.className.replace(classStr, '');
}
}

window.addEventListener('load', mInit, false);
var btnState = 0;

function mInit()
{
var tdList = document.querySelectorAll('td');
var i, n;
forEachNode(tdList, function(el){el.addEventListener('mousedown', function(){toggleClass(this, 'active');})});

n = tdList.length;
for (i=0; i<n; i++)
tdList[i].addEventListener('mouseover', onCellEnter);

window.addEventListener('mousedown', onMouseDown, false);
window.addEventListener('mouseup', onMouseUp, false);
}

function onCellEnter(evt)
{
if (btnState == 1)
toggleClass(this, "active");
console.log(evt);
}

function onMouseDown(evt)
{
btnState = 1;
}
function onMouseUp(evt)
{
btnState = 0;
}

function computeOutput()
{
var curByte=0, tbl, curRow, curCell, nRows, nCells;
var curStr = "byte character[8] = {\n\t";

tbl = byId('char');
nRows = tbl.rows.length;
for (curRow=0; curRow<nRows; curRow++)
{
curByte = 0;
nCells = tbl.rows[curRow].cells.length;
for (curCell = 0; curCell<nCells; curCell++)
{
curByte <<= 1;
if (tbl.rows[curRow].cells[curCell].className.indexOf('active') != -1)
curByte |= 1;
}
if (curRow != 0)
curStr += ",\n\t";
curStr += curByte;
}
curStr += "\n};"
byId('result').value = curStr;
}

function computeOutput2()
{
var curByte=0, tbl, curRow, curCell, nRows, nCells;
var curStr = "";

tbl = byId('char');
nRows = tbl.rows.length;
for (curRow=0; curRow<nRows; curRow++)
{
curByte = 0;
nCells = tbl.rows[curRow].cells.length;
for (curCell = 0; curCell<nCells; curCell++)
{
curByte <<= 1;
if (tbl.rows[curRow].cells[curCell].className.indexOf('active') != -1)
curStr += "x";
else
curStr += ".";
}
curStr += "\n";
}
byId('result').value = curStr;
}

function clearCells()
{
var cells = document.getElementsByTagName('td');
var i, n=cells.length;
for (i=0;i<n;i++)
cells[i].className = cells[i].className.replace(" active", "");
}
function fillCells()
{
var cells = document.getElementsByTagName('td');
var i, n=cells.length;
for (i=0;i<n;i++)
cells[i].className = " active";
}

function toggleCells()
{
var cells = document.getElementsByTagName('td');
var i, n=cells.length;
for (i=0;i<n;i++)
toggleClass(cells[i], 'active');
}
</script>
<style>
#lcdCharArea
{
background: #3719ec;
display: inline-block;
padding: 1em;
}

#char td
{
height: 2em;
width: 2em;
background: #1c0d79;
}
#char td.active
{
background: #e3e1ee;
}
#ouputArea
{
border: solid 1px black;
display: inline-block;
}
</style>
</head>
<body>
<div id='lcdCharArea'>
<table id='char'>
<tbody>
<tr><td></td><td></td><td></td><td></td><td></td></tr>
<tr><td></td><td></td><td></td><td></td><td></td></tr>
<tr><td></td><td></td><td></td><td></td><td></td></tr>
<tr><td></td><td></td><td></td><td></td><td></td></tr>
<tr><td></td><td></td><td></td><td></td><td></td></tr>
<tr><td></td><td></td><td></td><td></td><td></td></tr>
<tr><td></td><td></td><td></td><td></td><td></td></tr>
<tr><td></td><td></td><td></td><td></td><td></td></tr>
</tbody>
</table>
<hr>
<div style='display: inline-block'>
<input type='button' value='clear' onclick='clearCells();'/>
<input type='button' value='fill' onclick='fillCells();'/>
<input type='button' value='toggle' onclick='toggleCells();'/>
</div>
</div>
<div style='display:inline-block;'>
<input type='button' value='compute Hex code' onclick='computeOutput();'/>
<br>
<input type='button' value='compute text img' onclick='computeOutput2();'/>
</div>
<div id = 'ouputArea'><textarea id='result' rows='18' cols='80'></textarea></div>
</body>
</html>

aarondc

Non-portability is only a draw back if you have to develop on more than one OS platform. Never seen someone in that predicament, and expect it's one I will never be in myself.
Windows serial port monitor: Tellurium | Arduino serial port debugging library: DBG | Cusom LCD char generator | Technical questions will only be answered in forum threads

enhzflep

#14
Aug 07, 2013, 12:55 am Last Edit: Aug 07, 2013, 01:04 am by enhzflep Reason: 1

Non-portability is only a draw back if you have to develop on more than one OS platform. Never seen someone in that predicament.

Bzzz. Not quite. What if you only develop on a single one - i.e linux.... What's your email address? I'll send you my photo..  :P

If you don't feel the love for the Arduino IDE like I don't, you may consider and prefer Code::Blocks Arduino Edition. It blows the socks off the official IDE and anything else I've seen to date, to be honest. Eclipse is like using King Kong to catch a mosquito - big, slow and total overkill for such a project. Never mind the fact that C::B is written in C++ - a claim that neither Arduino or Eclipse can make (both Java piggies)

Go Up