Re: random from a char array


then how limit generating output ?
the output gives number or letter
what 5 letters , numbers ouput? :)

i've seen 1 post here generate numbers , letters.
but display 1 letters or number.
how put limitation on output?


long entry;
int a[14] = {'1','2','3','4','5','6','7','8','9','0','a','b','c','d'};
void setup(){
  serial.begin(9600);
  srand(analogread(5));
  randomseed(analogread(0));

}
void loop() {
 
entry = a[rand()%14];
  serial.println(entry);
                           
  delay(300);
}


Arduino Forum > Using Arduino > Programming Questions > Re: random from a char array


arduino

Comments

Popular posts from this blog

Connecting Raspberry Pi 2 to P10(1R)-V706 LED Dot Matrix - Raspberry Pi Forums

TypeError: <unknown> is not a numpy array - Raspberry Pi Forums

datso and removing imagetitle - Joomla! Forum - community, help and support