mikrobasic-вопросы

Если ваш вопрос не влез ни в одну из вышеперечисленных тем, вам сюда.
Аватара пользователя
Каримов
Открыл глаза
Сообщения: 49
Зарегистрирован: Сб мар 19, 2011 17:58:36
Откуда: Красноярск

mikrobasic-вопросы

Сообщение Каримов »

Здравствуйте!
Подскажите, кто знает. Как сделать вызов подпрограммы? Gosub метка -ну никак не хочет (сыпет ошибки).
Goto метка -работает!
Пишет, что надо объявить процедуру. А как? В хелпе ничего не ясно!
Смотрел и примеры, где есть Gosub-End sub. Все равно не получается
Реклама
Аватара пользователя
oleg110592
Друг Кота
Сообщения: 3832
Зарегистрирован: Сб сен 10, 2011 17:46:25

Re: mikrobasic-вопросы

Сообщение oleg110592 »

А у вас выполняется это условие: The gosub line can come before or after the label?
и вообще: Note : Like with goto, the use of gosub statement is generally discouraged.
Реклама
Аватара пользователя
Каримов
Открыл глаза
Сообщения: 49
Зарегистрирован: Сб мар 19, 2011 17:58:36
Откуда: Красноярск

Re: mikrobasic-вопросы

Сообщение Каримов »

блок размещал и до вызова подпрограммы , и в конце
Аватара пользователя
oleg110592
Друг Кота
Сообщения: 3832
Зарегистрирован: Сб сен 10, 2011 17:46:25

Re: mikrobasic-вопросы

Сообщение oleg110592 »

В хэлпе нету примера?
Попробуйте Procedure или Function:
http://www.mikroe.com/download/eng/docu ... edures.htm
Реклама
Эиком - электронные компоненты и радиодетали
Аватара пользователя
Каримов
Открыл глаза
Сообщения: 49
Зарегистрирован: Сб мар 19, 2011 17:58:36
Откуда: Красноярск

Re: mikrobasic-вопросы

Сообщение Каримов »

sub function function_name(parameter_list) as return_type
[ local declarations ]
function body
end sub

Пробывал и по примерам, и по хелпу. Все время "не декларированная..или что в этом роде.)
Вложения
T6963C_240x128.mbas.txt
(7.78 КБ) 225 скачиваний
Реклама
Аватара пользователя
oleg110592
Друг Кота
Сообщения: 3832
Зарегистрирован: Сб сен 10, 2011 17:46:25

Re: mikrobasic-вопросы

Сообщение oleg110592 »

Похоже в main нельзя размещать или надо задекларировать:

Код: Выделить всё

Main unit should look like this:
program <program name>
include <include other modules>
'********************************************************
'* Declarations (globals):
'********************************************************
' symbols declarations
symbol ...
' constants declarations
const ...
' variables declarations
dim ...
' procedures declarations
sub procedure procedure_name(...)
<local declarations>
...
end sub
' functions declarations
sub function function_name(...)
<local declarations>
...
end sub
'********************************************************
'* Program body:
'********************************************************
main:
' write your code here
end.
Реклама
Аватара пользователя
Каримов
Открыл глаза
Сообщения: 49
Зарегистрирован: Сб мар 19, 2011 17:58:36
Откуда: Красноярск

Re: mikrobasic-вопросы

Сообщение Каримов »

а можете показать?
Я где только не размещал-не получается :cry:
Аватара пользователя
Каримов
Открыл глаза
Сообщения: 49
Зарегистрирован: Сб мар 19, 2011 17:58:36
Откуда: Красноярск

Re: mikrobasic-вопросы

Сообщение Каримов »

перенес до main:
... ошибки:

