当前位置:网站首页>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(){
}
边栏推荐
- Encodermappreduce notes
- Mall project -- day09 -- order module
- Composition des mots (sous - total)
- Cannot change version of project facet Dynamic Web Module to 2.3.
- Correspondence between STM32 model and contex M
- Vert. x: A simple TCP client and server demo
- Reno7 60W super flash charging architecture
- STM32型号与Contex m对应关系
- TypeScript
- OPPO VOOC快充电路和协议
猜你喜欢

机器学习--决策树(sklearn)

Stage 4 MySQL database

open-mmlab labelImg mmdetection

【ESP32学习-1】Arduino ESP32开发环境搭建

STM32型号与Contex m对应关系

Cannot change version of project facet Dynamic Web Module to 2.3.

机器学习--线性回归(sklearn)

STM32 how to locate the code segment that causes hard fault

Fashion-Gen: The Generative Fashion Dataset and Challenge 论文解读&数据集介绍

Feature of sklearn_ extraction. text. CountVectorizer / TfidVectorizer
随机推荐
Kaggle竞赛-Two Sigma Connect: Rental Listing Inquiries
Fashion-Gen: The Generative Fashion Dataset and Challenge 论文解读&数据集介绍
E-commerce data analysis -- User Behavior Analysis
XML file explanation: what is XML, XML configuration file, XML data file, XML file parsing tutorial
PyTorch四种常用优化器测试
Pytorch实现简单线性回归Demo
arduino获取数组的长度
A possible cause and solution of "stuck" main thread of RT thread
There are three iPhone se 2022 models in the Eurasian Economic Commission database
I2C总线时序详解
map文件粗略分析
RuntimeError: cuDNN error: CUDNN_STATUS_NOT_INITIALIZED
Variable parameter principle of C language function: VA_ start、va_ Arg and VA_ end
Understanding of AMBA, AHB, APB and Axi
列表的使用
Detailed explanation of express framework
Detailed explanation of nodejs
The first simple case of GNN: Cora classification
Nodejs connect mysql
几个关于指针的声明【C语言】