当前位置:网站首页>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(){
}
边栏推荐
- Machine learning -- decision tree (sklearn)
- Basic use of pytest
- E-commerce data analysis -- salary prediction (linear regression)
- gcc 编译选项
- Mall project -- day09 -- order module
- 机器学习--决策树(sklearn)
- AMBA、AHB、APB、AXI的理解
- Contiki source code + principle + function + programming + transplantation + drive + network (turn)
- 关键字 inline (内联函数)用法解析【C语言】
- Distribute wxWidgets application
猜你喜欢
Feature of sklearn_ extraction. text. CountVectorizer / TfidVectorizer
【ESP32学习-2】esp32地址映射
高通&MTK&麒麟 手机平台USB3.0方案对比
MP3mini播放模块arduino<DFRobotDFPlayerMini.h>函数详解
Unit test - unittest framework
ESP8266使用arduino连接阿里云物联网
Kconfig Kbuild
MongoDB
JS object and event learning notes
Comparaison des solutions pour la plate - forme mobile Qualcomm & MTK & Kirin USB 3.0
随机推荐
Yarn installation and use
数据分析之缺失值填充(重点讲解多重插值法Miceforest)
Those commonly used tool classes and methods in hutool
Missing value filling in data analysis (focus on multiple interpolation method, miseforest)
高通&MTK&麒麟 手機平臺USB3.0方案對比
Redis interview questions
【ESP32学习-1】Arduino ESP32开发环境搭建
RT-Thread API参考手册
机器学习--线性回归(sklearn)
Come and walk into the JVM
[esp32 learning-1] construction of Arduino esp32 development environment
Feature of sklearn_ extraction. text. CountVectorizer / TfidVectorizer
Arm pc=pc+8 is the most understandable explanation
物联网系统框架学习
arduino获取随机数
uCOS-III 的特点、任务状态、启动
Implementation scheme of distributed transaction
Kaggle竞赛-Two Sigma Connect: Rental Listing Inquiries
XML文件详解:XML是什么、XML配置文件、XML数据文件、XML文件解析教程
B tree and b+ tree of MySQL index implementation