Created
January 27, 2013 07:23
-
-
Save pureexe/4647206 to your computer and use it in GitHub Desktop.
แจ้งไฟไหม้ของผักบุ้ง Add led กระพิบ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*** | |
| ลำโพงต่อ 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