Q regarding to the code

Hi all,

I found code regarding to alarm

what does this line mean in Arduino code

uint8_t sett[] = {77, 97, 100, 101, 32, 66, 121, 78, 97, 110, 100, 105, 107, 97, 32, 64, 53, 115, 113, 117, 105, 100};

what is unit8 ?
what are those number mean?

Thank you

uint8_t sett[] = {77, 97, 100, 101, 32, 66, 121, 78, 97, 110, 100, 105, 107, 97, 32, 64, 53, 115, 113, 117, 105, 100};

uint8_t is a type definition of an Unsigned 8-bit Integer

This line of code creates an ARRAY of unsigned 8-bit integers named sett[]. The array has 22 elements defines by those comma separated numbers.

You can access these numbers like this:

uint8 dat;

dat = sett[0];   // this wold make dat = 77
dat = sett[2];   // this wold make dat = 100

uint8_t is the same thing as what you've been probably calling byte in the Arduino code. byte isn't a standard type, it's defined in Arduino core to be either uint8_t or unsigned char I can't remember. Either way, uint8_t is equivalent to byte as long as you're on an Arduino.

Hi,

Thanks for your explanation but why they choose this number in this array?

I means 77, 97, 100, 101, 32, 66, 121, 78, 97, 110, 100, 105, 107, 97, 32, 64, 53, 115, 113, 117, 105, 100

??

Thanks

why they choose this number in this array?

What is the array used for ? Please post the whole program. Where did you get it from ?

for setting alarm clock

Looks like just plain text;

77  M
97  a
100 d
101 e
32  <space>
66  B
121 y

You can check the rest at e.g asciitable.com

Thank you very much (f)

Please next time somebody asks for code, post it as the meaning might very well be related to the context how it is used; I've showed you what the numbers mean but nobody can tell you what is does if you don't provide the context; it could be part of a scrambling algorithm :wink:

The same if somebody asks where the code comes from, post a link.