Advertisement  

Monday, 26 June 2017
     
 
Main Menu
Home Home
Shop Shop
News News
BASCOM-AVR BASCOM-AVR
BASCOM-8051 BASCOM-8051
Products Products
Application Notes Application Notes
Publications Publications
Links Links
Support Center Support Center
Downloads Downloads
Forum Forum
Resellers Resellers
Contact Us Contact Us
Updates Updates
MCS Wiki MCS Wiki
Online Help
BASCOM-AVR Help BASCOM-AVR Help
BASCOM-8051 Help BASCOM-8051 Help
Contents in Cart
Show Cart
Your Cart is currently empty.
Search the Shop

Products Search

User Login
Username

Password

If you have problem after log in with disappeared login data, please press F5 in your browser

RSS News
 
     
 

 
   
     
 
AN #162 - The Graphic logotype on text LCD Print
Rubashka Vasiliy (Radan)

After the program has been started a logo is shown. Most programs show some kind of splash screen during start up. With graphic displays this is not a problem. But a normal TEXT LCD is different.

However in BASCOM it is possible to create symbols with DEFLCDCHAR with the size of  5х8 pixels.
We can create  8 of such customer characters. If we show them all together we can have a 16x20 pixels custom logot/graphic.

This is not so much, but with some creative approach it is possible to create unlimited amount  of logotype for any request. The Process of the making the logotype more simply whole begin by means of standard program Paint.

 

 

We Create stocking up, identical drawing, and reproduce the scene that is necessary. Then in BASCOM by means of LCD designer we draw all eight symbols, not forgetting their number from 0 before 7 (left to right from top to bottom).

Cls

' Logotype

Deflcdchar 0 , 27 , 31 , 27 , 23 , 16 , 16 , 16 , 24

Deflcdchar 1 , 28 , 30 , 28 , 32 , 32 , 32 , 32 , 3

Deflcdchar 2 , 31 , 31 , 25 , 16 , 24 , 16 , 24 , 28

Deflcdchar 3 , 31 , 31 , 31 , 15 , 7 , 7 , 7 , 7

Deflcdchar 4 , 24 , 24 , 24 , 28 , 30 , 30 , 30 , 31

Deflcdchar 5 , 4 , 32 , 2 , 8 , 15 , 16 , 32 , 32

Deflcdchar 6 , 24 , 16 , 30 , 15 , 31 , 9 , 32 , 32

Deflcdchar 7 , 7 , 7 , 15 , 15 , 15 , 15 , 31 , 31

Locate 1 , 1

Lcd Chr(0) ; Chr(1) ; Chr(2) ; Chr(3)

Locate 2 , 1

Lcd Chr(4) ; Chr(5) ; Chr(6) ; Chr(7)

Locate 1 , 5

Lcd " BASCOMAVR "

Locate 2 , 5

Lcd " RadanStudio"

 

This fragment of the program will remove the scene of the person men in left part LCD. We shall add the explanatory text, and branded logotype ready. In simulation we shall get here is such piece:

 

Same will be displayed and on real indicator.

If in process of the functioning we are necessary other symbols of the user, their possible anew create and use as usually.

Possible was stops on reached, but always want what nor be greater. But why us not to create the logotype - animation? The Following code does exactly this. And as bonus fragment work with RC5.

 

 

'****************************************************************************
'* Filename : LCD Picture (HORSE)   *
'* Revision : 1.0 *
'* Controller : ATMEGA8 *
'* Compiler : BASCOM-AVR 1.11.9.0 *
'* Author : Rubashka Vasiliy , Ukraine , 2008 *
'* WWW : http://ledeffects.net *
'* Mail : info@ledeffects.net *
'****************************************************************************
'****************************************************************************

'* *
'* IR 36kHz ATMEGA 8 *
'* .-O-. .--_/--.  *
'* |___| /-[10k]-|Res | *
'* ||| | | | *
'* /--/|| --- | | *
'* | |*--------+---|Pd2 | *
'* | || | | | *
'* | |-[47k]--* | | *
'* | *--[100]--*---|Vcc GND|--------- *
'* *---+---------+---|GND | | *
'* | | /---+---|Pb6 Vcc|------- | *
'* | | | /-+---|Pb7 Pb5|----- | |  *
'* | | | | | | Pb4|--- | | | *
'* | | | | | | | | | | | *
'* | | | | | | Pb2|- | | | | *
'*  | | | | | /-|Pb0 | | | | | | *
'* | | | | | | '-------' | | | | | *
'* | | | | | --------- | | | | | *
'* | | | | -----------+-+-+-+-*-+-----*-----------*------- *
'* | +|10,0 | ----------- | | | | | | |0,1 +|100,0 | *
'* | --- ----------- | | | | | | | --- --- | *
'* | --- | | | | | | | | --- --- | *
'* | | | | | | | | | | | | | *
'* ---*-----------------+-+-+-+-+-+-+-*-*-*-*-----*-----*----- | *
'* | | | | | | | | | | | | |  *
'* .-------------------. --- V V *
'* |D D R E D D V V R V| *
'* |6 7 s 4 5 c s w 0| - + *
'*  '-------------------' 5 5 *
'* ":::::::::::::::::::" V V *
'* ":::::LCD::16*2:::::" *
'* ":::::::::::::::::::" *
'* """"""""""""""""""""" *
'* *
'*  *
'****************************************************************************


