Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to use codes generated in custom character generator of Mikrobasic Pro?

Status
Not open for further replies.

newbie111

Member level 2
Joined
Nov 29, 2009
Messages
51
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Location
h.k
Activity points
1,609
hi,

Any folks here using mikrobasicpro

it has a built- in custom character generator

I am wondering if anyone can show me some examples codes for any pics

how to use the generated codes there


Thanks
 

mikrobasic pro

Hi,
I found out how to do it.
Say this is the custom sub that is generated:
Code:
const character as byte[8] = (0,10,0,21,17,14,0,0)

sub procedure CustomChar(dim pos_row as byte, dim pos_char as byte)
  dim i as byte
    LCD_Cmd(64)
    for i = 0 to 7
      LCD_Chr_Cp(character[i])
    next i
    LCD_Cmd(_LCD_RETURN_HOME)
    LCD_Chr(pos_row, pos_char, 0)
end sub
Then in your main code call this sub routine just like you'd call LCD_Out.
e.g.
Code:
program LCD_Cust

dim LCD_RS as sbit at RB4_bit
    LCD_EN as sbit at RB5_bit
    LCD_D4 as sbit at RB0_bit
    LCD_D5 as sbit at RB1_bit
    LCD_D6 as sbit at RB2_bit
    LCD_D7 as sbit at RB3_bit

    LCD_RS_Direction as sbit at TRISB4_bit
    LCD_EN_Direction as sbit at TRISB5_bit
    LCD_D4_Direction as sbit at TRISB0_bit
    LCD_D5_Direction as sbit at TRISB1_bit
    LCD_D6_Direction as sbit at TRISB2_bit
    LCD_D7_Direction as sbit at TRISB3_bit

const character as byte[8] = (0,10,0,21,17,14,0,0)

sub procedure CustomChar(dim pos_row as byte, dim pos_char as byte)
  dim i as byte
    LCD_Cmd(64)
    for i = 0 to 7
      LCD_Chr_Cp(character[i])
    next i
    LCD_Cmd(_LCD_RETURN_HOME)
    LCD_Chr(pos_row, pos_char, 0)
end sub

main:
     LCD_Init()
     LCD_Cmd(_LCD_CURSOR_OFF)
     LCD_Cmd(_LCD_CLEAR)
     CustomChar(1, 6) 'Print custom character on row 1, column 6
     while true
     wend
end.
Hope it helped.
Tahmid.
 

    newbie111

    Points: 2
    Helpful Answer Positive Rating
Re: mikrobasic pro

WELL DONE!!!!!!!!!!!!!!!


Pal,

I do not know what to say you are smart, helpful and all that.


It worked finally!

^______________^


I hereby want to thank you for asking me to download mikrobasic

I am now using it with joy!

Best regards,

Simon
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top