meta data for this page
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
arduino:code_collection [2025/03/22 21:39] – [Float to char()] vamsan | arduino:code_collection [2025/03/22 22:54] (current) – [Float to char[]] vamsan | ||
---|---|---|---|
Line 29: | Line 29: | ||
</ | </ | ||
===== Converting code collection ===== | ===== Converting code collection ===== | ||
- | ==== Float to char() ==== | + | ==== Float to char[] ==== |
<code c> | <code c> | ||
// lib init (optional) | // lib init (optional) | ||
Line 37: | Line 37: | ||
char sendValue[10]; | char sendValue[10]; | ||
dtostrf (a, 10, 8, sendValue); // float_value, | dtostrf (a, 10, 8, sendValue); // float_value, | ||
+ | |||
+ | </ | ||
+ | |||
+ | ==== Int to char[] ==== | ||
+ | <code c> | ||
+ | int a; | ||
+ | char sendValue[10]; | ||
+ | itoa (i, | ||
+ | // base: Numerical base used to represent the value as a string, between 2 and 36, where 10 means decimal base, 16 hexadecimal, | ||
+ | |||
+ | </ | ||
+ | ==== String to char[] ==== | ||
+ | <code c> | ||
+ | |||
+ | char place[20]; | ||
+ | strcpy(place," | ||
</ | </ |