seed randomizer

This commit is contained in:
jjshoots 2023-06-22 20:26:01 +01:00
parent 3e0d06b837
commit 8f5a093317
2 changed files with 4 additions and 3 deletions

View File

@ -17,4 +17,4 @@ void loop() {
for (int i = 0; i < num_spoofers; i++) {
spoofers[i].update();
}
}
}

View File

@ -23,7 +23,7 @@ Spoofer::Spoofer() {
// define location
// 52° 24' 24.4404" -1° 29' 36.564"W
lat_d =
lat_d =
utm_data.latitude_d =
utm_data.base_latitude = 52.0 + (24.0 / 60.0) + (24.4404 / 3600.0);
long_d =
@ -69,6 +69,7 @@ void Spoofer::update() {
}
String Spoofer::getID() {
srand(micros())
String characters = String("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz");
String ID = "";
for (int i = 0; i < 16; i++)
@ -76,4 +77,4 @@ String Spoofer::getID() {
ID.concat(characters[(rand() % characters.length())]);
}
return ID;
}
}