当前位置:网站首页>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(){
}
边栏推荐
- 物联网系统框架学习
- Détails du Protocole Internet
- Programmers can make mistakes. Basic pointers and arrays of C language
- arduino获取数组的长度
- Encodermappreduce notes
- Amba, ahb, APB, Axi Understanding
- Understanding of AMBA, AHB, APB and Axi
- Pytoch implements simple linear regression demo
- STM32 如何定位导致发生 hard fault 的代码段
- FTP file upload file implementation, regularly scan folders to upload files in the specified format to the server, C language to realize FTP file upload details and code case implementation
猜你喜欢

Linux Yum install MySQL

2019 Tencent summer intern formal written examination

uCOS-III 的特点、任务状态、启动

E-commerce data analysis -- salary prediction (linear regression)

Time slice polling scheduling of RT thread threads

RT-Thread 线程的时间片轮询调度

Redis面试题

ESP learning problem record

機器學習--線性回歸(sklearn)

Pytorch four commonly used optimizer tests
随机推荐
高通&MTK&麒麟 手機平臺USB3.0方案對比
锂电池基础知识
Common regular expression collation
FTP file upload file implementation, regularly scan folders to upload files in the specified format to the server, C language to realize FTP file upload details and code case implementation
map文件粗略分析
Mysql database interview questions
There are three iPhone se 2022 models in the Eurasian Economic Commission database
Embedded startup process
GNN的第一个简单案例:Cora分类
Stage 4 MySQL database
分布式事务的实现方案
荣耀Magic 3Pro 充电架构分析
Gallery之图片浏览、组件学习
Togglebutton realizes the effect of switching lights
PyTorch四种常用优化器测试
【ESP32学习-1】Arduino ESP32开发环境搭建
ES6语法总结--下篇(进阶篇 ES6~ES11)
优先级反转与死锁
Redis面试题
IOT system framework learning