led

VHDL clocked LED Sequence Part 2

余生颓废 提交于 2019-12-08 09:37:02
问题 I have to write a program that changes an LED sequence at each clock pulse for one sequence. library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; use ieee.numeric_std.all; entity REG_LED is PORT(CLK: IN std_logic; -- CLK input LEDS: Out std_logic_vector (4 downto 0):= "11111"); -- initialise output End REG_LED; ARCHITECTURE behavioral OF REG_LED IS SIGNAL Temp: std_logic_vector (3 downto 0):= "0000"; -- initailise comparison signal BEGIN CLK_Process: PROCESS (CLK) --

Permanently enable and disable blinking LED notification light in android programmatically

删除回忆录丶 提交于 2019-12-05 20:43:39
I have been looking for the ability to disable and enable the LED notification light through code. I saw this thread Disable/enable notification led , but it is quite old and I was wondering if the new API versions has some support for turning it off completely. I was wondering if the new API versions has some support for turning it off completely You cannot enable or disable the LED behavior through the Android SDK, except within your own app, where you control what any Notification does that you raise. You can only control the led if your app raies a notification when no other apps have

Controling Android's front led light

牧云@^-^@ 提交于 2019-12-05 14:45:01
I'm trying to implement a 1 second red blinking at the front led whenever the user presses a certain button. But I'm having trouble finding documentation, tutorials or even code-examples on how to access and work with the front led (by that I mean the led located adjacent to the "selfie" camera and the touch screen). I've seen examples to work with the flashlight and Camera class (deprecated) but I believe that's not what I'm looking for. There is no direct access to the front L.E.D. You can schedule Notifications with custom colours for the L.E.D. Notification.Builder builder = new

Arduino (processing) Library in Netbeans and control

血红的双手。 提交于 2019-12-04 09:47:15
I am trying to control 4 LEDs and getting analog input from 4 contacts. The program is written in java, so to gain acces to the functions of arduino, such as AnalogRead() and setting an LED to high or low, would importing the processing library let the program use those functions? I was also wondering, if the program, will be transferred to the arduino it self, or the java program will just pull the data from the pins? Update : My suggestion is to first try communicating the Arduino with Processing by youself. This is what I describe below. If you want to jump straight to controlling the

Android Notification LED doesn't use my Color

梦想的初衷 提交于 2019-12-03 07:54:21
I'm trying to use a Notification that also uses the Notification LED on my S3, but for some reason the color will always be blue (I guess it's the default?). I tried to use different colors but nothing changes. Other apps (like Whatsapp, Gmail and Facebook have no problems with showing a different color light). Notification.Builder noteBuilder = new Notification.Builder(context) .setAutoCancel(true) .setPriority(Notification.PRIORITY_DEFAULT) .setSmallIcon(R.drawable.ic_launcher) .setContentTitle(ContentTitle) .setContentText(ContentText) .setLights(Color.YELLOW, 500, 500) ; Intent noteIntent

按键点亮LED灯(中断)

匿名 (未验证) 提交于 2019-12-03 00:21:02
#include <sys.h> #include <EXTI.h> #include <led.h> int main(void) { NVIC_Configuration(); Led_init(); EXTI_KEY_init(); while(1) { } } void EXTI15_10_IRQHandler(void) { if(EXTI_GetFlagStatus(EXTI_Line10)==1) { LED=0; EXTI_ClearFlag(EXTI_Line10); } if(EXTI_GetFlagStatus(EXTI_Line11)==1) { LED=1; EXTI_ClearFlag(EXTI_Line11); } } #include <EXTI.h> void EXTI_KEY_init(void) { GPIO_InitTypeDef GPIO_InitStructure; EXTI_InitTypeDef EXTI_InitStructure; NVIC_InitTypeDef NVIC_InitStructure; //配置PB11、PB11为下降沿触发 //配置管脚时钟和复用时钟 RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB | RCC_APB2Periph_AFIO,ENABLE); /

Fading Arduino RGB LED from one color to the other?

北战南征 提交于 2019-12-02 21:13:23
I've currently managed to get my LED to cycle through eight colors that I've selected. Everything is working correctly, except that I want to go for a more natural feel, and would like to fade / transition from one color to the next, instead of having them just replace one another. Here's my code so far: int redPin = 11; int greenPin = 10; int bluePin = 9; void setup() { pinMode(redPin, OUTPUT); pinMode(greenPin, OUTPUT); pinMode(bluePin, OUTPUT); } void loop() { setColor(250, 105, 0); // Yellow delay(1000); setColor(250, 40, 0); // Orange delay(1000); setColor(255, 0, 0); // Red delay(1000);

实现米思齐按键控制LED

一曲冷凌霜 提交于 2019-12-02 09:05:03
实现米思齐按键控制LED 代码实现如下: #include <IRremote.h> IRrecv irrecv_10(10); decode_results results_10; long ir_value; volatile int led; volatile boolean ledstate; void setup(){ Serial.begin(9600); irrecv_10.enableIRIn(); led = 0; ledstate = 0; } void loop(){ if (irrecv_10.decode(&results_10)) { ir_value=results_10.value; String type="UNKNOWN"; String typelist[14]={"UNKNOWN", "NEC", "SONY", "RC5", "RC6", "DISH", "SHARP", "PANASONIC", "JVC", "SANYO", "MITSUBISHI", "SAMSUNG", "LG", "WHYNTER"}; if(results_10.decode_type>=1&&results_10.decode_type<=13){ type=typelist[results_10.decode_type]; } Serial.print(

Mixly按键控制LED灯

白昼怎懂夜的黑 提交于 2019-12-02 06:30:26
Mixly按键控制LED 灯。 Mixly模块如下所示: 代码: volatile byte LED ; volatile byte SW ; volatile boolean b1 ; volatile boolean b2 ; volatile byte click ; volatile boolean lastState ; volatile boolean toggle ; int mixly_digitalRead ( uint8_t pin ) { pinMode ( pin , INPUT ) ; return digitalRead ( pin ) ; } void setup ( ) { LED = 13 ; SW = 8 ; lastState = LOW ; toggle = LOW ; click = 0 ; pinMode ( LED , OUTPUT ) ; digitalWrite ( LED , LOW ) ; b1 = mixly_digitalRead ( SW ) ; b2 = mixly_digitalRead ( SW ) ; } void loop ( ) { lastState = mixly_digitalRead ( SW ) ; if ( b1 != lastState ) { delay ( 20 ) ; if ( b1 ==

Morse Code via iPhone LED

你。 提交于 2019-12-02 06:28:35
I have coded an App that can convert normal Text like : "Hello my Name is XY" into points and strokes ( ..-. ; --.- ; . ; - ; etc etc) Now I want to Convert these points and stroke into light flashes with the lenght of 0.3 sec for points an 0.6 seconds for strokes. also there is a pause with the length of a point after each point or stroke, a double pause after each Word, and a tripple pause/break after each sentences. The breaks are also implied into my code. The problem is now that the light strokes aren't different enough. Because the Idea behind it is to convert the Light flashes via an