ВУЗ: Не указан
Категория: Не указан
Дисциплина: Не указана
Добавлен: 12.06.2025
Просмотров: 8224
Скачиваний: 1
© MCS Electronics, 1995-2007
c = 10 |
'let c = 10 |
DEFLCDCHAR
Action
Define a custom LCD character.
Syntax
DEFLCDCHAR char,r1,r2,r3,r4,r5,r6,r7,r8
Remarks
char |
Constant representing the character (0-7). |
r1-r8 |
The row values for the character. |
You can use the LCD designer to build the characters.
It is important that a CLS follows the DEFLCDCHAR statement(s).
So make sure you use the DEFLCDCHAR before your CLS statement.
Special characters can be printed with the Chr() function.
LCD Text displays have a 64 byte memory that can be used to show your own custom characters. Each character uses 8 bytes as the character is an array from8x8 pixels. You can create a maximum of 8 characters this way. Or better said : you can show a maximum of 8 custom characters at the same time. You can redefine characters in your programbut with the previous mentioned restriction.
A custom character can be used to show characters that are not available in the LCDfont table. For example a Û.
You can also use custom characters to create a bar graph or a music note.
See also
Tools LCD designer
Partial Example
Deflcdchar 1 , 225 , 227 , 226 , 226 , 226 , 242 , 234 , 228 |
' replace ? |
|
with number (0-7) |
' replace ? |
|
Deflcdchar 0 , 240 , 224 , 224 , 255 , 254 , 252 , 248 , 240 |
||
with number (0-7) |
'select data RAM |
|
Cls |
||
Rem it is important that a CLS is following the deflcdchar statements because
it will set the controller back in datamode |
'print the special |
Lcd Chr(0) ; Chr(1) |
|
character |
DEG2RAD
Action
Converts an angle in to radians.
page -453-
© MCS Electronics, 1995-2007
Syntax
var = DEG2RAD( Source )
Remarks
Var |
A numeric variable that is assigned with the degrees of variable |
Source. |
|
Source |
The single or double variable to get the degrees of. |
All trig functions work with radians. Use deg2rad and rad2deg to convert between radians and angles.
See Also
RAD2DEG
Example
'----------------------------------------------------------------------------- |
|
-- |
: (c) 1995-2005, MCS Electronics |
'copyright |
|
'micro |
: Mega48 |
'suited for demo |
: yes |
'commercial addon needed |
: no |
'purpose |
: demonstrates DEG2RAD function |
'----------------------------------------------------------------------------- |
|
-- |
|
Dim S As Single |
|
S = 90 |
|
S = Deg2Rad(s) |
|
Print S |
|
S = Rad2deg(s) |
|
Print S |
|
End |
DELAY
Action
Delay program execution for a short time.
Syntax
DELAY
Remarks
Use DELAY to wait for a short time.
The delay time is ca. 1000 microseconds.
Interrupts that occur frequently and/or take a long time to process, will let the delay
page -454-