hi there, i try to learn how to make dummy data in arduino uno, this is my code ive try:
</>
long randNumber;
void setup() {
Serial.begin(9600);
// if analog input pin 0 is unconnected, random analog
// noise will cause the call to randomSeed() to generate
// different seed numbers each time the sketch runs.
// randomSeed() will then shuffle the random function.
randomSeed(analogRead(0));
}
void loop() {
// print a random number from 0 to 299
randNumber = random(300);
Serial.println(randNumber);
// print a random number from 10 to 19
randNumber = random(10, 20);
Serial.println(randNumber);
if (randNumber>70){
Serial.println("Temperature is greater than 70");
}
else {
Serial.println("Temperature is less than or equal to 70");
}
delay(5000);
}
so, how to generate a lot of random data of various sensors?,,anyone have any other code for literacy?i try to make random data for voltage sensor,current sensor,motor pwm,torque.
Generate as many values as you want one after the other then display them. At worst repeat the code to generate the values as many times as needed but better, use a single function to do it
@ridhoazhar313, your topic has been moved to a more suitable location on the forum. Introductory tutorials is for tutorials, not questions; feel free to write a tutorial once you have mastered your issue
Please edit your post, select all code and click the </>button to apply code tags; next save your post
Thanks.