0 132 Compilation Started E:\MICROBASIC\1\T6963C_240x128.mbas
88 301 "sub"is not valid identifier T6963C_240x128.mbas
88 304 Syntax error: Expected "dim" but "." found T6963C_240x128.mbas
88 301 "."is not valid identifier T6963C_240x128.mbas
88 301 "."is not valid identifier T6963C_240x128.mbas
88 304 Syntax error: Expected "as" but "." found T6963C_240x128.mbas
88 337 Unknown type ")" T6963C_240x128.mbas
89 304 Syntax error: Expected "," but "mm1" found T6963C_240x128.mbas
89 304 Syntax error: Expected ")" but ":" found T6963C_240x128.mbas
91 304 Syntax error: Expected "end" but "bag_open" found T6963C_240x128.mbas
91 304 Syntax error: Expected "sub" but "=" found T6963C_240x128.mbas
91 304 Syntax error: Expected "end" but "pinF" found T6963C_240x128.mbas
0 102 Finished (with errors): 19 май 2013, 21:54:46 T6963C_240x128.mbpav
Аватара пользователя
oleg110592
Друг Кота
Сообщения: 3832
Зарегистрирован: Сб сен 10, 2011 17:46:25

Re: mikrobasic-вопросы

Сообщение oleg110592 »

Гдето так:

Код: Выделить всё

sub procedure mm1() ' sub function
     bag_open = pinF.B0
     bag_close = pinF.B1
     bagage = pinF.B2
........
........   
end sub

main:       ' Start of program
........
........
while TRUE                    ' Endless loop
........
  mm1()
........
wend
end. ' End of program
Аватара пользователя
Каримов
Открыл глаза
Сообщения: 49
Зарегистрирован: Сб мар 19, 2011 17:58:36
Откуда: Красноярск

Re: mikrobasic-вопросы

Сообщение Каримов »

сделал как показали:
не хочет!

0 132 Compilation Started E:\MICROBASIC\1\T6963C_240x128.mbas
88 301 "sub"is not valid identifier T6963C_240x128.mbas
89 304 Syntax error: Expected "end" but "bag_open" found T6963C_240x128.mbas
89 304 Syntax error: Expected "sub" but "=" found T6963C_240x128.mbas
89 304 Syntax error: Expected "end" but "pinF" found T6963C_240x128.mbas
0 102 Finished (with errors): 19 май 2013, 22:11:18 T6963C_240x128.mbpav
Аватара пользователя
Каримов
Открыл глаза
Сообщения: 49
Зарегистрирован: Сб мар 19, 2011 17:58:36
Откуда: Красноярск

Re: mikrobasic-вопросы

Сообщение Каримов »

program T6963C_240x128
........
sub procedure mm1() 'ставил и здесь
-------
end sub

include __Lib_T6963C_Consts
.........

sub procedure mm1() 'ставил и здесь
-------
end sub

.........
main:
.........
mm1()
........
end.
Аватара пользователя
oleg110592
Друг Кота
Сообщения: 3832
Зарегистрирован: Сб сен 10, 2011 17:46:25

Re: mikrobasic-вопросы

Сообщение oleg110592 »

Вставте под спойлер весь код
Последний раз редактировалось oleg110592 Пн май 20, 2013 17:38:09, всего редактировалось 1 раз.
Аватара пользователя
Каримов
Открыл глаза
Сообщения: 49
Зарегистрирован: Сб мар 19, 2011 17:58:36
Откуда: Красноярск

Re: mikrobasic-вопросы

Сообщение Каримов »

я начинающий, спойлер-это где :shock:
Аватара пользователя
oleg110592
Друг Кота
Сообщения: 3832
Зарегистрирован: Сб сен 10, 2011 17:46:25

Re: mikrobasic-вопросы

Сообщение oleg110592 »

spoiler - выше там где ответ набираете
Аватара пользователя
Каримов
Открыл глаза
Сообщения: 49
Зарегистрирован: Сб мар 19, 2011 17:58:36
Откуда: Красноярск

Re: mikrobasic-вопросы

Сообщение Каримов »

sub procedure mm1()
^
-------
^
end sub

Так?
Аватара пользователя
oleg110592
Друг Кота
Сообщения: 3832
Зарегистрирован: Сб сен 10, 2011 17:46:25

