Questions tagged [uint16]
127 questions
-1
votes
2 answers
How can I convert a string to uint16_t in Arduino?
The string variable will contain a hexadecimal, which we need to safely place in the uint16_t?
Example:
String hexa = "0x11A0";
uint16_t num = ???;
Remember, I dont need to conversion to decimal here.
i.e. my requirement is, unint16_t num =…
-1
votes
1 answer
Convert uint16 to jint and back JNI
everyone. I am writing under Android using JNI.
I need to pass an "interval" into my C foo() as uint16, but after that i use the same "interval" in return to Java.
C:
static jint func (JNIEnv* env, jobject object,jstring first)
{
…

user3360601
- 327
- 3
- 17
-2
votes
1 answer
Convert char* data to uint16_t* or uint16_t array in C
My Arduino program receives a char* text message like this:
char* messageFromWebSocket = "4692\n4408\n656\n358\n662\n356\n658\n376\n656\n358\n662\n1394\n660\n1392\n636\n378\n632\n382\n638\n1418";
Now the IRremoteESP8266 library I used controls the…

misza
- 13
- 3
-2
votes
2 answers
How to parse uint16_t to int in C?
I got the data for uint16_t and it like 0x2c06.
For the 0x2c06 , 2c is the first data and the 06 is the second data.
How do I parse the 0x2c06 and turn the 2c and the 06 to int?
Thanks in advance.

Martin
- 2,813
- 11
- 43
- 66
-3
votes
2 answers
type conversion from int to class behaving weirdly
So. I am trying to convert a uint16_t (16 byte int) to class. To get the class member varaible. But it is not working as expected.
class test{
public:
uint8_t m_pcp : 3; // Defining max size as 3 bytes
bool m_dei : 1;
uint16_t m_vid :…

rashi
- 3
- 2
-3
votes
2 answers
C write uint16 to file got Error
My operation-system is window,I want to write my data to a pcm with 16bit.Here is my code:
typedef unsigned short uint16;
void write2PCM(char* file_path, int length, double* data) {
FILE* file=NULL;
file = fopen(file_path, "wb+");
for (int i = 0; i…

马慧超
- 183
- 1
- 10
-5
votes
1 answer
Fill uint16_t array with uint64_t data in C
I'm having a problem trying to save a data of uint64_t size into 4 uint16_t positions in array without using any loop...
Here is a part of my code:
static int send(uint16_t addr, const void *data)
{
uint16_t frame[7];
/* Here I want to save…

OriolBur
- 11
- 6