When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
15 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
Convert for what purpose?
Like if I wanted to print it to display on a screen in decimal
Or like if I wanted to use it as a condition in my code?
Like if the sensor measures ambient lighting and it gives me a lux value but it sends me one byte and I put that byte in a buffer, how would I do it so that a light turns on at a certain lux number
Is it converted automatically to a decimal or does it just auto cast wherever
You don't need to do such conversion in this case.
Things like printf already handle that for you.
Ah I see
But what if I wanted to use it in a condition
Like I store the byte in a uint8_t variable
Say a variable y
If I did:
if (y<50) {
}
Does it automatically get converted to decimal and then compared to 50? Or what’s happening
Just having a hard time understanding how it’s comparing a binary byte to a decimal number