Re: mikrobasic-вопросы

Сообщение oleg110592 »

вставляйте как есть
Спойлертак хотелось
Аватара пользователя
Каримов
Открыл глаза
Сообщения: 49
Зарегистрирован: Сб мар 19, 2011 17:58:36
Откуда: Красноярск

Re: mikrobasic-вопросы

Сообщение Каримов »

Спойлер' Programma initializacii atmega325p i displeya WB160128b

program T6963C_240x128

include __Lib_T6963C_Consts

' Nastroyka portov dlya displeya WB160128b
dim T6963C_dataPort as byte at PORTA ' DATA port
dim T6963C_dataPort_Direction as byte at DDRA ' DATA direction register
dim T6963C_ctrlPort as byte at PORTC ' CONTROL port
dim T6963C_ctrlPort_Direction as byte at DDRC ' CONTROL direction register
' Nastroyka BITov ypravleniya
dim T6963C_ctrlwr as sbit at PORTC3_bit ' WR write signal
dim T6963C_ctrlwr_Direction as sbit at DDC3_bit ' WR write signal direction
dim T6963C_ctrlrd as sbit at PORTC4_bit ' RD read signal
dim T6963C_ctrlrd_Direction as sbit at DDC4_bit ' RD read signal direction
dim T6963C_ctrlcd as sbit at PORTC6_bit ' CD command/data signal
dim T6963C_ctrlcd_Direction as sbit at DDC6_bit ' CD command/data signal direction
dim T6963C_ctrlrst as sbit at PORTC7_bit ' RST reset signal
dim T6963C_ctrlrst_Direction as sbit at DDC7_bit ' RST reset signal direction

' Signals not used by library, they are set in main sub function
dim T6963C_ctrlce as sbit at PORTC5_bit ' CE signal
dim T6963C_ctrlce_Direction as sbit at DDC5_bit ' CE signal direction
'dim T6963C_ctrlfs as sbit at PORTC2_bit ' FS signal
'dim T6963C_ctrlfs_Direction as sbit at DDC2_bit ' FS signal direction
'dim T6963C_ctrlmd as sbit at PORTC0_bit ' MD signal
'dim T6963C_ctrlmd_Direction as sbit at DDC0_bit ' MD signal direction
' End T6963C module connections

dim panel as byte ' current panel
i as word ' general purpose register
curs as byte ' cursor visibility
cposx, cposy as word ' cursor x-y position
txtcols as byte ' number of text coloms
txt, txt1, txt2, txt3, txt4, txt5, txt6, txt7, txt8,txt9, txt10 as string [29]

dim bag_open, bag_close as bit 'konceviki bagaghnika (PORT F, Bit0 Bit1)
bagage as bit 'koncevik krishki bagaghnika (PORT F, Bit2)
b_foor_open, b_foor_close as bit 'konceviki bolshoy krishi (PORT E, Bit0 Bit1)
s_foor_open, s_foor_close as bit 'konceviki maloy krishi (PORT E, Bit2 Bit3)
l_flap_open, l_flap_close as bit 'konceviki leviy zakrilok (PORT E, Bit4 Bit5)
r_flap_open, r_flap_close as bit 'konceviki praviy zakrilok (PORT E, Bit6 Bit7)
pulse as bit 'gatcik oborotov mechanizma (PORT G, Bit4)
dc_dc_27v as bit

dim textON as string[4]
textOFF as string[4]
text0 as string[14]
text1 as string[20]
text2 as string[9]
text3 as string[9]
text4 as string[9]
text5 as string[9]
text6 as string[9]
text7 as string[9]
text8 as string[9]
text9 as string[9]
text10 as string[9]


'Nastroyka porta D na vihod upravleniya
DDRD = $FF
Portd = %11111111
DDRE = $00
PortE = %00000000
DDRB = $00
PortB = %00000000
DDRF =$00
PortF = %00000000
DDRG =$00
PortG = %00000000
DDRC =$FF
PortC = %00000111


