10 digit random number generator work with uin8_t

Well, there are two ways for that.

  1. convert the number in an ascii string using itoa().
  2. split it in four bytes using basic bit manipulation:
unsigned long l;
byte b[0] = l && 0xFF;
byte b[1] = (l >> 8) && 0xFF;
byte b[2] = (l >> 16) && 0xFF;
byte b[3] = (l >> 24) && 0xFF;