Timeline for Optimised random alphanumeric string generator
Current License: CC BY-SA 4.0
7 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Nov 15, 2021 at 7:59 | vote | accept | krystof18 | ||
| Nov 15, 2021 at 2:18 | answer | added | Eugenio Pace | timeline score: 2 | |
| Nov 13, 2021 at 13:56 | comment | added | krystof18 | @chrisl even with that, the code never goes into that if | |
| Nov 13, 2021 at 13:26 | comment | added | Edgar Bonet |
if(randomValue > 26) should be if(randomValue >= 26). Other than the fixes suggested in these three comments, the sketch should work as advertised.
|
|
| Nov 13, 2021 at 5:57 | comment | added | Nick Gammon♦ | Is this right? You are reading in a 4-digit number, and then using that as the number of digits to put random characters into a 50-byte array? Why not read a 2-digit number? Or at least test if the number is > 49 or not. | |
| Nov 12, 2021 at 23:49 | comment | added | chrisl |
Why do you check for if(Serial.available() == 0)? If you want to read data from Serial you should check for if(Serial.available() > 0), which can be written shorter as if(Serial.available()). Please try that
|
|
| Nov 12, 2021 at 23:43 | history | asked | krystof18 | CC BY-SA 4.0 |