[beagleboard] PWM period

2014-04-21 Thread Dorian Levy
I want to use two servos with pins 8_13 and 8_19. How can I change the 
period? I tried editing the dts file and compiling with 
dtc -O dtb -o bone_pwm_P8_13-00A0.dtbo -b 0 -@ bone_pwm_P8_13-00A0.dts, but 
the period remains the same. Is there something else that need to be done? 
I not sure it actually compiles, because the command line returns instantly.

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
BeagleBoard group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[beagleboard] OpenCV CascadeClassifier

2014-03-27 Thread Dorian Levy
I ran trainCascade on my Linux virtual machine and got an xml file, but 
when I try to run it on the Beaglebone I get the following error.
Parsing Error : valid xml should start with ?xml?

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
BeagleBoard group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] GPIO Edge

2014-03-05 Thread Dorian Levy

I tried the gpio-keys driver. I was able to count the interrupts, but was 
not able to determine which pin. I tried the following code, but when I 
hooked up switches to two pins the first switch I triggered would give the 
correct code, but when I triggered the second switch it would give the code 
for the first switch 4-5 times before it began giving the correct code.

using namespace std;

volatile int fd1 = 0;
volatile int counter1 = 0;
volatile int code = 0;
//volatile int value;
FILE *ifp_gpio30_value;
struct input_event event;

void IRQHandler(int sig){
counter1 ++;

read(fd1, event, sizeof(struct input_event));
code = event.code;
counter1 ++;



}


int main(void){
struct sigaction saio;
fd1 = open(/dev/input/event1, O_RDWR|O_NONBLOCK);

saio.sa_handler = IRQHandler;
//saio.sa_mask = 0;
saio.sa_flags = 0;
saio.sa_restorer = NULL;
sigaction(SIGIO,saio,NULL);
fcntl(fd1, F_SETOWN, getpid());
fcntl(fd1, F_SETFL, FASYNC);
while(1){
cout  counter1;
cout  \t;
cout  code;
cout  \n;
}

}

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
BeagleBoard group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [beagleboard] Powering the BBB

2014-03-05 Thread Dorian Levy
Addicore 5V 1.5A Positive Voltage Regulator L7805CV


