Hey!
I'm trying to print this function by using RPi pico 2040 ,
void setup() {
//Initialize serial and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
Serial.println("0");
Serial.println("1");
delay(1000);
Serial.println("2");
int value=256;
Serial.println("from sketch value %d size %d\n",value,value*sizeof(double));
}
But I have this error! how can solve it?!
C:\Users\hp\Desktop\double\double.ino: In function 'void setup()':
double:45:94: error: no matching function for call to 'arduino::UART::println(const char [45], int&, unsigned int)'
Serial.println("from sketch value %d size %d\n",value,valuesizeof(double));
^
In file included from C:\Users\hp\AppData\Local\Arduino15\packages\arduino\hardware\mbed_rp2040\2.6.1\cores\arduino/api/ArduinoAPI.h:31:0,
from C:\Users\hp\AppData\Local\Arduino15\packages\arduino\hardware\mbed_rp2040\2.6.1\cores\arduino/Arduino.h:27,
from sketch\double.ino.cpp:1:
C:\Users\hp\AppData\Local\Arduino15\packages\arduino\hardware\mbed_rp2040\2.6.1\cores\arduino/api/Print.h:77:12: note: candidate: size_t arduino::Print::println(const arduino::__FlashStringHelper)
size_t println(const __FlashStringHelper *);
^~~~~~~
yes that's right!!
when I use printf ("from sketch value %d size %d\n",value,value*sizeof(double));
I get on just 0, 1, 2
and printf doesn't printed .
Why do I have this problem with the Rpi pico ,
Where this method works well with ESP32 ?!
Is there a method that I can use is similar to printf ?
I mean, I wanted to use one line and like this " "from sketch value %d size %d\n",value,value*sizeof(double)"
serail.println( "some words " + String(somevariable) + " some more words " + String(someothervariable) + "some more words " ) and get it all on one line.
Serial.println(" before function");
int value=256;
size_t out;
float *ar=(float*)malloc(value*sizeof(float));
unsigned char bytes = function_trt(arr, out );
Serial.println("after function");
The output was only
"before function"
After upload the code , the output in serial monitor is just print
"before function " after that the COM be offline and then re printing
"before function " .... and so on...