sub procedure mm1()

bag_open = pinF.B0
bag_close = pinF.B1
bagage = pinF.B2

b_foor_open = pinE.B0
b_foor_close = pinE.B1
s_foor_open = pinE.B2
s_foor_close = pinE.B3
l_flap_open = pinE.B4
l_flap_close = pinE.B5
r_flap_open = pinE.B6
r_flap_close = pinE.B7

pulse = pinG.B4
dc_dc_27v = pinF.B4

end sub








main:
text0 = "MANUAL CONTROL" 'ruchnoe upravlenie
text1 = "status of the switch" 'status koncevikov
text2 = "S.baggage" 'krishka bagaghnika
text3 = "M.baggage" 'bagaghnik
text4 = "M.leading" 'bolshaya krisha
text5 = "M.slave " 'malaya krisha
text6 = "M.flap_L " 'leviy zakrilok
text7 = "M.flap_R " 'praviy zakrilok
text8 = "Pulse1 " 'impulsi oborotov
text9 = "DC_27v " 'levaya dver
' text10 = "R.door " 'pravaya dver
textON = " 0"
textOFF = " 1"

T6963C_ctrlce_Direction = 1
T6963C_ctrlce = 0 ' Enable T6963C
'T6963C_ctrlfs_Direction = 1
' T6963C_ctrlfs = 0 ' Font Select 8x8
'T6963C_ctrlmd_Direction = 1
'T6963C_ctrlmd = 0 ' Column number select

panel = 0
i = 0
curs = 0
cposx = 0
cposy = 0

' Initialize T6369C
T6963C_init(160, 128, 8)

' *
' * Enable both graphics and text display at the same time
' *
T6963C_graphics(1)
T6963C_text(1)

T6963C_write_text(text0, 3, 0, T6963C_ROM_MODE_XOR) 'pechataem "puchnoe upravlenie"
T6963C_write_text(text1, 0, 1, T6963C_ROM_MODE_XOR) 'sostoyanie koncevikov
'goto MM1
while TRUE ' Endless loop

delay_ms 10
mm1()
delay_ms 10

wend
MM2:
if bagage = 0 then txt2 = text2 + textON
else txt2 = text2 + textOFF
end if

if bag_open = 0 then txt3 = text3 + textON
else txt3 = text3 + textOFF
end if
if bag_close = 0 then txt3 = txt3 + textON
else txt3 = txt3 + textOFF
end if

if b_foor_open = 0 then txt4 = text4 + textON
else txt4 = text4 + textOFF
end if
if b_foor_close = 0 then txt4 = txt4 + textON
else txt4 = txt4 + textOFF
end if

if s_foor_open = 0 then txt5 = text5 + textON
else txt5 = text5 + textOFF
end if
if s_foor_close = 0 then txt5 = txt5 + textON
else txt5 = txt5 + textOFF
end if

if l_flap_open = 0 then txt6 = text6 + textON
else txt6 = text6 + textOFF
end if
if l_flap_close = 0 then txt6 = txt6 + textON
else txt6 = txt6 + textOFF
end if

if r_flap_open = 0 then txt7 = text7 + textON
else txt7 = text7 + textOFF
end if
if r_flap_close = 0 then txt7 = txt7 + textON
else txt7 = txt7 + textOFF
end if

if pulse = 0 then txt8 = text8 + textON
else txt8 = text8 + textOFF
end if

if dc_dc_27v = 0 then txt9 = text9 + textON
else txt9 = text9 + textOFF
end if

' if r_door = 0 then txt10 = text10 + textON
' else txt10 = text10 + textOFF
' end if

