【问题标题】:Use Arduino GSM/GPRS shield to send data to from my web service to arduino and display it on Dot matrix Display使用 Arduino GSM/GPRS shield 将数据从我的网络服务发送到 arduino 并在点阵显示器上显示
【发布时间】:2013-05-20 03:49:50
【问题描述】:

我想问一下如何通过我使用 GPRS shield v2.0 和 Arduino Uno R3 创建的 Web 服务来控制点阵显示器 (DMD),,,

例子:我填写了一个域的信息(mydomain.com/set?string = hello word),会出现在DMD中

如果来自推特的数据也有可能吗?因此它可以从两个来源接收数据,分别来自 mydomain.com 和 twitter.com

我有:

  • 从seeedstudio.com买的GPRS shield v2.0
  • 使用 Arduino Uno R3
  • 我从 freetronics 购买的 DMD 16X32

【问题讨论】:

    标签: arduino gsm gprs dmd


    【解决方案1】:

    希望这可行:)

    #include <SoftwareSerial.h>
    SoftwareSerial gprsSerial(7, 8);
    
    void setup()
    {
      gprsSerial.begin(19200);
      Serial.begin(19200);
    
      Serial.println("Config SIM900...");
      delay(2000);
      Serial.println("Done!...");
      gprsSerial.flush();
      Serial.flush();
    
      // attach or detach from GPRS service 
      gprsSerial.println("AT+CGATT?");
      delay(100);
      toSerial();
    
    
      // bearer settings
      gprsSerial.println("AT+SAPBR=3,1,\"CONTYPE\",\"GPRS\"");
      delay(2000);
      toSerial();
    
      // bearer settings
      gprsSerial.println("AT+SAPBR=3,1,\"APN\",\"epc.tmobile.com\"");
      delay(2000);
      toSerial();
    
      // bearer settings
      gprsSerial.println("AT+SAPBR=1,1");
      delay(2000);
      toSerial();
    }
    
    
    void loop()
    {
       // initialize http service
       gprsSerial.println("AT+HTTPINIT");
       delay(2000); 
       toSerial();
    
       // set http param value
       gprsSerial.println("AT+HTTPPARA=\"URL\",\"http://YOUR.DOMAIN.COM/rest/receiveSensorData?sensorval1=blah&sensorval2=blah\"");
       delay(2000);
       toSerial();
    
       // set http action type 0 = GET, 1 = POST, 2 = HEAD
       gprsSerial.println("AT+HTTPACTION=0");
       delay(6000);
       toSerial();
    
       // read server response
       gprsSerial.println("AT+HTTPREAD"); 
       delay(1000);
       toSerial();
    
       gprsSerial.println("");
       gprsSerial.println("AT+HTTPTERM");
       toSerial();
       delay(300);
    
       gprsSerial.println("");
       delay(10000);
    }
    
    void toSerial()
    {
      while(gprsSerial.available()!=0)
      {
        Serial.write(gprsSerial.read());
      }
    

    }

    【讨论】:

    • 参考上面的代码,我怎么知道是否有通过互联网连接?我的意思是该代码的输出是什么???是像超级终端这样的串行软件吗???但是谢谢你对我的问题的回答,真的很有帮助:)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-06-26
    • 2017-12-29
    相关资源
    最近更新 更多