Closed supperthomas closed 2 years ago
今天刚收到板子。还是不错的。可玩性挺高的。
中文字库https://www.cnblogs.com/deng1821333144/p/15307883.html
在等直播
找下公头母头hy2.0
Wio Terminal 是基于SAMD51的微控制器,具有 Realtek RTL8720DN 支持的无线连接,与Arduino和MicroPython兼容。它的运行速度为 120MHz (最高可达200MHz), 4MB 外部闪存和 192KB RAM。它同时支持蓝牙和Wi-Fi,为物联网项目提供了骨架。Wio Terminal自身配有 a 2.4” LCD屏幕, 板载IMU(LIS3DHTR),麦克风,蜂鸣器,microSD卡槽,光传感器和红外发射器(IR 940nm)。 最重要的是它还有两个用于Grove生态系统 的多功能Grove端口和40个Raspberry pi兼容的GPIO引脚,用于支持更多附加组件。
人体红外传感器HC-SR501: https://www.cnblogs.com/zhongllmm/p/14105513.html
HC-SR04 超声波测距仪: https://create.arduino.cc/projecthub/Isaac100/getting-started-with-the-hc-sr04-ultrasonic-sensor-036380?ref=search&ref_id=HC-SR04&offset=2
https://randomnerdtutorials.com/complete-guide-for-ultrasonic-sensor-hc-sr04/
int trigPin = 9; // Trigger
int echoPin = 10; // Echo
long duration, cm, inches;
void setup() {
//Serial Port begin
Serial.begin (115200);
//Define inputs and outputs
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
}
void loop() {
// The sensor is triggered by a HIGH pulse of 10 or more microseconds.
// Give a short LOW pulse beforehand to ensure a clean HIGH pulse:
digitalWrite(trigPin, LOW);
delayMicroseconds(5);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
// Read the signal from the sensor: a HIGH pulse whose
// duration is the time (in microseconds) from the sending
// of the ping to the reception of its echo off of an object.
pinMode(echoPin, INPUT);
duration = pulseIn(echoPin, HIGH);
// Convert the time into a distance
cm = (duration/2) / 29.1; // Divide by 29.1 or multiply by 0.0343
inches = (duration/2) / 74; // Divide by 74 or multiply by 0.0135
Serial.print(inches);
Serial.print("in, ");
Serial.print(cm);
Serial.print("cm");
Serial.println();
delay(250);
}
dht11 温湿度传感器: https://github.com/adidax/dht11#readme
#include <dht11.h>
#define DHT11PIN A8
dht11 DHT11;
void setup()
{
Serial.begin(115200);
}
void loop()
{
Serial.println();
int chk = DHT11.read(DHT11PIN);
Serial.print("Humidity (%): ");
Serial.println((float)DHT11.humidity, 2);
Serial.print("Temperature (C): ");
Serial.println((float)DHT11.temperature, 2);
delay(2000);
}
光敏电阻模块: arduino 教程*** http://v.xue.taobao.com/learn.htm?courseId=78224
int val = 0;
int value = 0;
#define LIGHT_SENSOR_PIN A8
void setup(){
Serial.begin(115200);
}
void loop(){
val = analogRead(LIGHT_SENSOR_PIN);
value = map(val,0,1023,100,0);
Serial.print("LIGHT_SENSOR=");
Serial.print(value);
Serial.println("lux");
delay(1000);
}
combine
#include <dht11.h>
#define DHT11PIN A6
dht11 DHT11;
int trigPin = 5; // Trigger
int echoPin = 7; // Echo
long duration, cm, inches;
int val = 0;
int value = 0;
#define LIGHT_SENSOR_PIN A8
void setup() {
//Serial Port begin
Serial.begin (115200);
//Define inputs and outputs
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
}
void loop() {
int chk = DHT11.read(DHT11PIN);
Serial.print("Humidity (%): ");
Serial.println((float)DHT11.humidity, 2);
Serial.print("Temperature (C): ");
Serial.println((float)DHT11.temperature, 2);
// The sensor is triggered by a HIGH pulse of 10 or more microseconds.
// Give a short LOW pulse beforehand to ensure a clean HIGH pulse:
digitalWrite(trigPin, LOW);
delayMicroseconds(5);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
// Read the signal from the sensor: a HIGH pulse whose
// duration is the time (in microseconds) from the sending
// of the ping to the reception of its echo off of an object.
pinMode(echoPin, INPUT);
duration = pulseIn(echoPin, HIGH);
// Convert the time into a distance
cm = (duration/2) / 29.1; // Divide by 29.1 or multiply by 0.0343
inches = (duration/2) / 74; // Divide by 74 or multiply by 0.0135
Serial.print(inches);
Serial.print("in, ");
Serial.print(cm);
Serial.print("cm");
Serial.println();
val = analogRead(LIGHT_SENSOR_PIN);
value = map(val,0,1023,100,0);
Serial.print("LIGHT_SENSOR=");
Serial.print(value);
Serial.println(" lux");
delay(2500);
}
活动参与者可从以下任务中任选其一完成:
任务一: 利用扩展接口,自由选择连接三到五个传感器,将采集的数据显示在LCD屏幕上,并解释数据的含义。
任务二: 制作一个自动联网的天气预报仪,在设计界面显示温湿度、天气情况、空气质量以及未来三天内的天气变化。
任务三: 使用麦克风采集使用者说话口型并识别,同时在屏幕上画出对应的表情。
arduino 可执行文件地址: C:\Users\thomas\AppData\Local\Temp
https://www.eetree.cn/project/detail/601