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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/14.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发送到sql server_Arduino - Fatal编程技术网

不使用以太网屏蔽将数据从arduino发送到sql server

不使用以太网屏蔽将数据从arduino发送到sql server,arduino,Arduino,我已经试过了 <?php $servername = "127.0.0.1:3307"; //localhost $username = "root"; $password = ""; // Create connection $conn = new mysqli($servername, $username, $password); try {

我已经试过了

 <?php
        $servername = "127.0.0.1:3307"; //localhost
        $username = "root";
        $password = "";

            // Create connection
            $conn = new mysqli($servername, $username, $password);

                try {
                        $conn = new PDO("mysql:host=$servername;dbname=test", $username,$password);
                            // set the PDO error mode to exception

                            echo "Connected successfully"; 

                            $sql = "INSERT INTO test.senrdata (temp) VALUES (".$_GET["value"].")"; 
                            echo "query " . $sql ;  
                            $conn->exec($sql);

                            // Execute SQL statement
                    }
    ?>


我尝试了Arduino代码,该代码提供传感器数据并将这些数据存储在服务器上。

我找到了如下解决方案:

要求:

1.Visual studio

2.阿杜伊诺

3.Sql server

应采取的步骤:

1.通过USB电缆将arduino套件连接到电脑

2.更新PC上COM端口的驱动程序。(此PC->管理->设备管理器->端口(COM和LPT))

3.创建Windows控制台应用程序,该应用程序在Arduino正在侦听的同一COM端口上侦听,并将数据存储在数据库(SQL server)中

4.创建读取此数据并显示值的WEB应用程序