Pages: [1] 2 3   Go Down
Author Topic: Custom character generator for 16x Freetronics LCD+keypad  (Read 7452 times)
0 Members and 1 Guest are viewing this topic.
Melbourne, Australia
Offline Offline
God Member
*****
Karma: 8
Posts: 567
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley-grin

« Last Edit: August 01, 2013, 08:19:44 pm by aarondc » Logged

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

Melbourne, Australia
Offline Offline
God Member
*****
Karma: 8
Posts: 567
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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

USA, FL
Offline Offline
God Member
*****
Karma: 14
Posts: 689
A life? Where can I download one of those?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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..
Logged

//LiNK

nr Bundaberg, Australia
Online Online
Tesla Member
***
Karma: 127
Posts: 8519
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley
______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Melbourne, Australia
Offline Offline
God Member
*****
Karma: 8
Posts: 567
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley
______
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 smiley

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!
Logged

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

USA, FL
Offline Offline
God Member
*****
Karma: 14
Posts: 689
A life? Where can I download one of those?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

//LiNK

nr Bundaberg, Australia
Online Online
Tesla Member
***
Karma: 127
Posts: 8519
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: May 05, 2013, 12:27:18 pm by Graynomad » Logged

Rob Gray aka the GRAYnomad www.robgray.com

Melbourne, Australia
Offline Offline
God Member
*****
Karma: 8
Posts: 567
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley-wink

I use Notepad++ for my web programming, so yes, a good suggestion.
Logged

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

Melbourne, Australia
Offline Offline
God Member
*****
Karma: 8
Posts: 567
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: May 07, 2013, 07:21:06 am by aarondc » Logged

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

USA, FL
Offline Offline
God Member
*****
Karma: 14
Posts: 689
A life? Where can I download one of those?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

//LiNK

Melbourne, Australia
Offline Offline
Jr. Member
**
Karma: 3
Posts: 78
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley-grin



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.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!

Logged

Offline Offline
Jr. Member
**
Karma: 5
Posts: 83
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
<!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>
Logged

Melbourne, Australia
Offline Offline
God Member
*****
Karma: 8
Posts: 567
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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

Offline Offline
Jr. Member
**
Karma: 5
Posts: 83
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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..  smiley-razz

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)
« Last Edit: August 06, 2013, 06:04:03 pm by enhzflep » Logged

Pages: [1] 2 3   Go Up
Jump to: