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
import os | |
import paho.mqtt.client as mqtt | |
# MQTT 代理地址和端口 | |
broker_address = "192.168.xx.xx" | |
broker_port = 1883 | |
# 文件路径 | |
file_path = "160x128_demo_.jpg" |
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
//npm i serialport | |
const SerialPort = require('serialport').SerialPort; | |
var port = new SerialPort({ | |
path: '/dev/ttyUSB0', | |
baudRate: 9600, //波特率 | |
dataBits: 8, //数据位 | |
parity: 'none', //奇偶校验 | |
stopBits: 1, //停止位 | |
flowControl: false | |
}, false); // this is the openImmediately flag [default is true] |
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
const fs = require('fs'); | |
const WIDTH = 512; | |
const HEIGHT = 32; | |
// 打开虚拟的 V4L 设备文件 | |
const v4l2Device = fs.openSync('/dev/video0', 'w'); | |
// 创建虚拟视频帧数据 |
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
/* | |
From https://github.com/JSchaenzle/c-message-queue | |
20240224: Add 2 APIs | |
20240226: shxt.Bugs. (p_queue->read_idx)++ & (capacity - 1) => (p_queue->read_idx)++ % capacity | |
*/ | |
#ifndef QUEUE_H | |
#define QUEUE_H | |
#include <stdint.h> | |
#include <stdbool.h> | |
#include <string.h> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Hello OpenCV.js</title> | |
</head> | |
<body> | |
<h2>本demo展示了使用getPerspectiveTransform函数获取变换矩阵,并使用warpPerspective函数变换图片的能力.</h2> |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"> | |
<title>Matter-JS</title> | |
<script src="https://brm.io/matter-js/demo/js/lib/decomp.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/matter-js/0.14.2/matter.js"></script> | |
<script src="http://raw.githack.com/liabru/matter-attractors/master/build/matter-attractors.min.js"></script> |
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
// console.log/warn/error/info 均可用 | |
// console.log('ha', 'hi'); | |
// console.show(false); //停止显示log | |
// console.save(true); //开始存储log | |
// logs = console.cache(); //获取log数组,并清空log缓存 | |
window.console = (function (origConsole) { |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<title>DsTest</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<!--link rel="stylesheet" type="text/css" media="screen" href="main.css" /--> | |
<script src="https://cdn.bootcss.com/deepstream.io-client-js/2.2.1/deepstream.js"></script> | |
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script> |
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
function adjust(canvas, rw, rh) { | |
var width = window.innerWidth; | |
//var ratio = rw / rh; //canvas.width / canvas.height; | |
//var height = width / ratio; | |
if(!rw){ | |
rw = canvas.width | |
rh = canvas.height | |
} | |
var height = width * rh / rw ; |
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
<html> | |
<head> | |
<title>WASM check</title> | |
</head> | |
<body> | |
<script type="text/javascript"> |
NewerOlder