Программирование BASCOM
[ Новые сообщения · Участники · Правила форума · Поиск · RSS ]
Страница 1 из 11
Форум » BASCOM » Исходники » Полицейская сирена с AVR FREAKS (Police Alarm With ATmega8)
Полицейская сирена с AVR FREAKS (Police Alarm With ATmega8)
radanДата: Четверг, 26.03.2009, 16:47 | Сообщение # 1
Группа: Удаленные





Code

'///////////////////////////////////////////////////////////////////////////////
'//                   Police Alarm With ATmega8 (Use 4%)                      //
'//                      Compiler: Bascom 1.11.9.0                            //
'//                     Programmer: Behnam zakizadeh                          //
'//                        Web: www.avr64.com                    //
'//                    Email: Behnamzaki@hotmail.com                           //
'///////////////////////////////////////////////////////////////////////////////

$regfile = "m8def.dat"
$crystal = 1000000

Dim Frq As Word
Dim D As Word

Config Pind.0 = Output
Spkr Alias Pind.0

'----------------------------------
Do
    For Frq = 50 To 20 Step -1                    'Step -1 => Speed
       D = 51 - Frq
       Sound Spkr , D , Frq
    Next Frq
    For Frq = 20 To 50 Step 1                    'Step  1 => Speed
       D = 51 - Frq
       Sound Spkr , D , Frq
    Next Frq
Loop
'----------------------------------

'(
Do
    Sound Spkr , 420 , 60
    Sound Spkr , 620 , 40
Loop

Do
    For Frq = 1 To 80
       Set Portd.0
       Waitms 3
       Reset Portd.0
       Waitms 3
    Next Frq
    Waitms 500
Loop
')

End
 
Форум » BASCOM » Исходники » Полицейская сирена с AVR FREAKS (Police Alarm With ATmega8)
Страница 1 из 11
Поиск:

Copyright Radan Studio © 2017