Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Python (http://www.chiefdelphi.com/forums/forumdisplay.php?f=187)
-   -   Interrupts with RobotPy (http://www.chiefdelphi.com/forums/showthread.php?t=149408)

RyanN 12-07-2016 14:16

Interrupts with RobotPy
 
I know interrupts work with RobotPy, since encoders and counters are covered.

How do I create an interrupt with RobotPy?

Say I have the ADIS16448 IMU that I would like to use the DataReady output for to call an ISR. And yes, I know what I'm doing probably won't work well. Python is probably too slow to handle real time interrupts.

Some example code would be great!

Thanks!

Ether 12-07-2016 15:31

Re: Interrupts with RobotPy
 
Quote:

Originally Posted by RyanN (Post 1596461)
I know interrupts work with RobotPy, since encoders and counters are covered.

Encoders and counters do not use interrupts. They are polled by the FPGA.



virtuald 13-07-2016 00:06

Re: Interrupts with RobotPy
 
Quote:

Originally Posted by Ether (Post 1596470)
Encoders and counters do not use interrupts. They are polled by the FPGA.

What he said.

... I've never tried doing WPILib interrupts in python. They certainly won't do anything in the simulator, and chances are they *mostly* work on the real robot, but there are probably edge cases where you'll get a weird exception (this is how I2C/SPI was until I actually had some hardware to do testing with).

I would recommend finding some Java code and translating it into python, and then file bug reports on github when you find it doesn't work. :)

RyanN 13-07-2016 12:36

Re: Interrupts with RobotPy
 
I'll try to find some Java code then.

I'm guessing the FPGA has RTL for handling encoders and counters then. (It makes sense). I always forget the RoboRIO is half processor, half FPGA. I'm used to just processors. :)

Joe Ross 13-07-2016 21:14

The Java roborio library for the adis16448 uses interrupts for the same purpose you want.

RyanN 18-07-2016 11:16

Re: Interrupts with RobotPy
 
Quote:

Originally Posted by Joe Ross (Post 1596658)
The Java roborio library for the adis16448 uses interrupts for the same purpose you want.

Yep. I figured that one out. :)

Thanks!


All times are GMT -5. The time now is 21:40.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi