Monday, 13 December 2021

string to byte

 String myString = "arduino this was very difficult problem i just solved that ";

 unsigned int len = myString.length() + 1;

 


void setup() {

 Serial.begin(9600);

 char buff[len];

 myString.getBytes(buff, len);

  for (int i = 0; i < len; i++)

{      

  Serial.println(buff[i]);

}

 

}


void loop() {


}


No comments:

Post a Comment

Storing the long number(16bits / 32bits) in external flash of arduino or STM32 .

 #include <Wire.h> #define flashaddress 0x50 int liters = 10058 , add1=10 , add2,time1=55; // value of liters save in flash byte data ...