#include void setup() { Serial.begin(9600); char* strNumber = "1234"; int number = atoi(strNumber); // Converts string to integer Serial.print("Converted number: "); Serial.println(number); } void loop() { // Your code here } Use code with caution. Common stdlib.h Functions for Arduino
The files are typically located deep within the IDE folder, for example: .../Arduino/hardware/tools/avr/avr/include/stdlib.h .
char buffer[10]; dtostrf(3.14159, 6, 2, buffer); // Converts 3.14159 to " 3.14" Use code with caution. 3. random() / randomSeed()