In a program for Arduino, I have an array of strings but it seems that the function where I am going to use this data only accepts string. How do I convert an array to a string?
File prog = SD.open("prog.bin");
String leiaS(void){
return String(prog.read());
}
digitalWrite(leia(), inverte(leiaS()));
String inverte(String port){
if(digitalRead(port)==HIGH)
return LOW;
else
return HIGH;
}
Error:
could not convert 'leiaS' from 'String (*) ()' to 'String'
I noticed that there was a missing parenthesis in the call of the leiaS
function. After correcting and verifying the error appeared:
Can not convert 'String' to 'uint8_t {aka unsigned char}' for argument '2' to 'void digitalWrite (uint8_t, uint8_t)'