Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/arduino/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Arduino Client.print插入变量_Arduino - Fatal编程技术网

Arduino Client.print插入变量

Arduino Client.print插入变量,arduino,Arduino,我试图在客户端中插入一个变量。在我的arduino脚本上打印,但无法使脚本工作,我猜我的变量声明为double,试图将其更改为char,但我的输出为voltage,我需要小数点,有什么建议吗 double variable; client.println("<head> <meta http-equiv='refresh' content='1; url=http://localhost/add.php?param="+ variable +" /></head

我试图在客户端中插入一个变量。在我的arduino脚本上打印,但无法使脚本工作,我猜我的变量声明为double,试图将其更改为char,但我的输出为voltage,我需要小数点,有什么建议吗

double variable;

 client.println("<head> <meta http-equiv='refresh' content='1; url=http://localhost/add.php?param="+ variable +" /></head>");
双变量;

client.println(“与Arduino字符串对象一起使用,其简单程度如下:

client.println("<head><meta http-equiv='refresh' content='1; url=http://localhost/add.php?param="+ String(variable) +" /></head>");
client.println(“
client.println("<head><meta http-equiv='refresh' content='1; url=http://localhost/add.php?param="+ String(variable) +" /></head>");