$regfile = "m8def.dat"
$crystal = 8000000 'internal generator
$lib "lcd4.lbx"
$lib "mcsbyte.lbx"  

Config Rc5 = Pind.2
Enable Interrupts 
Config Lcdpin = Pin , Rs = Portb.0 , E = Portb.2 , Db4 = Portb.4 , Db5 = Portb.5 , Db6 = Portb.6 , Db7 = Portb.7
Config Lcd = 16 * 2
Dim Address As Byte   
Dim Command As Byte  
Dim Shag As Byte 'Amount repetition
Cursor Off  '*******************************************************************************
Cls
For Shag = 1 To 10
Gosub Horse1
Gosub Lcd_pictur
Gosub Horse2
Gosub Lcd_pictur
Gosub Horse3
Gosub Lcd_pictur
Next Shag
'*******************************************************************************

Do 'Main cycle
Getrc5(address , Command)
If Address = 0 Then
Command
= Command And &B01111111
Locate 1 , 6
Lcd "Adr.: " ; Address
Locate 2 , 5
Lcd " Cmd: " ; Command
End If
Loop
End 'End off main cycle
'*******************************************************************************

Lcd_pictur:
Locate 1 , 1
Lcd Chr(0) ; Chr(1) ; Chr(2) ; Chr(3)
Locate 2 , 1
Lcd Chr(4) ; Chr(5) ; Chr(6) ; Chr(7)
Waitms 300
Return

Horse1:
Deflcdchar 0 , 32 , 32 , 32 , 32 , 3 , 7 , 14 , 14
Deflcdchar 1 , 32 , 32 , 32 , 32 , 15 , 31 , 31 , 31
Deflcdchar 2 , 32 , 32 , 32 , 32 , 3 , 31 , 31 , 31
Deflcdchar 3 , 32 , 1 , 31 , 31 , 31 , 27 , 19 , 16
Deflcdchar 4 , 12 , 24 , 16 , 1 , 1 , 1 , 32 , 32
Deflcdchar 5 , 31 , 31 , 30 , 23 , 32 , 32 , 16 , 32
Deflcdchar 6 , 31 , 31 , 3 , 2 , 18 , 2 , 1 , 32
Deflcdchar 7 , 28 , 28 , 4 , 4 , 8 , 32 , 32 , 32
Return

Horse2:
Deflcdchar 0 , 32 , 32 , 32 , 32 , 32 , 7 , 15 , 30
Deflcdchar 1 , 32 , 32 , 32 , 32 , 14 , 31 , 31 , 31
Deflcdchar 2 , 32 , 32 , 32 , 32 , 7 , 31 , 31 , 31
Deflcdchar 3 , 32 , 2 , 31 , 31 , 31 , 27 , 19 , 16
Deflcdchar 4 , 16 , 32 , 32 , 1 , 1 , 1 , 32 , 32
Deflcdchar 5 , 31 , 31 , 27 , 18 , 1 , 1 , 17 , 32
Deflcdchar 6 , 31 , 31 , 1 , 1 , 1 , 1 , 32 , 32
Deflcdchar 7 , 24 , 28 , 4 , 8 , 16 , 32 , 16 , 32
Return

Horse3:
Deflcdchar 0 , 32 , 32 , 32 , 7 , 15 , 14 , 28 , 24
Deflcdchar 1 , 32 , 32 , 32 , 15 , 31 , 31 , 31 , 31
Deflcdchar 2 , 32 , 32 , 32 , 3 , 31 , 31 , 31 , 31
Deflcdchar 3 , 1 , 31 , 31 , 31 , 27 , 27 , 16 , 16
Deflcdchar 4 , 19 , 19 , 2 , 2 , 4 , 32 , 32 , 32
Deflcdchar 5 , 31 , 7 , 14 , 6 , 1 , 32 , 32 , 32
Deflcdchar 6 , 15 , 7 , 19 , 15 , 32 , 16 , 32 , 32
Deflcdchar 7 , 16 , 24 , 12 , 4 , 2 , 1 , 32 , 32
Return

 

This program seasonly draws three pictures - a phases running.

 

 

Who will want to try, offer the small collection a picture.