T6963C_write_text(txt2, 0, 3, T6963C_ROM_MODE_XOR)
T6963C_write_text(txt3, 0, 4, T6963C_ROM_MODE_XOR)
T6963C_write_text(txt4, 0, 5, T6963C_ROM_MODE_XOR)
T6963C_write_text(txt5, 0, 6, T6963C_ROM_MODE_XOR)
T6963C_write_text(txt6, 0, 7, T6963C_ROM_MODE_XOR)
T6963C_write_text(txt7, 0, 8, T6963C_ROM_MODE_XOR)
T6963C_write_text(txt8, 0, 10, T6963C_ROM_MODE_XOR)
T6963C_write_text(txt9, 0, 11, T6963C_ROM_MODE_XOR)
T6963C_write_text(txt10, 0, 12, T6963C_ROM_MODE_XOR)


' *
' * Cursor
' *
' T6963C_cursor_height(8) ' 8 pixel height
' T6963C_set_cursor(0, 0) ' Move cursor to top left
'T6963C_cursor(0) ' Cursor off

' *
' * Draw rectangles
' *
T6963C_rectangle(0, 104, 63, 127, T6963C_WHITE)

T6963C_rectangle(159-64, 104, 159, 127, T6963C_WHITE)
' T6963C_rectangle(20, 20, 219, 107, T6963C_WHITE)
' T6963C_rectangle(40, 40, 199, 87, T6963C_WHITE)
' T6963C_rectangle(60, 60, 179, 67, T6963C_WHITE)

' *
' * Draw a cross
' *
' T6963C_line(0, 0, 159, 127, T6963C_WHITE)
' T6963C_line(0, 127, 159, 0, T6963C_WHITE)

' *
' * Draw solid boxes
' *
' T6963C_box(0, 0, 159, 8, T6963C_WHITE)
' T6963C_box(0, 119, 159, 127, T6963C_WHITE)
' goto MM1
end.
Аватара пользователя
oleg110592
Друг Кота
Сообщения: 3832
Зарегистрирован: Сб сен 10, 2011 17:46:25

Re: mikrobasic-вопросы

Сообщение oleg110592 »

Установил и проверил:
Спойлер

Код: Выделить всё

program Proba

' Programma initializacii atmega325p i displeya WB160128b

include __Lib_T6963C_Consts

' Nastroyka portov dlya displeya WB160128b
dim T6963C_dataPort as byte at PORTA ' DATA port
dim T6963C_dataPort_Direction as byte at DDRA ' DATA direction register
dim T6963C_ctrlPort as byte at PORTC ' CONTROL port
dim T6963C_ctrlPort_Direction as byte at DDRC ' CONTROL direction register
' Nastroyka BITov ypravleniya
dim T6963C_ctrlwr as sbit at PORTC3_bit ' WR write signal
dim T6963C_ctrlwr_Direction as sbit at DDC3_bit ' WR write signal direction
dim T6963C_ctrlrd as sbit at PORTC4_bit ' RD read signal
dim T6963C_ctrlrd_Direction as sbit at DDC4_bit ' RD read signal direction
dim T6963C_ctrlcd as sbit at PORTC6_bit ' CD command/data signal
dim T6963C_ctrlcd_Direction as sbit at DDC6_bit ' CD command/data signal direction
dim T6963C_ctrlrst as sbit at PORTC7_bit ' RST reset signal
dim T6963C_ctrlrst_Direction as sbit at DDC7_bit ' RST reset signal direction

' Signals not used by library, they are set in main sub function
dim T6963C_ctrlce as sbit at PORTC5_bit ' CE signal
dim T6963C_ctrlce_Direction as sbit at DDC5_bit ' CE signal direction
'dim T6963C_ctrlfs as sbit at PORTC2_bit ' FS signal
'dim T6963C_ctrlfs_Direction as sbit at DDC2_bit ' FS signal direction
'dim T6963C_ctrlmd as sbit at PORTC0_bit ' MD signal
'dim T6963C_ctrlmd_Direction as sbit at DDC0_bit ' MD signal direction
' End T6963C module connections

dim panel as byte ' current panel
i as word ' general purpose register
curs as byte ' cursor visibility
cposx, cposy as word ' cursor x-y position
txtcols as byte ' number of text coloms
txt, txt1, txt2, txt3, txt4, txt5, txt6, txt7, txt8,txt9, txt10 as string [29]

