LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-30-2015, 08:44 AM   #1
dansnyderECE2010
LQ Newbie
 
Registered: Oct 2015
Posts: 4

Rep: Reputation: Disabled
Linux LED Triggers


I want to be able to register two triggers to one LED in the Linux LED subsystem. In specific, this is to blink an led any time a message is transmitted on either of two interfaces. We can call them CAN0 and CAN1. I'm fine with generating a new trigger that happens to reference both interfaces. I can work those details out. But I'm having issues figuring out where exactly the trigger list comes from. What I'm talking about it the contents of /sys/class/leds/Blue/trigger as an example. To set one of these triggers you simply "echo can0-tx > trigger". Any idea where triggers are defined/registered?
 
Old 10-31-2015, 04:56 AM   #2
jamison20000e
Senior Member
 
Registered: Nov 2005
Location: ...uncanny valley... infinity\1975; (randomly born:) Milwaukee, WI, US( + travel,) Earth&Mars (I wish,) END BORDER$!◣◢┌∩┐ Fe26-E,e...
Distribution: any GPL that work on freest-HW; has been KDE, CLI, Novena-SBC but open.. http://goo.gl/NqgqJx &c ;-)
Posts: 4,888
Blog Entries: 2

Rep: Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567
Hi.

Here's a script I through together some time back for my text based computer(IBM-T20) (and fun:)
Code:
#!/bin/sh -e

tty | grep "/dev/tty[0-9]" > /dev/null
if [ $? -eq 0 ]; then
setleds +scroll
sleep .1
setleds +caps
sleep .1
setleds +num
sleep .1
setleds -num
sleep .2
setleds -caps
sleep .2
setleds -scroll
sleep .2
setleds +num
sleep .3
setleds +caps
sleep .3
setleds +scroll
sleep .3
setleds -num
sleep .4
setleds -caps
sleep .4
setleds -scroll
sleep .4
setleds +caps
sleep .5
setleds +num +scroll
sleep .5
setleds -num
sleep .6
setleds -caps -scroll
sleep .6
setleds -scroll -caps -num
sleep .6
setleds +scroll +caps +num
sleep .5
setleds -scroll -caps -num
sleep .4
setleds +scroll +caps +num
sleep .3
setleds -scroll -caps -num
sleep .2
setleds +scroll +caps +num
sleep .1
setleds -scroll -caps -num
sleep .1
setleds +scroll +caps +num
sleep .1
setleds -scroll -caps -num
sleep .1
setleds +scroll +caps +num
sleep .1
setleds -scroll -caps -num
fi
don't remember where I cut and pasted parts from tho, hope it helps?

Last edited by jamison20000e; 10-31-2015 at 05:00 AM.
 
  


Reply

Tags
led, trigger



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Raspberry pi red LED on solidly with flashing green led. darkstarbyte Linux - Hardware 19 01-05-2013 06:54 PM
Getting Error in Linux Kernel Module for LED On/Off pratikmota Linux - Kernel 2 03-29-2012 02:36 PM
Years of Casual Linux Experience has Led to Very Little Knowledge will.fletcher LinuxQuestions.org Member Intro 1 07-06-2009 09:04 AM
Mouse triggers? carlosinfl Linux - Hardware 0 01-31-2005 02:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration