led

Arduino State Machine

扶醉桌前 提交于 2019-12-13 05:28:14
问题 This is a cross-post from someone who answered my original question here. I'm not sure how to go about executing the 3 functions I'm after (as well as introducing even more than 3 in the future). I am simply trying to Fade/Blink the selected Colour of an RGB LED (and perhaps introduce more functions in the future) where its RGB data is coming back from iOS and sent to an RFDuino BLE module. Sends a "fade" string to the module picked up by RFduinoBLE_onReceive (char *data, int len) on the

Notification Channel - Is It Possible to Change LightColor After It's Been Set?

对着背影说爱祢 提交于 2019-12-13 00:29:49
问题 I'm trying to change setLightColor with a colour returned from a JavaScript Interface. Unfortunately, NotificationCompat.Builder(context, CHANNEL_ID).setLights has absolutely no sway on API >= 26, so I can't use Intent.putExtra or anything similar. Is it even possible to change it after it's already been set? I would like it to be dynamic. EDIT There seems to be some misconception on what I want. I don't want to touch the Broadcast Reciever . It works just fine. I want to change the

PIC16F883 Led Blink

本秂侑毒 提交于 2019-12-12 16:07:27
问题 I need to program a PIC16F883 to blink / light up LED's at the same time. The oscillator is running at 3,2768, and I'm using TIMER0 to help me with the timing. Right now, I have a prescaler set to 1:256, so I get an interrupt every 50ms, and I have a variable that is calculated from that, to display how many seconds has gone. If the input is changed, the seconds variable is of course reset again. Here is the assignment from my teacher: If Input is 0 (Closed): The Red And The Green LED should

How do you control the Apple MacBook “Sleep” light?

霸气de小男生 提交于 2019-12-12 12:32:24
问题 I would like to control the "sleep" light on a MacBook or iMac. That is, I want to be able to make it turn on, turn off, and pulsate. I am happy to do this in usermode or in kernel mode. I assume I'll need root. Any ideas? 回答1: You don't, at least not in any way that will not involve possibly bricking your machine. The sleep light is controlled (on intel macs) by the SMC, and you can't even get to it through Open Firmware. There is hope, after a fashion, as Apple has actually released

How can Arduino detect the state of an LED?

不打扰是莪最后的温柔 提交于 2019-12-12 10:05:25
问题 I'm working on a blinking/fading lights program for Arduino. I'm trying to build in some interactivity that's based on LED state and certain switch combinations. Consider: When a button is pressed, if an LED is ON I want to turn it off and if an LED is OFF I want to turn it on. However, I've not been able to find any information about determining LED state. The closest was this question about Android, but I'm trying to find out if I can do this from the Arduino platform. Does anyone have any

LED & Camera always ON

主宰稳场 提交于 2019-12-12 00:01:57
问题 I'm trying to open the device camera an activate immediately the LED light of that device (android/iOS). I've tried the appcelerator ti.media events but didn't work, neither this module: Ti.Light. Found this on this link activate-iphone-4-led-light Hey guys! For the flash stuff you have to check the property: Ti.Media.cameraFlashMode (case sensitive) To change it you can use Ti.Media.setCameraFlashMode(PARAM) . PARAM could be: Ti.Media.CAMERA_FLASH_OFF , Ti.Media.CAMERA_FLASH_ON, Ti.Media

VHDL - connect switch and LED

限于喜欢 提交于 2019-12-11 15:47:38
问题 I have the Xilinx Spartan6 and next VHDL code: library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity Switches_Leds is Port (switch_0: in STD_LOGIC; LED_0 : out STD_LOGIC); end Switches_Leds; architecture Behavioral of Switches_Leds is begin LED_0 <= switch_0; end; Here is my User constraint file: NET "switch_0" LOC = C3; NET "LED_0" LOC = P4; My question is: Why the led is always is turned on, but it goes off if I click on button ? I explain: I program my fpga - the led

Run Kivy app as root user with touch screen on raspberry pi

陌路散爱 提交于 2019-12-11 04:29:19
问题 I want to make a kivy app for the raspberry pi that can use a touch screen. I was able to get the demos to work with the touchscreen with just "python ~/kivy/examples/demo/showcase/main.py". The issue comes when I need to start the app with "sudo python main.py", the touchscreen then ceases to work. The app I am trying to write uses the rpi_ws281x library for controlling addressable leds which HAS to be run as root. Is there a way to run the kivy app as root while still enabling the

Detect if hard disk is being accessed or not

冷暖自知 提交于 2019-12-10 23:30:19
问题 I am trying to make a very simple hard disk access monitor to work like those embedded LEDs that blink according to drive usage . That LED REALLY helps me, but the laptop I am using does not have it. =[ So, I've made a simple tray icon application, but I don't know how to determine that variable of disk access. I've searched for it and found something like System.Diagnostics.PerformanceCounter , but I have no idea on using it for my task. If there is another solution, I'd also appreciate! =]

When trying turn off camera led, app crash

二次信任 提交于 2019-12-10 19:52:27
问题 i have a code @TargetApi(23) private void setTorchMode( CameraManager cameraManager, String id, boolean switchOn) throws CameraAccessException { try { final Method setTorchMode = cameraManager.getClass().getMethod("setTorchMode", String.class, boolean.class); cameraManager.setTorchMode(cameraManager.getCameraIdList()[0],switchOn); callbackContext.success(); } catch (IllegalArgumentException m){ } catch (Throwable t) { callbackContext.error(t.getMessage()); } when i try turn off camera led, i