当前位置:网站首页>Arduino get random number
Arduino get random number
2022-07-06 12:04:00 【A geek is as deep as the sea】
Use randomSeed() Function to read an unused pin ,
randomSeed(analogRead(A0)); // Use an unused pin
Use random() Function to generate a random number , return long type
random() Functions can be used in two ways
random(max); // Return number type will not Exceed the filled data
random(min,max); // Generate a range of random numbers
Examples of use
void setup() {
Serial.begin(9600);
randomSeed(analogRead(A0)); // Use an unused pin
Serial.println(random(100));
Serial.println(random(100,300));
}
void loop(){
}
边栏推荐
- 小天才电话手表 Z3工作原理
- GNN的第一个简单案例:Cora分类
- Missing value filling in data analysis (focus on multiple interpolation method, miseforest)
- Detailed explanation of Union [C language]
- arduino获取随机数
- E-commerce data analysis -- User Behavior Analysis
- RT-Thread 线程的时间片轮询调度
- 5G工作原理详解(解释&图解)
- Internet protocol details
- Funny cartoon: Programmer's logic
猜你喜欢
随机推荐
Bubble sort [C language]
程序员老鸟都会搞错的问题 C语言基础 指针和数组
关键字 inline (内联函数)用法解析【C语言】
Missing value filling in data analysis (focus on multiple interpolation method, miseforest)
C language callback function [C language]
sklearn之feature_extraction.text.CountVectorizer / TfidVectorizer
Pytorch-温度预测
arduino获取数组的长度
gcc 编译选项
Word typesetting (subtotal)
Kaggle competition two Sigma connect: rental listing inquiries (xgboost)
AMBA、AHB、APB、AXI的理解
Funny cartoon: Programmer's logic
电商数据分析--薪资预测(线性回归)
Reno7 60W super flash charging architecture
C语言回调函数【C语言】
Comparaison des solutions pour la plate - forme mobile Qualcomm & MTK & Kirin USB 3.0
E-commerce data analysis -- User Behavior Analysis
There are three iPhone se 2022 models in the Eurasian Economic Commission database
Implementation scheme of distributed transaction








![[template] KMP string matching](/img/f9/cd8b6f8e2b0335c2ec0a76fc500c9b.jpg)
