picoBAT
/*
***************************************************************
****************
* 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
;
}
}
页:
[1]