Skip to content

Instantly share code, notes, and snippets.

@pureexe
Created January 27, 2013 07:23
Show Gist options
  • Select an option

  • Save pureexe/4647206 to your computer and use it in GitHub Desktop.

Select an option

Save pureexe/4647206 to your computer and use it in GitHub Desktop.
แจ้งไฟไหม้ของผักบุ้ง Add led กระพิบ
/***
ลำโพงต่อ PD0
ไฟต่อ PD1
เทอร์โมต่อ PA4
***/
#include<sleep.h>
#include<sound.h>
#include<analog.h>
#include<in_out.h>
#define REF 850
int main()
{
int a,ledstatus=0;
while(1)
{
a=1023–analog(4);
if(a>REF)
{
beep_d(0);
out_d(1,ledstatus%2);
}
sleep(200);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment