分类 科学 的文章

红外热成像测试

ir (3).jpg
微信图片_20210718135025.jpg
微信图片_20210718135017.jpg

  # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT

"""This example is for Raspberry Pi (Linux) only!
   It will not work on microcontrollers running CircuitPython!"""

import math
from PIL import Image
import board
import adafruit_mlx90640

FILENAME = "mlx.jpg"

MINTEMP = 25.0  # low range of the sensor (deg C)
MAXTEMP = 45.0  # high range of the sensor (deg C)
COLORDEPTH = 1000  # how many color values we can have
INTERPOLATE = 10  # scale factor for final image

mlx = adafruit_mlx90640.MLX90640(board.I2C())

# the list of colors we can choose from
heatmap = (
    (0.0, (0, 0, 0)),
    (0.20, (0, 0, 0.5)),
    (0.40, (0, 0.5, 0)),
    (0.60, (0.5, 0, 0)),
    (0.80, (0.75, 0.75, 0)),
    (0.90, (1.0, 0.75, 0)),
    (1.00, (1.0, 1.0, 1.0)),
)

colormap = [0] * COLORDEPTH

# some utility functions
def constrain(val, min_val, max_val):
    return min(max_val, max(min_val, val))


def map_value(x, in_min, in_max, out_min, out_max):
    return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min


def gaussian(x, a, b, c, d=0):
    return a * math.exp(-((x - b) ** 2) / (2 * c ** 2)) + d


def gradient(x, width, cmap, spread=1):
    width = float(width)
    r = sum(
        [gaussian(x, p[1][0], p[0] * width, width / (spread * len(cmap))) for p in cmap]
    )
    g = sum(
        [gaussian(x, p[1][1], p[0] * width, width / (spread * len(cmap))) for p in cmap]
    )
    b = sum(
        [gaussian(x, p[1][2], p[0] * width, width / (spread * len(cmap))) for p in cmap]
    )
    r = int(constrain(r * 255, 0, 255))
    g = int(constrain(g * 255, 0, 255))
    b = int(constrain(b * 255, 0, 255))
    return r, g, b


for i in range(COLORDEPTH):
    colormap[i] = gradient(i, COLORDEPTH, heatmap)

# get sensor data
frame = [0] * 768
success = False
while not success:
    try:
        mlx.getFrame(frame)
        success = True
    except ValueError:
        continue

# create the image
pixels = [0] * 768
for i, pixel in enumerate(frame):
    coloridx = map_value(pixel, MINTEMP, MAXTEMP, 0, COLORDEPTH - 1)
    coloridx = int(constrain(coloridx, 0, COLORDEPTH - 1))
    pixels[i] = colormap[coloridx]
    print(pixels[i])

# save to file
img = Image.new("RGB", (32, 24))
img.putdata(pixels)
img = img.transpose(Image.FLIP_TOP_BOTTOM)
img = img.resize((32 * INTERPOLATE, 24 * INTERPOLATE), Image.BICUBIC)
img.save("ir.jpg")

使用esp8266 连接 见登iot 远程控制继电器

微信截图_20210131131922.png

 #include <ESP8266WiFi.h>
    #include <PubSubClient.h>
    #include <ArduinoJson.h>
     
    const char* ssid = "Sanby";
    const char* password = "1234567890";
    const char* mqtt_server = "182.92.223.22";
    const char* mqtt_id = "v1/devices/me/telemetry";
    const char* mqtt_subid = "v1/devices/me/rpc/request/+";
    const int mqttPort = 1883;
    
     
    WiFiClient espClient;
    PubSubClient client(espClient);
    int switch1=0;
    int tempture=0;
    void setup() {
    
      Serial.begin(115200);
     
      WiFi.begin(ssid, password);
     
      while (WiFi.status() != WL_CONNECTED) {
        delay(500);
        Serial.println("Connecting to WiFi..");
      }
      Serial.println("Connected to the WiFi network");
     
      client.setServer(mqtt_server, mqttPort);
      client.setCallback(callback);
     
      while (!client.connected()) {
        Serial.println("Connecting to MQTT...");
     
        if (client.connect("93834a00-2631-11eb-af1a-37260a6003e5","DHT11_DEMO_TOKEN","")) {
          Serial.println("connected");  
     
        } else {
     
          Serial.print("failed with state ");
          Serial.print(client.state());
          delay(2000);
     
        }
      }
     
      client.publish(mqtt_id, "{'value':10.0}");
      client.subscribe(mqtt_subid);
     
    }
     
    void callback(char* topic, byte* payload, unsigned int length) {
      DynamicJsonDocument doc(1024);
      Serial.print("Message arrived in topic: ");
      Serial.println(topic);
      Serial.print("Message:");
      Serial.println((char *)payload);
      DeserializationError error = deserializeJson(doc, payload);
      if(error)return;
      String method_=doc["method"];
      String params_=doc["params"];
      if(!method_.compareTo("setLight1SwitchStatus"))
      {
        
         if(!params_.compareTo("on")){digitalWrite(0,HIGH);pinMode(0,OUTPUT);}
         if(!params_.compareTo("off")){digitalWrite(0,LOW);pinMode(0,OUTPUT);};
      }
      if(!method_.compareTo("setLight2SwitchStatus"))
      {
         if(!params_.compareTo("on")){digitalWrite(0,HIGH);pinMode(0,OUTPUT);}
         if(!params_.compareTo("off")){digitalWrite(0,LOW);pinMode(0,OUTPUT);}
      }
      Serial.println(doc["method"].as<String>());
      Serial.println(doc["params"].as<String>());
    }
    
    void loop() {
      client.loop();
      
      tempture++;
      if(tempture%100000==0)
      {
        String bbbb= "{\"tongjinlv\":"+String(tempture)+"}";
        client.publish(mqtt_id, bbbb.c_str());
        Serial.println(bbbb.c_str());
      }
      if(!client.connected())setup();
      if(WiFi.status() != WL_CONNECTED)ESP.reset();
    }

kicad 视频教程

1-KiCad-9分钟学会绘制原理图.mp4
10-KiCad-9分钟学会层次图与设计规则.mp4
11-KiCad-9分钟学会圆形覆铜+禁止覆铜+批量地过孔.mp4
12-KiCad-9分钟学会封装自动排列和批量选择与编辑.mp4
2-KiCad-9分钟学会绘制PCB.mp4
3-KiCad-9分钟学会出Gerber文件.mp4
4-KiCad-9分钟学会安装使用插件.mp4
5-KiCad-9分钟学会编辑符号库.mp4
6-Kicad-9分钟学会封装向导.mp4
7-kiCad-9分钟学会手工创建封装.mp4
8-KiCad-9分钟学会弧线和微带线过孔.mp4
9-KiCad-9分钟学会蛇形等长布线.mp4

节约网站空间,没上传,需要的微信或qq联系索取

微信截图_20201209113315.png

节约网站空间,没上传,需要的微信或qq联系索取

拆了一个oid 机器人

微信图片_20201106165810.jpg
微信图片_20201106165806.jpg
微信图片_20201106165753.jpg

微信图片_20201106165757.jpg

微信图片_20201106165802.jpg

整体工艺不错,就是功能较少

逆向了一个k210板

1595757186391.jpeg

1595757190304.jpeg

1595757204755.jpeg