MikroElektronika PIC Microcontrollers PIC16 Uživatelský manuál Strana 58

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 172
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 57
mikroBASIC
- Basic Compiler for Microchip PIC microcontrollers
MikroElektronika:
Development
tools
-
Books
-
Compilers
mikroBASIC
making it simple...
53
sub function mask(dim byref num as byte) as byte
' This function returns code for digit
select case num
' for common cathode 7 seg. display.
case 0 result = $3F
case 1 result = $06
' Note that the value of result is not
case 2 result = $5B
' initialized for values greater than 9
case 3 result = $4F
case 4 result = $66
case 5 result = $6D
case 6 result = $7D
case 7 result = $07
case 8 result = $7F
case 9 result = $6f
end select
' case end
end sub
making it simple...
Example
Nested procedures
or functions calls
are limited to 8
for PIC16 series,
and to 31 for PIC18
Number of allowed
nested calls will be
decremented by 1 if
you use interrupt
procedure and 1 more
if you use *, div, mod
Compiler will report
stack overflow error
if you exceed the
allowed number of
nested calls
Procedure or
Function
Procedure or
Function
Procedure or
Function
Zobrazit stránku 57
1 2 ... 53 54 55 56 57 58 59 60 61 62 63 ... 171 172

Komentáře k této Příručce

Žádné komentáře