This file contains 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
//Arduion 基础入门套件教程 第6章 交通灯设计实验 | |
int ledred = 10; //red led | |
int ledyellow = 7; //yellow led | |
int ledgreen = 4; //green led | |
void setup() | |
{ | |
pinMode(ledred,OUTPUT); | |
pinMode(ledyellow,OUTPUT); | |
pinMode(ledgreen,OUTPUT); |
This file contains 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
//Arduion 基础入门套件教程 第7章 蜂鸣器实验 | |
int buzzer = 7; | |
void setup() | |
{ | |
pinMode(buzzer,OUTPUT); | |
} | |
void loop() | |
{ |
This file contains 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
int photocellPin = 2; //定义变量 photocellsh=2,为电压读取端口 | |
int ledPin = 12; //定义变量ledPin=12,为led电平输出端口 | |
int val = 0; //定义val变量的起始值 | |
void setup() | |
{ | |
pinMode(ledPin,OUTPUT); //使ledPin为输出端口 | |
Serial.begin(9600); | |
} |
This file contains 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
int potPin = 2; //定义模拟端口2连接LM35温度传感器 | |
void setup() | |
{ | |
Serial.begin(9600); | |
} | |
void loop() | |
{ | |
int val; //存放读取的电压值 |
This file contains 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
create table mainlog(id INTEGER PRIMARY KEY AUTOINCREMENT,user_id INTEGER,logdate DATE,start_time DATETIME,end_time DATETIME,created_at DATETIME,update_at DATETIME) | |
INSERT INTO mainlog (id, user_id, logdate,start_time, end_time, created_at, update_at) VALUES(1, 64, \'2017-05-20\', \'2017-05-20 22:55:57\', \'2017-05-20 23:05:46\', \'2017-05-20 22:55:57\', \'0000-00-00 00:00:00\') |
This file contains 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
<?php | |
//read log file each line,i only need get url line,so use strpos method | |
// my log file text is: | |
// /test/index.php //url | |
// 2017-11-19 00:00;:00 // datetime | |
// <pre>Array // echo "<pre>";print_r(array());echo "</pre>"; | |
// ( | |
// ) | |
// </pre> |
This file contains 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
<?php | |
function p($array){ | |
echo "<pre>"; | |
print_r($array); | |
echo "</pre>"; | |
} | |
$array = array(); | |
for($i = 0;$i < 5;$i++){ |
This file contains 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
<?php | |
//php connection to mqtt server(rabbitmq) | |
//use https://packagist.org/packages/php-amqplib/php-amqplib | |
define('AMQP_DEBUG', true); | |
require_once __DIR__.'/vendor/autoload.php'; | |
use PhpAmqpLib\Connection\AMQPStreamConnection; | |
use PhpAmqpLib\Message\AMQPMessage; | |
$exchange = 'fanout2'; | |
$queue = 'test'; |
This file contains 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
#include <opencv2./opencv.hpp> | |
#include "opencv2/highgui/highgui.hpp" | |
using namespace std; | |
using namespace cv; | |
#define WINDOW_NAME "【线性混合示例】" //为窗口标题定义的宏 | |
const int g_nMaxAlphaValue = 100; //Alpha 值的最大值 | |
int g_nAlphaValueSlider; //滑动条对应的变量 |
This file contains 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
#include <opencv2/opencv.hpp> | |
using namespace std; | |
using namespace cv; | |
int main() | |
{ | |
//打开视频文件 | |
VideoCapture capture(0); //"1.mp4" | |