dim bag_open, bag_close as bit 'konceviki bagaghnika (PORT F, Bit0 Bit1)
bagage as bit 'koncevik krishki bagaghnika (PORT F, Bit2)
b_foor_open, b_foor_close as bit 'konceviki bolshoy krishi (PORT E, Bit0 Bit1)
s_foor_open, s_foor_close as bit 'konceviki maloy krishi (PORT E, Bit2 Bit3)
l_flap_open, l_flap_close as bit 'konceviki leviy zakrilok (PORT E, Bit4 Bit5)
r_flap_open, r_flap_close as bit 'konceviki praviy zakrilok (PORT E, Bit6 Bit7)
pulse as bit 'gatcik oborotov mechanizma (PORT G, Bit4)
dc_dc_27v as bit

dim textON as string[4]
textOFF as string[4]
text0 as string[14]
text1 as string[20]
text2 as string[9]
text3 as string[9]
text4 as string[9]
text5 as string[9]
text6 as string[9]
text7 as string[9]
text8 as string[9]
text9 as string[9]
text10 as string[9]


sub procedure mm1()

bag_open = pinF.B0
bag_close = pinF.B1
bagage = pinF.B2

b_foor_open = pinE.B0
b_foor_close = pinE.B1
s_foor_open = pinE.B2
s_foor_close = pinE.B3
l_flap_open = pinE.B4
l_flap_close = pinE.B5
r_flap_open = pinE.B6
r_flap_close = pinE.B7

pulse = pinG.B4
dc_dc_27v = pinF.B4
end sub

sub procedure mm2()

if bagage = 0 then txt2 = text2 + textON
else txt2 = text2 + textOFF
end if

if bag_open = 0 then txt3 = text3 + textON
else txt3 = text3 + textOFF
end if
if bag_close = 0 then txt3 = txt3 + textON
else txt3 = txt3 + textOFF
end if

if b_foor_open = 0 then txt4 = text4 + textON
else txt4 = text4 + textOFF
end if
if b_foor_close = 0 then txt4 = txt4 + textON
else txt4 = txt4 + textOFF
end if

if s_foor_open = 0 then txt5 = text5 + textON
else txt5 = text5 + textOFF
end if
if s_foor_close = 0 then txt5 = txt5 + textON
else txt5 = txt5 + textOFF
end if

if l_flap_open = 0 then txt6 = text6 + textON
else txt6 = text6 + textOFF
end if
if l_flap_close = 0 then txt6 = txt6 + textON
else txt6 = txt6 + textOFF
end if

if r_flap_open = 0 then txt7 = text7 + textON
else txt7 = text7 + textOFF
end if
if r_flap_close = 0 then txt7 = txt7 + textON
else txt7 = txt7 + textOFF
end if

if pulse = 0 then txt8 = text8 + textON
else txt8 = text8 + textOFF
end if

if dc_dc_27v = 0 then txt9 = text9 + textON
else txt9 = text9 + textOFF
end if

' if r_door = 0 then txt10 = text10 + textON
' else txt10 = text10 + textOFF
' end if

T6963C_write_text(txt2, 0, 3, T6963C_ROM_MODE_XOR)
T6963C_write_text(txt3, 0, 4, T6963C_ROM_MODE_XOR)
T6963C_write_text(txt4, 0, 5, T6963C_ROM_MODE_XOR)
T6963C_write_text(txt5, 0, 6, T6963C_ROM_MODE_XOR)
T6963C_write_text(txt6, 0, 7, T6963C_ROM_MODE_XOR)
T6963C_write_text(txt7, 0, 8, T6963C_ROM_MODE_XOR)
T6963C_write_text(txt8, 0, 10, T6963C_ROM_MODE_XOR)
T6963C_write_text(txt9, 0, 11, T6963C_ROM_MODE_XOR)
T6963C_write_text(txt10, 0, 12, T6963C_ROM_MODE_XOR)


