Вы находитесь на странице: 1из 1

' ---------------------

[���������]----------------------------------------------------
'
' ����......proj04PBC.bas
' ������....PicBasic Compiler
' ����......��������� � ����� PORTA ��� ������ ������ PEEK � POKE
' �����.....��� ��������
' ������....1 �� 2000 ����
' �������...
'
'
' ---------------------[��������
���������]-----------------------------------------------
' ��� ��������� ����������, ��� ����� ��������� � ����� PORTA ��� ������ ������
' PicBasic'� PEEK � POKE
'
' ---------------------[��������� � �������
PBC]------------------------------------------

Symbol PortA = 5 ' ����� ����� PORTA


Symbol TrisA = $85 ' ����� �������� ���������� �������� ������
' ����� ���� PORTA
Symbol ADCON1 = $F9 ' ����� �������� ��������� ��� (��������������
' ���������� ������ PORTA)

Init:
poke TrisA, %00000001 ' ������� ������ RA5�RA1 ����� PORTA ��������,
' � ����� RA0 - ������
poke PortA, %00000010 ' ������ ������� ������� �� ����� RA1 ����� PORTA,
' ����� ������ ��������� VD1
poke ADCON1, 6 ' ������� PORTA ������� �������� ������ �����/������

Main:
' **********************��������� ��������
������****************************************

peek PortA, B0 ' ������� ���������� ���� ������� ����� PORTA


' � ��������� � B0

B0 = B0 & %00000001 ' �������� � 0 ��� ���� � B0, ����� ���� 0

if B0 = 0 then led2 ' ���� ������ ��������, ������� � ����� LED2

poke PortA, %00000010 ' ������� VD1, �������� VD2

goto Main ' ������� � ������ �������� ���������

LED2:
' **********************������� ���������
VD2*********************************************

poke PortA, %00000100 ' ������� VD2, �������� VD1

goto Main ' ������� � ������ �������� ���������

Вам также может понравиться

  • Proj12pbc Bas
    Proj12pbc Bas
    Документ2 страницы
    Proj12pbc Bas
    insomnium86
    Оценок пока нет
  • Proj03pbc Bas
    Proj03pbc Bas
    Документ2 страницы
    Proj03pbc Bas
    insomnium86
    Оценок пока нет
  • Proj09pbc Bas
    Proj09pbc Bas
    Документ5 страниц
    Proj09pbc Bas
    insomnium86
    Оценок пока нет
  • Proj13pbc Bas
    Proj13pbc Bas
    Документ2 страницы
    Proj13pbc Bas
    insomnium86
    Оценок пока нет
  • Proj15pro Bas
    Proj15pro Bas
    Документ3 страницы
    Proj15pro Bas
    insomnium86
    Оценок пока нет
  • Proj10pro Bas
    Proj10pro Bas
    Документ2 страницы
    Proj10pro Bas
    insomnium86
    Оценок пока нет
  • Proj15pbc Bas
    Proj15pbc Bas
    Документ3 страницы
    Proj15pbc Bas
    insomnium86
    Оценок пока нет
  • Proj04pro Bas
    Proj04pro Bas
    Документ1 страница
    Proj04pro Bas
    insomnium86
    Оценок пока нет
  • Proj10pbc Bas
    Proj10pbc Bas
    Документ2 страницы
    Proj10pbc Bas
    insomnium86
    Оценок пока нет
  • Proj09pro Bas
    Proj09pro Bas
    Документ4 страницы
    Proj09pro Bas
    insomnium86
    Оценок пока нет
  • Proj06pro Bas
    Proj06pro Bas
    Документ2 страницы
    Proj06pro Bas
    insomnium86
    Оценок пока нет
  • Proj08pbc Bas
    Proj08pbc Bas
    Документ3 страницы
    Proj08pbc Bas
    insomnium86
    Оценок пока нет
  • Proj13pro Bas
    Proj13pro Bas
    Документ3 страницы
    Proj13pro Bas
    insomnium86
    Оценок пока нет
  • Proj07pro Bas
    Proj07pro Bas
    Документ2 страницы
    Proj07pro Bas
    insomnium86
    Оценок пока нет
  • Proj06pbc Bas
    Proj06pbc Bas
    Документ2 страницы
    Proj06pbc Bas
    insomnium86
    Оценок пока нет
  • Proj01pro Bas
    Proj01pro Bas
    Документ1 страница
    Proj01pro Bas
    insomnium86
    Оценок пока нет
  • Proj11pro Bas
    Proj11pro Bas
    Документ2 страницы
    Proj11pro Bas
    insomnium86
    Оценок пока нет
  • Proj01pbc Bas
    Proj01pbc Bas
    Документ1 страница
    Proj01pbc Bas
    insomnium86
    Оценок пока нет
  • Proj03pro Bas
    Proj03pro Bas
    Документ2 страницы
    Proj03pro Bas
    insomnium86
    Оценок пока нет
  • Proj05pro Bas
    Proj05pro Bas
    Документ2 страницы
    Proj05pro Bas
    insomnium86
    Оценок пока нет
  • Proj02pro Bas
    Proj02pro Bas
    Документ2 страницы
    Proj02pro Bas
    insomnium86
    Оценок пока нет
  • Proj05pbc Bas
    Proj05pbc Bas
    Документ3 страницы
    Proj05pbc Bas
    insomnium86
    Оценок пока нет
  • Proj14pro Bas
    Proj14pro Bas
    Документ3 страницы
    Proj14pro Bas
    insomnium86
    Оценок пока нет
  • Proj02pbc Bas
    Proj02pbc Bas
    Документ2 страницы
    Proj02pbc Bas
    insomnium86
    Оценок пока нет
  • Proj07pbc Bas
    Proj07pbc Bas
    Документ3 страницы
    Proj07pbc Bas
    insomnium86
    Оценок пока нет
  • Proj08pro Bas
    Proj08pro Bas
    Документ3 страницы
    Proj08pro Bas
    insomnium86
    Оценок пока нет
  • Proj11pbc Bas
    Proj11pbc Bas
    Документ2 страницы
    Proj11pbc Bas
    insomnium86
    Оценок пока нет
  • Proj12pro Bas
    Proj12pro Bas
    Документ2 страницы
    Proj12pro Bas
    insomnium86
    Оценок пока нет
  • Proj14pbc Bas
    Proj14pbc Bas
    Документ3 страницы
    Proj14pbc Bas
    insomnium86
    Оценок пока нет