..

1. android中怎么实现流水灯

循环,每次循环执行一次a<<=1;意思就是把原来的0X01左移一位,原来是0000 0001左移之后变成0000 0010,这样每次循环被点亮的LED的位置都会移动一位就是

2. 求助如何在基于安卓通过wifi与Arino通信,实现对LED灯的控制。

项目需要的硬件如下:Arino Uno Ethernet Shield LED灯 2个. 电阻 2个. 面包板(可选) 连接导线 路由器一个项目要的连接管脚如下:LED 1 --> pin 6 to ground LED 2 --> pin 7 to ground项目需要的软件如下:Eclipse IDE Arino IDE 1.x.xLED 1 --> pin 6 to ground LED 2 --> pin 7 to ground项目需要的软件如下:Eclipse IDE Arino IDE 1.x.xStep 1: 在 Arino上编程如下:#include "etherShield.h"#include "ETHER_28J60.h"int 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, "?cmd=1") == 0) { digitalWrite(led1, HIGH); } if (strcmp(params, "?cmd=2") == 0) { digitalWrite(led1, LOW); } if (strcmp(params, "?cmd=3") == 0) { digitalWrite(led2, HIGH); } if (strcmp(params, "?cmd=4") == 0) { digitalWrite(led2, LOW); } e.respond(); }}Step 2: 制作安卓APPpackage com.androidarino;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 commandArino(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: commandArino("http://192.168.0.15/?cmd=1"); Toast.makeText(getApplicationContext(), "led_1on",Toast.LENGTH_LONG).show(); break; case R.id.led_1off: commandArino("http://192.168.0.15/?cmd=2"); Toast.makeText(getApplicationContext(), "led_1off",Toast.LENGTH_LONG).show(); break; case R.id.led_2on: commandArino("http://192.168.0.15/?cmd=3"); Toast.makeText(getApplicationContext(), "led_2on",Toast.LENGTH_LONG).show(); break; case R.id.led_2off: commandArino("http://192.168.0.15/?cmd=4"); Toast.makeText(getApplicationContext(), "led_2off",Toast.LENGTH_LONG).show(); break; }}}

3. java android 实现指示灯的交替闪烁逻辑

你想要看游戏的排行榜啊,那可以在手机中下载一个应用宝的啊,应用宝中的内游戏是很多的,每次在容应用宝中找好玩的游戏都是可以满足我的呢。并且应用宝中是有排行榜的,你可以根据自己的需要在这里找你想要找的游戏,玩一下最近比较流行的游戏都是可以的呢,应用宝中的游戏还是比较耐玩的。

4. 基于android程序wifi控制灯光需要什么设备,怎样的原理

做过类似项目。 目前市面有大体两种wifi模块,有一种是wifi转串口的,回还有wifi转usb的,前种价格较贵,但接答口比较简单,基本上所有的单片机都带串口。usb只有高端的单片机才带的哦。 可以考虑用串口模块,通过模块转换通信和串口没有区别。至于...

5. Android蓝牙串口调试程序问题:这个程序连接蓝牙模块后,蓝牙模块的上的灯变闪烁为一直亮,为什么

现在市面上常用的蓝牙模块就是连接以后指示灯由闪烁变为常亮,表示已连接。

6. android中怎么实现指示灯颜色

很多Android手机上都配有LED灯,比如HTC的手机在充电、新来短信等时候都会有响应的指示,其实很简单的这都是NotificationManager的一些参数而已,下面Android123给大家说下如何通过代码控制LED灯的闪烁,因为有些机型没有LED灯或颜色种类较少,发布时需要真机观察。 复制代码代码如下: final int ID_LED=19871103; NotificationManager nm=(NotificationManager)getSystemService(NOTIFICATION_SERVICE); Notification notification = new Notification(); notification.ledARGB = 0xFFFFFF; //这里是颜色,我们可以尝试改变,理论上0xFF0000是红色,0x00FF00是绿色 notification.ledOnMS = 100; notification.ledOffMS = 100; notification.flags = Notification.FLAG_SHOW_LIGHTS; nm.notify(ID_LED, notification); nm.cancel(ID_LED);

7. android中怎么调用led灯 csdn

android的LED灯是通过通知来调用的,只是通知类的一个参数,具体大体实现方法如下: final int ID_LED=19871103; NotificationManager nm=(NotificationManager)getSystemService(NOTIFICATION_SERVICE); Notification notification = new Notification(); notification.ledARGB = 0xFFFFFF; //这里是颜色,我们可以尝试改变,理论上0xFF0000是红色,0x00FF00是绿色 notification.ledOnMS = 100; notification.ledOffMS = 100; notification.flags = Notification.FLAG_SHOW_LIGHTS; nm.notify(ID_LED, notification); nm.cancel(ID_LED)。

8. 你好、我做一个毕业论文、是用安卓手机通过wifi 控制 电灯、 请问我可以用什么单片机和wifi 模块呢谢谢

做过类似项目。目前市面有大体两种wifi模块,有一种是wifi转串口的,还有wifi转usb的,前种价格较专贵,但接口比较简属单,基本上所有的单片机都带串口。usb只有高端的单片机才带的哦。可以考虑用串口模块,通过模块转换通信和串口没有区别。至于接收应答的协议你自己定好了。另外,你需要自己写一个手机端的安卓程序哦!

9. android呼吸灯/通知灯的颜色能自定义吗

这个一般不能把,这个是硬件指定好了的,一般不行个别除外