On Wed, Mar 5, 2014 at 10:52 AM, Gerald Coley ger...@beagleboard.orgwrote:

 That particular regulator can have different pinouts. I have been bitten
 before. So double check that based on the supplier.

 What voltage are you seeing on the output? I believe the best you can get
 out of that regulator without a big heatsink is  maybe 500mA which is
 borderline for the BBB. You are dropping 6.7V across the regulator.

 Gerald



 On Wed, Mar 5, 2014 at 8:57 AM, Dorian Levy dorianal...@gmail.com wrote:

 On Mar 4, 2014 7:42 PM, Gerald Coley ger...@beagleboard.org wrote:

 Can you share a schematic with me? I can't visualize what you are doing.

 Gerald



 On Tue, Mar 4, 2014 at 5:05 PM, Dorian Levy dorianal...@gmail.comwrote:

 I am building a robot that uses an 11.7V battery. I tried attaching  a
 5V regulator to the T5(+)/T8(-) (pins with the T6(SENSE) bridged to T5 and
 a 10K resistor between T8(TS) and ground. The board only stays on for about
 thirty seconds then shuts down. Is it because of the TS? What type of
 thermistor does it use? Or should I try to use the barrel jack since
 it's not directly connected to a battery?

 --
 For more options, visit http://beagleboard.org/discuss
 ---
 You received this message because you are subscribed to the Google
 Groups BeagleBoard group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to beagleboard+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


  --
 For more options, visit http://beagleboard.org/discuss
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups BeagleBoard group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/beagleboard/-Zb4VUlh5Mg/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 beagleboard+unsubscr...@googlegroups.com.

 For more options, visit https://groups.google.com/groups/opt_out.

  --
 For more options, visit http://beagleboard.org/discuss
 ---
 You received this message because you are subscribed to the Google Groups
 BeagleBoard group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to beagleboard+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


  --
 For more options, visit http://beagleboard.org/discuss
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups BeagleBoard group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/beagleboard/-Zb4VUlh5Mg/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 beagleboard+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
BeagleBoard group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [beagleboard] Powering the BBB

2014-03-05 Thread Dorian Levy
No heatsink 5V
On Mar 5, 2014 11:13 AM, Gerald Coley ger...@beagleboard.org wrote:

 Are you using a heatsink? Voltage?

 Gerald



 On Wed, Mar 5, 2014 at 10:07 AM, Dorian Levy dorianal...@gmail.comwrote:

 Addicore 5V 1.5A Positive Voltage Regulator L7805CV


 On Wed, Mar 5, 2014 at 10:52 AM, Gerald Coley ger...@beagleboard.orgwrote:

 That particular regulator can have different pinouts. I have been bitten
 before. So double check that based on the supplier.

 What voltage are you seeing on the output? I believe the best you can
 get out of that regulator without a big heatsink is  maybe 500mA which is
 borderline for the BBB. You are dropping 6.7V across the regulator.

 Gerald



 On Wed, Mar 5, 2014 at 8:57 AM, Dorian Levy dorianal...@gmail.comwrote:

 On Mar 4, 2014 7:42 PM, Gerald Coley ger...@beagleboard.org wrote:

 Can you share a schematic with me? I can't visualize what you are
 doing.

 Gerald



 On Tue, Mar 4, 2014 at 5:05 PM, Dorian Levy dorianal...@gmail.comwrote:

 I am building a robot that uses an 11.7V battery. I tried
 attaching  a 5V regulator to the T5(+)/T8(-) (pins with the T6(SENSE)
 bridged to T5 and a 10K resistor between T8(TS) and ground. The board 
 only
 stays on for about thirty seconds then shuts down. Is it because of the 
 TS?
 What type of thermistor does it use? Or should I try to use the barrel 
 jack
 since it's not directly connected to a battery?

 --
 For more options, visit http://beagleboard.org/discuss
 ---
 You received this message because you are subscribed to the Google
 Groups BeagleBoard group.
 To unsubscribe from this group and stop receiving emails from it,
 send an email to beagleboard+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


  --
 For more options, visit http://beagleboard.org/discuss
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups BeagleBoard group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/beagleboard/-Zb4VUlh5Mg/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 beagleboard+unsubscr...@googlegroups.com.

 For more options, visit https://groups.google.com/groups/opt_out.

  --
 For more options, visit http://beagleboard.org/discuss
 ---
 You received this message because you are subscribed to the Google
 Groups BeagleBoard group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to beagleboard+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


  --
 For more options, visit http://beagleboard.org/discuss
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups BeagleBoard group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/beagleboard/-Zb4VUlh5Mg/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 beagleboard+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


  --
 For more options, visit http://beagleboard.org/discuss
 ---
 You received this message because you are subscribed to the Google Groups
 BeagleBoard group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to beagleboard+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


  --
 For more options, visit http://beagleboard.org/discuss
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups BeagleBoard group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/beagleboard/-Zb4VUlh5Mg/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 beagleboard+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
BeagleBoard group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [beagleboard] Powering the BBB

2014-03-05 Thread Dorian Levy
Because the IC can't provide the required current without a heat sink? Or
because the BBB is going into thermal protection? A little insight into why
you would expect that would be appreciated.
On Mar 5, 2014 1:43 PM, Gerald Coley ger...@beagleboard.org wrote:

 OK. Then what you are describing as your issue, i would expect to happen.

 Gerald



 On Wed, Mar 5, 2014 at 12:37 PM, Dorian Levy dorianal...@gmail.comwrote:

 No heatsink 5V
 On Mar 5, 2014 11:13 AM, Gerald Coley ger...@beagleboard.org wrote:

 Are you using a heatsink? Voltage?

 Gerald



 On Wed, Mar 5, 2014 at 10:07 AM, Dorian Levy dorianal...@gmail.comwrote:

 Addicore 5V 1.5A Positive Voltage Regulator L7805CV


 On Wed, Mar 5, 2014 at 10:52 AM, Gerald Coley 
 ger...@beagleboard.orgwrote:

 That particular regulator can have different pinouts. I have been
 bitten before. So double check that based on the supplier.

 What voltage are you seeing on the output? I believe the best you can
 get out of that regulator without a big heatsink is  maybe 500mA which is
 borderline for the BBB. You are dropping 6.7V across the regulator.

 Gerald



 On Wed, Mar 5, 2014 at 8:57 AM, Dorian Levy dorianal...@gmail.comwrote:

 On Mar 4, 2014 7:42 PM, Gerald Coley ger...@beagleboard.org
 wrote:

 Can you share a schematic with me? I can't visualize what you are
 doing.

 Gerald



 On Tue, Mar 4, 2014 at 5:05 PM, Dorian Levy 
 dorianal...@gmail.comwrote:

 I am building a robot that uses an 11.7V battery. I tried
 attaching  a 5V regulator to the T5(+)/T8(-) (pins with the T6(SENSE)
 bridged to T5 and a 10K resistor between T8(TS) and ground. The board 
 only
 stays on for about thirty seconds then shuts down. Is it because of 
 the TS?
 What type of thermistor does it use? Or should I try to use the barrel 
 jack
 since it's not directly connected to a battery?

 --
 For more options, visit http://beagleboard.org/discuss
 ---
 You received this message because you are subscribed to the Google
 Groups BeagleBoard group.
 To unsubscribe from this group and stop receiving emails from it,
 send an email to beagleboard+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


  --
 For more options, visit http://beagleboard.org/discuss
 ---
 You received this message because you are subscribed to a topic in
 the Google Groups BeagleBoard group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/beagleboard/-Zb4VUlh5Mg/unsubscribe
 .
 To unsubscribe from this group and all its topics, send an email to
 beagleboard+unsubscr...@googlegroups.com.

 For more options, visit https://groups.google.com/groups/opt_out.

  --
 For more options, visit http://beagleboard.org/discuss
 ---
 You received this message because you are subscribed to the Google
 Groups BeagleBoard group.
 To unsubscribe from this group and stop receiving emails from it,
 send an email to beagleboard+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


  --
 For more options, visit http://beagleboard.org/discuss
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups BeagleBoard group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/beagleboard/-Zb4VUlh5Mg/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 beagleboard+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


  --
 For more options, visit http://beagleboard.org/discuss
 ---
 You received this message because you are subscribed to the Google
 Groups BeagleBoard group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to beagleboard+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


  --
 For more options, visit http://beagleboard.org/discuss
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups BeagleBoard group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/beagleboard/-Zb4VUlh5Mg/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 beagleboard+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.

  --
 For more options, visit http://beagleboard.org/discuss
 ---
 You received this message because you are subscribed to the Google Groups
 BeagleBoard group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to beagleboard+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


  --
 For more options, visit http://beagleboard.org/discuss
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups BeagleBoard group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/beagleboard/-Zb4VUlh5Mg/unsubscribe.
 To unsubscribe from this group and all its topics

Re: [beagleboard] Powering the BBB

2014-03-05 Thread Dorian Levy
11.7V supply shouldn't be a problem because it can take up to 25V, but I'll
try a heat sink and see if that helps.



On Wed, Mar 5, 2014 at 2:05 PM, Gerald Coley ger...@beagleboard.org wrote:

 Because the regulator is going into thermal limit due to excessive heat
 dissipation. Make the 11.7V supply say 8V and it will run longer. The hole
 in the tab of the regulator is for the heat sink.

 Now, if the regulator is putting out 7V, then it could be the board.

 Gerald


 On Wed, Mar 5, 2014 at 1:02 PM, Dorian Levy dorianal...@gmail.com wrote:

 Because the IC can't provide the required current without a heat sink? Or
 because the BBB is going into thermal protection? A little insight into why
 you would expect that would be appreciated.
  On Mar 5, 2014 1:43 PM, Gerald Coley ger...@beagleboard.org wrote:

 OK. Then what you are describing as your issue, i would expect to happen.

 Gerald



 On Wed, Mar 5, 2014 at 12:37 PM, Dorian Levy dorianal...@gmail.comwrote:

 No heatsink 5V
 On Mar 5, 2014 11:13 AM, Gerald Coley ger...@beagleboard.org wrote:

 Are you using a heatsink? Voltage?

 Gerald



 On Wed, Mar 5, 2014 at 10:07 AM, Dorian Levy dorianal...@gmail.comwrote:

 Addicore 5V 1.5A Positive Voltage Regulator L7805CV


 On Wed, Mar 5, 2014 at 10:52 AM, Gerald Coley ger...@beagleboard.org
  wrote:

 That particular regulator can have different pinouts. I have been
 bitten before. So double check that based on the supplier.

 What voltage are you seeing on the output? I believe the best you
 can get out of that regulator without a big heatsink is  maybe 500mA 
 which
 is borderline for the BBB. You are dropping 6.7V across the regulator.

 Gerald



 On Wed, Mar 5, 2014 at 8:57 AM, Dorian Levy 
 dorianal...@gmail.comwrote:

 On Mar 4, 2014 7:42 PM, Gerald Coley ger...@beagleboard.org
 wrote:

 Can you share a schematic with me? I can't visualize what you are
 doing.

 Gerald



 On Tue, Mar 4, 2014 at 5:05 PM, Dorian Levy dorianal...@gmail.com
  wrote:

 I am building a robot that uses an 11.7V battery. I tried
 attaching  a 5V regulator to the T5(+)/T8(-) (pins with the T6(SENSE)
 bridged to T5 and a 10K resistor between T8(TS) and ground. The 
 board only
 stays on for about thirty seconds then shuts down. Is it because of 
 the TS?
 What type of thermistor does it use? Or should I try to use the 
 barrel jack
 since it's not directly connected to a battery?

 --
 For more options, visit http://beagleboard.org/discuss
 ---
 You received this message because you are subscribed to the
 Google Groups BeagleBoard group.
 To unsubscribe from this group and stop receiving emails from it,
 send an email to beagleboard+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


  --
 For more options, visit http://beagleboard.org/discuss
 ---
 You received this message because you are subscribed to a topic in
 the Google Groups BeagleBoard group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/beagleboard/-Zb4VUlh5Mg/unsubscribe
 .
 To unsubscribe from this group and all its topics, send an email
 to beagleboard+unsubscr...@googlegroups.com.

 For more options, visit https://groups.google.com/groups/opt_out.

  --
 For more options, visit http://beagleboard.org/discuss
 ---
 You received this message because you are subscribed to the Google
 Groups BeagleBoard group.
 To unsubscribe from this group and stop receiving emails from it,
 send an email to beagleboard+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


  --
 For more options, visit http://beagleboard.org/discuss
 ---
 You received this message because you are subscribed to a topic in
 the Google Groups BeagleBoard group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/beagleboard/-Zb4VUlh5Mg/unsubscribe
 .
 To unsubscribe from this group and all its topics, send an email to
 beagleboard+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


  --
 For more options, visit http://beagleboard.org/discuss
 ---
 You received this message because you are subscribed to the Google
 Groups BeagleBoard group.
 To unsubscribe from this group and stop receiving emails from it,
 send an email to beagleboard+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


  --
 For more options, visit http://beagleboard.org/discuss
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups BeagleBoard group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/beagleboard/-Zb4VUlh5Mg/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 beagleboard+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.

  --
 For more options, visit http://beagleboard.org/discuss
 ---
 You received this message because you are subscribed

[beagleboard] GPIO Edge

2014-03-04 Thread Dorian Levy
If setting /sys/class/gpio/gpioxx/edge creates an interrupt in the 
/proc/interrupts file, why is there no event file associated with it? What 
is the best way to use a gpio pin to count the number of times a switch is 
toggled? I really need to do it on two separate pins in order to ensure two 
motors are spinning at the same rate.
  

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
BeagleBoard group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[beagleboard] Powering the BBB

2014-03-04 Thread Dorian Levy
I am building a robot that uses an 11.7V battery. I tried attaching  a 5V 
regulator to the T5(+)/T8(-) (pins with the T6(SENSE) bridged to T5 and a 
10K resistor between T8(TS) and ground. The board only stays on for about 
thirty seconds then shuts down. Is it because of the TS? What type of 
thermistor does it use? Or should I try to use the barrel jack since 
it's not directly connected to a battery?  

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
BeagleBoard group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [beagleboard] Re: Counting events

2014-02-24 Thread Dorian Levy
Thanks a lot Hussam!

I could not get it working using the /sys/class/gpio/gpioxx/edge. Maybe
/sys/class/gpioxx/value would work? But by modifying the sample device tree
overlay from www.hipstercircuits.com and /dev/input/event1. I was able to
get it going using the following code.

#include stdio.h
#include stddef.h
#include time.h
#include iostream
#include fcntl.h
#include unistd.h
#include sys/types.h
#include string.h
#include termios.h
#include signal.h
#include stdlib.h
using namespace std;


volatile int counter = 0;

void IRQHandler(int sig){

counter ++;
cout  counter;

}


int main(void){
struct sigaction saio;
int fd1;
fd1 = open(/dev/input/event1, O_RDWR|O_NONBLOCK);
saio.sa_handler = IRQHandler;
//saio.sa_mask = 0;
saio.sa_flags = 0;
saio.sa_restorer = NULL;
sigaction(SIGIO,saio,NULL);
fcntl(fd1, F_SETOWN, getpid());
fcntl(fd1, F_SETFL, FASYNC);
while(1){

}

}




On Sun, Feb 23, 2014 at 8:57 PM, Hussam Hertani halhe...@gmail.com wrote:

 Dorian, here's a little example. First open the file and get a file
 descriptor, then use FCNTL with SETOWN command to send SIGIO to current
 process. Use fcntl to set the FASYNC flag  then populate the signal
 structure. This code was not tested but hopefully should give you an idea
 as to what to do...


 int counter = 0;

 int main(){
 struct sigaction saio;
 int fd ;
 fd = open(/sys/class/blahblah/edge,O_RDWR | O_NONBLOCK); // open file
 descriptor for the edge

 /* install the signal handler before making the device asynchronous */
 saio.sa_handler = signal_handler_IO;
 saio.sa_mask = 0;
 saio.sa_flags = 0;
 saio.sa_restorer = NULL;
  sigaction(SIGIO,saio,NULL);

 /* allow the process to receive SIGIO */
  fcntl(fd, F_SETOWN, getpid());
 /* Make the file descriptor asynchronous (the manual page says only
  O_APPEND and O_NONBLOCK, will work with F_SETFL...) */
 fcntl(fd, F_SETFL, FASYNC);


 }

 void signal_handler_IO (int status)
 {
 counter++;
 }

 Linux purists generally don't like  using signals,,,too many can cause
 many conflicts/race conditions that are hard to debug.
 http://ajaxxx.livejournal.com/62378.html

 most of the above code was taken from this link that has code for SIGIO
 asynchronous serial port access:
 http://www.tldp.org/HOWTO/pdf/Serial-Programming-HOWTO.pdf

 For more on signals in general
 http://beej.us/guide/bgipc/
 http://ph7spot.com/musings/introduction-to-unix-signals-and-system-calls
 http://www.linuxprogrammingblog.com/all-about-linux-signals?page=1

 For more on fcntl:
 http://linux.die.net/man/2/fcntl

 There's also real-time signals. I haven't heard of those before  today.
 But they seem to have less race conditions issues. I'll have to read up on
 them. Unfortunately My Linux Signal Programming fu is very limited. I
 recommend that you get yourself a good text reference on Linux System
 Programming as well. It will help.

 Regards,
 Hussam


 On Sun, Feb 23, 2014 at 7:35 PM, Dorian Levy dorianal...@gmail.comwrote:

 Something like SIGIO is what I was trying to do. I was
 trying signal(SIGINT, IRQHandler), but something is not
 right. How do I attach it, and why do Linux enthusiasts not recommend this?



 On Sun, Feb 23, 2014 at 1:40 PM, halhe...@gmail.com wrote:

 Dorian,

 I haven't tried any of these myself but I see no reason why they
 shouldn't work.

- you could use a fork to create a child process. In this child
process use the poll()/select() calls to detect a change in the edge 
 file.
When this happens a variable could be incremented  and piped back to the
parent process.
- You could use threads...i.e. a thread calls poll()/select() to
detect a change in the edge file and then updates a counts
variables.with threads all threads share the variables so this will 
 be
easier. but could be more convoluted.
- You could try monitoring the edge file with GDK/GTK libs
monitoring I/O calls
https://developer.gnome.org/gtk-tutorial/2.90/x1770.html. Qt has a
QIODevice class that does the same thing.
- You could also attach the SIGIO signal to the file descriptor for
the edge file and write a signal handler that increments a
variable...though Linux purists do not recommend this

 Hussam



 On Saturday, February 22, 2014 1:41:02 PM UTC-5, Dorian Levy wrote:

 I want to use a hall effect motor encoder to determine the number of
 revolutions of a wheel. Using the BB-KEYS I am able to set
 up /dev/inputs/event1 that captures the event and records the number of
 interrupts in /proc/interrupts. I believe setting
 /sys/class/gpio/gpioxx/edge will do pretty much the same. I haven't been
 able to figure out how to count them in a C/C++ code. Is it bes to set up
 an interrupt and count or try to read the /proc/interrupt file? Polling is
 not an option because there are two wheel that need to be counted. I would
 prefer to have and ISR that counts each time it is triggered, but I have
 not been able to figure out how to set it up. Any

Re: [beagleboard] Re: Counting events

2014-02-23 Thread Dorian Levy
Something like SIGIO is what I was trying to do. I was
trying signal(SIGINT, IRQHandler), but something is not
right. How do I attach it, and why do Linux enthusiasts not recommend this?



On Sun, Feb 23, 2014 at 1:40 PM, halhe...@gmail.com wrote:

 Dorian,

 I haven't tried any of these myself but I see no reason why they shouldn't
 work.

- you could use a fork to create a child process. In this child
process use the poll()/select() calls to detect a change in the edge file.
When this happens a variable could be incremented  and piped back to the
parent process.
- You could use threads...i.e. a thread calls poll()/select() to
detect a change in the edge file and then updates a counts
variables.with threads all threads share the variables so this will be
easier. but could be more convoluted.
- You could try monitoring the edge file with GDK/GTK libs monitoring
I/O calls https://developer.gnome.org/gtk-tutorial/2.90/x1770.html. Qt
has a QIODevice class that does the same thing.
- You could also attach the SIGIO signal to the file descriptor for
the edge file and write a signal handler that increments a
variable...though Linux purists do not recommend this

 Hussam



 On Saturday, February 22, 2014 1:41:02 PM UTC-5, Dorian Levy wrote:

 I want to use a hall effect motor encoder to determine the number of
 revolutions of a wheel. Using the BB-KEYS I am able to set
 up /dev/inputs/event1 that captures the event and records the number of
 interrupts in /proc/interrupts. I believe setting
 /sys/class/gpio/gpioxx/edge will do pretty much the same. I haven't been
 able to figure out how to count them in a C/C++ code. Is it bes to set up
 an interrupt and count or try to read the /proc/interrupt file? Polling is
 not an option because there are two wheel that need to be counted. I would
 prefer to have and ISR that counts each time it is triggered, but I have
 not been able to figure out how to set it up. Any help would be greatly
 appreciated since I have spent the last few days trying to research this
 without much luck.

 Thanks,
 Dorian

  --
 For more options, visit http://beagleboard.org/discuss
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups BeagleBoard group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/beagleboard/RhSCj3GgAj8/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 beagleboard+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
BeagleBoard group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[beagleboard] Counting events

2014-02-22 Thread Dorian Levy
I want to use a hall effect motor encoder to determine the number of 
revolutions of a wheel. Using the BB-KEYS I am able to set 
up /dev/inputs/event1 that captures the event and records the number of 
interrupts in /proc/interrupts. I believe setting 
/sys/class/gpio/gpioxx/edge will do pretty much the same. I haven't been 
able to figure out how to count them in a C/C++ code. Is it bes to set up 
an interrupt and count or try to read the /proc/interrupt file? Polling is 
not an option because there are two wheel that need to be counted. I would 
prefer to have and ISR that counts each time it is triggered, but I have 
not been able to figure out how to set it up. Any help would be greatly 
appreciated since I have spent the last few days trying to research this 
without much luck. 

Thanks,
Dorian 

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
BeagleBoard group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[beagleboard] Re: Not able to ping through Beaglebone Black on laptop

2014-02-10 Thread Dorian Levy


 Make sure you allow sharing under internet settings.


-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
BeagleBoard group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.