Author Topic: SimbleeRNG  (Read 446 times)


  • RFduino Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
« on: April 18, 2017, 12:12:46 PM »

Hello everybody!

I am trying to have the Simblee generate a random number using SImbleeRNG. here is my code:
Code: [Select]
void Generate_Ticket_Number()
 uint8_t stream[8];
 uint8_t N_Ticket[12];
 SimbleeRNG::generate(stream, sizeof(stream));
for (int i=0; i<4; i++)
N_Ticket[3*i]   = stream[i]/100;
N_Ticket[3*i+1] = (stream[i]-100*N_Ticket[3*i])/10;
N_Ticket[3*i+2] = stream[i]-100*N_Ticket[3*i]-10*N_Ticket[3*i+1];
for (int i=0; i<13;i++)
for (int i=0;i<10;i++)
  Ticket[i]= char(N_Ticket[i]+0x30);

This works and I can generate a random number that will be used to print a Ticket. However, if I call this routine in an event related to the User Interface (hitting a button on my iPhone), Simblee looses communication and the software hangs up.
Does this mean that SimbleeRNG() cannot be used within the processing of an event?
Thank you for your attention


  • Global Moderator
  • *****
  • Posts: 880
  • Karma: +21/-0
    • View Profile
    • Thomas Olson Consulting
Re: SimbleeRNG
« Reply #1 on: April 18, 2017, 03:48:27 PM »
It would be better if you provide complete code ready to install. Then one can see what you have going on.

Are you using with Simblee For Mobile?