' *
' * Cursor
' *
' T6963C_cursor_height(8) ' 8 pixel height
' T6963C_set_cursor(0, 0) ' Move cursor to top left
'T6963C_cursor(0) ' Cursor off

' *
' * Draw rectangles
' *
T6963C_rectangle(0, 104, 63, 127, T6963C_WHITE)

T6963C_rectangle(159-64, 104, 159, 127, T6963C_WHITE)
' T6963C_rectangle(20, 20, 219, 107, T6963C_WHITE)
' T6963C_rectangle(40, 40, 199, 87, T6963C_WHITE)
' T6963C_rectangle(60, 60, 179, 67, T6963C_WHITE)

' *
' * Draw a cross
' *
' T6963C_line(0, 0, 159, 127, T6963C_WHITE)
' T6963C_line(0, 127, 159, 0, T6963C_WHITE)

' *
' * Draw solid boxes
' *
' T6963C_box(0, 0, 159, 8, T6963C_WHITE)
' T6963C_box(0, 119, 159, 127, T6963C_WHITE)
' goto MM1
end sub





main:
'Nastroyka porta D na vihod upravleniya
DDRD = $FF
Portd = %11111111
DDRE = $00
PortE = %00000000
DDRB = $00
PortB = %00000000
DDRF =$00
PortF = %00000000
DDRG =$00
PortG = %00000000
DDRC =$FF
PortC = %00000111

text0 = "MANUAL CONTROL" 'ruchnoe upravlenie
text1 = "status of the switch" 'status koncevikov
text2 = "S.baggage" 'krishka bagaghnika
text3 = "M.baggage" 'bagaghnik
text4 = "M.leading" 'bolshaya krisha
text5 = "M.slave " 'malaya krisha
text6 = "M.flap_L " 'leviy zakrilok
text7 = "M.flap_R " 'praviy zakrilok
text8 = "Pulse1 " 'impulsi oborotov
text9 = "DC_27v " 'levaya dver
' text10 = "R.door " 'pravaya dver
textON = " 0"
textOFF = " 1"

T6963C_ctrlce_Direction = 1
T6963C_ctrlce = 0 ' Enable T6963C
'T6963C_ctrlfs_Direction = 1
' T6963C_ctrlfs = 0 ' Font Select 8x8
'T6963C_ctrlmd_Direction = 1
'T6963C_ctrlmd = 0 ' Column number select

panel = 0
i = 0
curs = 0
cposx = 0
cposy = 0

' Initialize T6369C
T6963C_init(160, 128, 8)

' *
' * Enable both graphics and text display at the same time
' *
T6963C_graphics(1)
T6963C_text(1)

T6963C_write_text(text0, 3, 0, T6963C_ROM_MODE_XOR) 'pechataem "puchnoe upravlenie"
T6963C_write_text(text1, 0, 1, T6963C_ROM_MODE_XOR) 'sostoyanie koncevikov
'goto MM1
while TRUE ' Endless loop

delay_ms 10
mm1()
delay_ms 10
wend

end.
Аватара пользователя
Каримов
Открыл глаза
Сообщения: 49
Зарегистрирован: Сб мар 19, 2011 17:58:36
Откуда: Красноярск

Re: mikrobasic-вопросы

Сообщение Каримов »

:beer: Спасибо! Пошло! Пробуем дальше.
Аватара пользователя
Каримов
Открыл глаза
Сообщения: 49
Зарегистрирован: Сб мар 19, 2011 17:58:36
Откуда: Красноярск

Re: mikrobasic-вопросы

Сообщение Каримов »

А как организовать счетчик импульсов(по перепаду) приходящий на PG4/T0?
Надо, независимо от хода программы, сохранять подсчет этих импульсов в переменной. И вызывать после каждого импульса подпрограмму обработки этой переменной. :tea:
Ответить

Вернуться в «Разные вопросы по МК»