Задание№3-1
<source lang="vb">
$prog &HFF , &HE4 , &HD9 , &H00 'óêàçûâàåì êàêèå ôóñèáèòû íàäî ïðîøèòü
$regfile = "m32def.dat" ' ôàéë ñïåöèôèêàöèè Ìåãè32
$crystal = 8000000 ' óêàçûâàåì íà êàêîé ÷àñòîòå áóäåì ðàáîòàòü
'---------------------------------------------------------------------------- Config Timer1 = Pwm , Pwm = 8 , Prescale = 1 , Compare A Pwm = Clear Down , Compare B Pwm = Clear Down Config Pinc.2 = Output : Drl Alias Portc.2 'íîãó ñêîíôèãóðèðîâàëè êàê âûõîä è îáîçâàëè Drl Config Pinc.3 = Output : Drr Alias Portc.3 'íîãó ñêîíôèãóðèðîâàëè êàê âûõîä è îáîçâàëè Drr Config Pind.4 = Output 'íîãó ØÈÌà ëåâîãî äâèæêà ñêîíôèãóðèðîâàëè êàê âûõîä Config Pind.5 = Output 'íîãó ØÈÌà ïðàâîãî äâèæêà ñêîíôèãóðèðîâàëè êàê âûõîä Config Pinb.0 = Output '---------------------------------------------------------------------------- Declare Sub Povorot(byval Gradus As Byte)
Do
Call Povorot(30)
Loop
Sub Povorot(byval Gradus As Byte)
Local A As Byte
Local Temp As Word
Temp = Gradus / 10 Portb.0 = 1 Waitus 500 For A = 1 To Temp Waitus 111 Next portb.0=1 Waitus 18000
End Sub
</source>