×

将旋转拨号电话带入未来的开源项目

消耗积分:0 | 格式:zip | 大小:0.13 MB | 2022-11-02

分享资料个

描述

当我长大的时候,我们只有很多年的转盘电话,我爱它们,喜欢它们发出的声音,多年来一直想把它做成手机。

所以当一位好朋友(感谢 Ilanit)告诉我她为我买了一个时,我非常高兴。第一项任务是将其拆开并弄清楚表盘的工作原理。

我用于测试的代码是这个:

// include the library code:
#include 
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 10, 9, 8, 7);
#define INDIALPIN 3
#define PULSEPIN 2
boolean inDialPinLastState;
boolean pulsPinLastState;
byte counter = 0;
void setup() {
 Serial.begin(115200);
 Serial.println("System started");
 // set up the LCD's number of columns and rows:
 lcd.begin(16, 2);
 // set the fixed text
 lcd.setCursor(0, 0);
 pinMode(INDIALPIN, INPUT_PULLUP);
 pinMode(PULSEPIN, INPUT_PULLUP);
 inDialPinLastState = digitalRead(INDIALPIN);
 pulsPinLastState = digitalRead(PULSEPIN);
}
void loop() {
 boolean inDialPinState = digitalRead(INDIALPIN);
 boolean pulsPinState = digitalRead(PULSEPIN);
 if (inDialPinState != inDialPinLastState) {
   if (!inDialPinState) {
     Serial.println("Start of dial");
     counter = 0;
   } else {
     Serial.println("End of dial");
     Serial.print("Dialed Digit - ");
     Serial.println(counter);
     if (counter) {
       if (counter == 10)
         counter = 0;
       lcd.print(counter);
     }
   } //end if
   inDialPinLastState = inDialPinState;
 } //end if
 if (pulsPinLastState != pulsPinState) {
   if (!pulsPinLastState) {
     counter++;
   } // end if
   Serial.println("pulsPinState - " + String(pulsPinState));
   pulsPinLastState = pulsPinState;
 }
}

在这个阶段,我仍在研究 mega2560,主要原因是我已经有了来自“呼吁井字游戏”项目的完整工作代码,您可以在此处观看。

 

但因为我知道我也想上网,所以我搬到了 ESP32。

我还想使用 SIM800,因为它们的模块非常小。我必须为 SIM800 添加一个逻辑电平转换器和一个降压器。

在这段视频中,我介绍了这一举措以及它是如何完成的:

 

我真的很想获得某种 UI,但对添加屏幕的想法不太满意,主要是因为这意味着要以某种方式切割电话盒。

然后我想起了我过去使用过的酷文本到语音库。并继续在系统上对其进行测试。毫无疑问,我找到了正确的用户界面。

我用于语音测试的代码是这样的:

#include 
#include 
#include 
AudioOutputI2S *out = NULL;
void setup()
{
 out = new AudioOutputI2S();
 out->begin();
}
void loop()
{
 ESP8266SAM *sam = new ESP8266SAM;
 sam->Say(out, "welcome back!");
 delay(500);
 sam->Say(out, "I am an E S P thirty two.");
 delay(50);
 sam->Say(out, "that can talk!");
 delete sam;
 while(1);
}

这是 SAM 库的链接。

https://github.com/earlephilhower/ESP8266SAM

我必须处理的下一件大事是铃声。

我真的很想让原来的振铃器工作,我做到了,但这意味着使用至少一个 H 桥,将电源设置为至少 12V 并添加一些其他部件。

然后我(感谢 Ofer)转而使用我用于 UI 的扬声器。

找到了一个播放 mp3 的简单代码,并下载了一个旋转电话铃声的录音。

我还将所有零件都焊接在一个 PCB 上。

一旦我把它全部焊接好并开始工作,我就转身去处理里面的接线。

我用原始织机的电线(主要用于结尾)重新连接了一些零件。

我从 esp 板上添加了新的织机到表盘、按钮和声音。

焊接到所有电线的末端,并在背面重复使用电话旧连接条。

在确保一切正常后,我还在代码中添加了 Ofer 和我合作了几个月的 ESP WiFi 工具,这主要是为了我可以在上面有一个用于 OTA 的 AP 门户,这在手机运行时非常需要与封面。

激活它所需要做的就是在电话挂机时拨 9(数字)。

现在手机差不多完成了,我只需要更换电源线。

我打算拿原来的电缆并将末端调整为 USB 电缆。

希望你和我一样喜欢它。

我会发布更新。

 

** 更新 - 我用替换原来的电缆插座完成了 USB 电缆。

 

 

 


声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉

评论(0)
发评论

下载排行榜

全部0条评论

快来发表一下你的评论吧 !

'+ '

'+ '

