查看: 3752|回复: 5

[软件] Uno32控制手机(Siemens CX65)打电话

[复制链接]

该用户从未签到

发表于 2012-8-8 11:47:19 | 显示全部楼层 |阅读模式
分享到:
原帖由
i7
发自:dev.eefocus.com
------------------------------------------------------------------------------------------------------------------------------------------

一、UNO32和手机连接的照片如下:
将UNO32的串口1和手机的插座,用自制的数据线连接起来。
1.png
2、程序如下:
(通过UNO32的串口1向手机发"ATD1368XXXXXXX;"命令,进行拨号)

// set pin numbers:
const int ledPin =  43;      // the number of the LED pin

// Variables will change:
int ledState = LOW;             // ledState used to set the LED
long previousMillis = 0;        // will store last time LED was updated

// the follow variables is a long because the time, measured in miliseconds,
// will quickly become a bigger number than can be stored in an int.
long interval = 10*1000;           // interval at which to blink (milliseconds)

void setup() {
  // set the digital pin as output:
  pinMode(ledPin, OUTPUT);

  Serial1.begin(9600);  

}

void loop()
{
  // here is where you'd put code that needs to be running all the time.

  // check to see if it's time to blink the LED; that is, if the
  // difference between the current time and last time you blinked
  // the LED is bigger than the interval at which you want to
  // blink the LED.
  unsigned long currentMillis = millis();

  if(currentMillis - previousMillis > interval) {
    // save the last time you blinked the LED
    previousMillis = currentMillis;   

    // if the LED is off turn it on and vice-versa:
    if (ledState == LOW)
      {
        ledState = HIGH;
        Serial1.println("ATD1368XXXXXXX;");
      }  
    else
      {
        ledState = LOW;
        Serial1.println("ATH");
      }  

    // set the LED with the ledState of the variable:
    digitalWrite(ledPin, ledState);
  }

}

3、一点说明
(1)UNO32的输出是3.3V的,手机的输入也是3.3V的(超过这个电压,手机会关机),用UNO32和arduino相比,省去了电平转换的电路;
(2)使用串口1向手机发送命令,串口0用来升级程序或向电脑打印信息,方便调试程序;
(3)应用:可以在UNO32上接上若干传感器,比如温度、湿度、光线强度,达到预设的值后。自动拨打设定的号码,进行报警;此外也可以通过发短信的方式,传送更丰富的内容;
(4)手机数据线定义见此网址:http://pinouts.ru/CellularPhonesCables/siemens_dca-510_pinout.shtml

回复

使用道具 举报

  • TA的每日心情
    奋斗
    2018-8-29 20:40
  • 签到天数: 1341 天

    连续签到: 1 天

    [LV.10]以坛为家III

    发表于 2014-1-7 23:15:01 | 显示全部楼层
    多谢 学习啦!
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    奋斗
    2015-1-22 18:04
  • 签到天数: 189 天

    连续签到: 1 天

    [LV.7]常住居民III

    发表于 2014-1-14 13:36:23 | 显示全部楼层
    黄色的板子,好像之前看到的都是红色板子呢
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    开心
    2015-11-30 08:37
  • 签到天数: 220 天

    连续签到: 1 天

    [LV.7]常住居民III

    发表于 2014-1-14 13:42:46 | 显示全部楼层
    不是有卡的模块吗.
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    发表于 2014-6-25 08:57:47 | 显示全部楼层
    顶你一下,好贴要顶!
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    开心
    2023-1-28 16:20
  • 签到天数: 980 天

    连续签到: 1 天

    [LV.10]以坛为家III

    发表于 2016-3-2 09:03:37 | 显示全部楼层
    不错  真好
    回复 支持 反对

    使用道具 举报

    您需要登录后才可以回帖 注册/登录

    本版积分规则

    关闭

    站长推荐上一条 /2 下一条

    手机版|小黑屋|与非网

    GMT+8, 2024-4-20 07:20 , Processed in 0.168528 second(s), 26 queries , MemCache On.

    ICP经营许可证 苏B2-20140176  苏ICP备14012660号-2   苏州灵动帧格网络科技有限公司 版权所有.

    苏公网安备 32059002001037号

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.