英锐恩单片机论坛,Microchip单片机,模拟器件,接口电路,麦肯单片机,单片机应用交流
标题:
picoBAT
[打印本页]
作者:
star
时间:
2012-8-21 15:43
标题:
picoBAT
[attach]753[/attach]
/*
***************************************************************
****************
* picoBAT : an ultra simple ultrasonic bat detector
***************************************************************
****************
*
*
*
*
* source code for mikro C compiler V8.2
* feel free to use this code at your own risks
*
* target : PIC12
*
* PIC PIN Assignemnt :
*
* GP0 GP1 : piezo speaker
* GP5 : ultrasonic transducer receiver
*
***************************************************************
****************
*/
void
main()
{
/*
* configure GPIO as digital port
*/
CMCON0
=
7
;
ANSEL
=
0
;
TRISIO
=
0
;
GPIO
=
0b01
;
for(;;)
{
/*
* toggles speaker outputs
*/
GPIO
^=
0b11
;
}
}
欢迎光临 英锐恩单片机论坛,Microchip单片机,模拟器件,接口电路,麦肯单片机,单片机应用交流 (http://enroobbs.com/)
Powered by Discuz! X3.2