'+ ''+ '
'+ ''+ ''+ '
'+ ''+ '' ); $.get('/article/vipdownload/aid/'+webid,function(data){ if(data.code ==5){ $(pop_this).attr('href',"/login/index.html"); return false } if(data.code == 2){ //跳转到VIP升级页面 window.location.href="//m.obk20.com/vip/index?aid=" + webid return false } //是会员 if (data.code > 0) { $('body').append(htmlSetNormalDownload); var getWidth=$("#poplayer").width(); $("#poplayer").css("margin-left","-"+getWidth/2+"px"); $('#tips').html(data.msg) $('.download_confirm').click(function(){ $('#dialog').remove(); }) } else { var down_url = $('#vipdownload').attr('data-url'); isBindAnalysisForm(pop_this, down_url, 1) } }); }); //是否开通VIP $.get('/article/vipdownload/aid/'+webid,function(data){ if(data.code == 2 || data.code ==5){ //跳转到VIP升级页面 $('#vipdownload>span').text("开通VIP 免费下载") return false }else{ // 待续费 if(data.code == 3) { vipExpiredInfo.ifVipExpired = true vipExpiredInfo.vipExpiredDate = data.data.endoftime } $('#vipdownload .icon-vip-tips').remove() $('#vipdownload>span').text("VIP免积分下载") } }); }).on("click",".download_cancel",function(){ $('#dialog').remove(); }) var setWeixinShare={};//定义默认的微信分享信息,页面如果要自定义分享,直接更改此变量即可 if(window.navigator.userAgent.toLowerCase().match(/MicroMessenger/i) == 'micromessenger'){ var d={ title:'将旋转拨号电话带入未来的开源项目',//标题 desc:$('[name=description]').attr("content"), //描述 imgUrl:'https://'+location.host+'/static/images/ele-logo.png',// 分享图标,默认是logo link:'',//链接 type:'',// 分享类型,music、video或link,不填默认为link dataUrl:'',//如果type是music或video,则要提供数据链接,默认为空 success:'', // 用户确认分享后执行的回调函数 cancel:''// 用户取消分享后执行的回调函数 } setWeixinShare=$.extend(d,setWeixinShare); $.ajax({ url:"//www.obk20.com/app/wechat/index.php?s=Home/ShareConfig/index", data:"share_url="+encodeURIComponent(location.href)+"&format=jsonp&domain=m", type:'get', dataType:'jsonp', success:function(res){ if(res.status!="successed"){ return false; } $.getScript('https://res.wx.qq.com/open/js/jweixin-1.0.0.js',function(result,status){ if(status!="success"){ return false; } var getWxCfg=res.data; wx.config({ //debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 appId:getWxCfg.appId, // 必填,公众号的唯一标识 timestamp:getWxCfg.timestamp, // 必填,生成签名的时间戳 nonceStr:getWxCfg.nonceStr, // 必填,生成签名的随机串 signature:getWxCfg.signature,// 必填,签名,见附录1 jsApiList:['onMenuShareTimeline','onMenuShareAppMessage','onMenuShareQQ','onMenuShareWeibo','onMenuShareQZone'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2 }); wx.ready(function(){ //获取“分享到朋友圈”按钮点击状态及自定义分享内容接口 wx.onMenuShareTimeline({ title: setWeixinShare.title, // 分享标题 link: setWeixinShare.link, // 分享链接 imgUrl: setWeixinShare.imgUrl, // 分享图标 success: function () { setWeixinShare.success; // 用户确认分享后执行的回调函数 }, cancel: function () { setWeixinShare.cancel; // 用户取消分享后执行的回调函数 } }); //获取“分享给朋友”按钮点击状态及自定义分享内容接口 wx.onMenuShareAppMessage({ title: setWeixinShare.title, // 分享标题 desc: setWeixinShare.desc, // 分享描述 link: setWeixinShare.link, // 分享链接 imgUrl: setWeixinShare.imgUrl, // 分享图标 type: setWeixinShare.type, // 分享类型,music、video或link,不填默认为link dataUrl: setWeixinShare.dataUrl, // 如果type是music或video,则要提供数据链接,默认为空 success: function () { setWeixinShare.success; // 用户确认分享后执行的回调函数 }, cancel: function () { setWeixinShare.cancel; // 用户取消分享后执行的回调函数 } }); //获取“分享到QQ”按钮点击状态及自定义分享内容接口 wx.onMenuShareQQ({ title: setWeixinShare.title, // 分享标题 desc: setWeixinShare.desc, // 分享描述 link: setWeixinShare.link, // 分享链接 imgUrl: setWeixinShare.imgUrl, // 分享图标 success: function () { setWeixinShare.success; // 用户确认分享后执行的回调函数 }, cancel: function () { setWeixinShare.cancel; // 用户取消分享后执行的回调函数 } }); //获取“分享到腾讯微博”按钮点击状态及自定义分享内容接口 wx.onMenuShareWeibo({ title: setWeixinShare.title, // 分享标题 desc: setWeixinShare.desc, // 分享描述 link: setWeixinShare.link, // 分享链接 imgUrl: setWeixinShare.imgUrl, // 分享图标 success: function () { setWeixinShare.success; // 用户确认分享后执行的回调函数 }, cancel: function () { setWeixinShare.cancel; // 用户取消分享后执行的回调函数 } }); //获取“分享到QQ空间”按钮点击状态及自定义分享内容接口 wx.onMenuShareQZone({ title: setWeixinShare.title, // 分享标题 desc: setWeixinShare.desc, // 分享描述 link: setWeixinShare.link, // 分享链接 imgUrl: setWeixinShare.imgUrl, // 分享图标 success: function () { setWeixinShare.success; // 用户确认分享后执行的回调函数 }, cancel: function () { setWeixinShare.cancel; // 用户取消分享后执行的回调函数 } }); }); }); } }); } function openX_ad(posterid, htmlid, width, height) { if ($(htmlid).length > 0) { var randomnumber = Math.random(); var now_url = encodeURIComponent(window.location.href); var ga = document.createElement('iframe'); ga.src = 'https://www1.elecfans.com/www/delivery/myafr.php?target=_blank&cb=' + randomnumber + '&zoneid=' + posterid+'&prefer='+now_url; ga.width = width; ga.height = height; ga.frameBorder = 0; ga.scrolling = 'no'; var s = $(htmlid).append(ga); } } openX_ad(828, '#berry-300', 300, 250);