06-01-2013 10:53 AM
I want to read encoder with custom firmware to using interrupt but it not operate .
my encoder code , custom firmware and my VI(labview) are attach
In custom firmware , edit in ( Case 0xFE ) and under Functions title
Is it correct????
I wish to rapidly repeat
06-01-2013 12:06 PM
Could you either post a .zip file or post the files individually? I would recommend using an Arduino library that was written for encoders and add that to the LIFA firmware, that is what I did.
06-02-2013 06:23 AM
thanks for your reply
I am sorry , I attach my files again
06-02-2013 03:59 PM
Regarding your code, when using LIFA, you can't just start writing things randomly to the serial port because it is not within the framework of LIFA and will mess up communication.
Like I said previously, my primary recommendation is to use an existing encoder library. When I did this, I created each of my encoders globally (in LIFA_Base), then, when I needed the count, I could simply create a function in LIFA that retrieved and sent back the count to LabVIEW. Doing it this way means you never need to attach the interupts manually and only need to set and read the count via LIFA.
06-03-2013 08:11 AM
thanks for your reply ,
please attach encoder library and how to use it in custom firmware
06-03-2013 01:59 PM
I used this encoder library. I've attached the code that I added to the LabVIEWInterface.pde (now .ino) to make this work. I've also posted the VIs that I wrote to complete the functionality in LabVIEW. You may need to change some things (in firmware and LabVIEW) to get it to work in the current version of LIFA (I wrote my code for 1.3.0.26).
06-04-2013 02:56 AM
thanks alot
If it operate , I will tell you
06-04-2013 04:05 AM
There is error in code library
06-04-2013 11:11 AM
It looks like the library was udpated since I programmed my robot with this code. Just try removing that line (in my code attached above, not in the library). I can't even remember why it was needed but I'm assuming I took it off of some example (the current example does not show this line).
06-04-2013 03:24 PM
This error occurs in examples of encoder library also
and I edit the code library in line
volatile IO_REG_TYPE * pin1_register; |
to
volatile int IO_REG_TYPE ;*int pin1_register;
but there is another error