当前位置: 首页 > news >正文

如何自建公司网站app网站搭建

如何自建公司网站,app网站搭建, 上app下载,推广渠道满意答案dkmeng推荐于 2017.12.15采纳率#xff1a;55% 等级#xff1a;9已帮助#xff1a;567人项目需要的硬件如下#xff1a;Arduino UnoEthernet ShieldLED灯 2个.电阻 2个.面包板(可选)连接导线路由器一个项目要的连接管脚如下#xff1a;LED 1 -- pin 6 to g…满意答案dkmeng推荐于 2017.12.15采纳率55%    等级9已帮助567人项目需要的硬件如下Arduino UnoEthernet ShieldLED灯 2个.电阻 2个.面包板(可选)连接导线路由器一个项目要的连接管脚如下LED 1 -- pin 6 to groundLED 2 -- pin 7 to ground项目需要的软件如下Eclipse IDEArduino IDE 1.x.xLED 1 -- pin 6 to groundLED 2 -- pin 7 to ground项目需要的软件如下Eclipse IDEArduino IDE 1.x.xStep 1: 在 Arduino上编程如下#include etherShield.h#include ETHER_28J60.hint led2 7;int led1 6;static uint8_t mac[6] {0xAA, 0xBB, 0xCC, 0xDD, 0xBB, 0xAA}; // this just needs to be unique for your network,// so unless you have more than one of these boards// connected, you should be fine with this value.static uint8_t ip[4] {192, 168, 0, 15}; // the IP address for your board. Check your home hub// to find an IP address not in use and pick that// this or 10.0.0.15 are likely formats for an address// that will work.static uint16_t port 80; // Use port 80 - the standard for HTTPETHER_28J60 e;void setup(){e.setup(mac, ip, port);pinMode(led1, OUTPUT);pinMode(led2, OUTPUT);digitalWrite(led1, LOW);digitalWrite(led2, LOW);}void loop(){char* params;if (params e.serviceRequest()){if (strcmp(params, ?cmd1) 0){digitalWrite(led1, HIGH);}if (strcmp(params, ?cmd2) 0){digitalWrite(led1, LOW);}if (strcmp(params, ?cmd3) 0){digitalWrite(led2, HIGH);}if (strcmp(params, ?cmd4) 0){digitalWrite(led2, LOW);}e.respond();}}Step 2: 制作安卓APPpackage com.androidarduino;import org.apache.http.client.HttpClient;import org.apache.http.client.methods.HttpGet;import org.apache.http.impl.client.DefaultHttpClient;import android.app.Activity;import android.os.Bundle;import android.os.StrictMode;import android.view.Menu;import android.view.View;import android.view.View.OnClickListener;import android.widget.Toast;public class MainActivity extends Activity implements OnClickListener{Overrideprotected void onCreate(Bundle savedInstanceState) {StrictMode.ThreadPolicy policy new StrictMode.ThreadPolicy.Builder().permitAll().build();StrictMode.setThreadPolicy(policy);super.onCreate(savedInstanceState);setContentView(R.layout.main);View led1on findViewById(R.id.led_1on);View led1off findViewById(R.id.led_1off);View led2on findViewById(R.id.led_2on);View led2off findViewById(R.id.led_2off);led1on.setOnClickListener(this);led1off.setOnClickListener(this);led2on.setOnClickListener(this);led2off.setOnClickListener(this);}Overridepublic boolean onCreateOptionsMenu(Menu menu) {// Inflate the menu; this adds items to the action bar if it is present.getMenuInflater().inflate(R.menu.main, menu);return true;}public void commandArduino(String url){try {HttpClient httpclient new DefaultHttpClient();httpclient.execute(new HttpGet(url));} catch (Exception e) {}}public void onClick(View thisView) {switch(thisView.getId()){case R.id.led_1on:commandArduino(http://192.168.0.15/?cmd1);Toast.makeText(getApplicationContext(), led_1on,Toast.LENGTH_LONG).show();break;case R.id.led_1off:commandArduino(http://192.168.0.15/?cmd2);Toast.makeText(getApplicationContext(), led_1off,Toast.LENGTH_LONG).show();break;case R.id.led_2on:commandArduino(http://192.168.0.15/?cmd3);Toast.makeText(getApplicationContext(), led_2on,Toast.LENGTH_LONG).show();break;case R.id.led_2off:commandArduino(http://192.168.0.15/?cmd4);Toast.makeText(getApplicationContext(), led_2off,Toast.LENGTH_LONG).show();break;}}}01分享举报
http://www.sadfv.cn/news/35878/

相关文章:

  • 做网页网站 的公司小清新博客网站
  • 佛山市禅城网站建设公司网站改版准备
  • 云主机可以放几个网站网站备案值得吗
  • 建筑网站图片惠州网站建设翻译
  • 镇江网站建设咨询网站营运费
  • 免费发外链的网站青岛 网站制作公司
  • 海尔网站的建设特点企业网站建设有什么
  • 南山做网站公司在哪里网络营销策略主要包括
  • wordpress怎么修改登录界面网站优化试题
  • 个人网站用wordpress吗网店美工需要学什么软件
  • 滨海网站建设服务商wordpress 主体
  • 大型建站公司注册网络公司
  • 网站建设的认可国际知名设计公司有哪些
  • 成都私人做网站建设的公司建筑学网站推荐
  • 徐州网站制作方案查查企业信息查询平台
  • 自己做的网站网页错位国内重大新闻2023
  • 网站的ftp在哪里可以查到施工企业安全生产评价标准最新版2021
  • 河南城乡住房和建设厅网站优化方案物理电子版
  • ks刷粉网站推广马上刷小程序商城名字大全
  • ftp怎么设置网站首页教育直播网站建设
  • iis 网站乱码建立网站的目的是什么
  • 沈阳红方城网站建设广告公司属于什么行业
  • 兰州网站外包微信运营软件
  • 中国和住房城乡建设部网站首页torrentkitty磁力官网
  • 优质的网站建设推广北京网站优化济南兴田德润简介电话
  • 图片网站制作html5 微网站开发
  • 万网 网站建设国内网站没备案
  • 学校网站的目的高邮市建设局网站
  • 营销型网站建设测验题wordpress博客自媒体资讯主题
  • 做设计有哪些免费网站北京网站建设公司朝阳