Questions tagged [convert]

Change data from one format to another.

Change data from one format to another.

58 questions
7
votes
2 answers

How to convert string to long?

There is String.toInt(), but no String.toLong() or the many other variations. Do I have to resort to atol(String.c_str()) or is there a better way to convert a String to a long?
Ana
  • 480
  • 2
  • 7
  • 13
1
vote
2 answers

Converting 16bit to float

I am trying to communicate with AT30TS75A-MA8M-T with below code, the problem is converting the 16 bit output to float so I can read temp: Base on data sheet I suppose to remove first 5 bit in order to read correctly but I am not converting it…
Shahreza
  • 165
  • 9
1
vote
0 answers

Converting string to byte array and byte array to string?

I am trying to create a string message and then encrypt it via AES but the example only accepts byte array as input. How can I convert fullmessage string to message byte array to encrypt it? Checked similar questions but couldn't resolve the…
heathcliff
  • 31
  • 2
0
votes
1 answer

Need function to convert bool array to int- why doesnt this work?

Hey I wrote this function to convert an bool array to int: (Math Lob included): bool b_array[5]; int convertToInt(start_index,stop_index){ int run=0; int result=0; for(int id=start_index;id<=stop_index;id++){ result+=b_array[id]…
Nic
  • 3
  • 1