11-07-2014 09:43 AM
Hello,
I now work for 1-2 weeks but there is no solution for my problem.
I had bought a digital encoder for the angular measurement of a robot arm.
http://docs-europe.electrocomponents.com/webdocs/12af/0900766b812af498.pdf
I have connected the PINS according to owners manual to the Arduino MEGA 2560 board. But the output ist always Zero.
PIN1 Digital Input -> Ground
PIN2 Clock -> SCK Arduino PIN 52
PIN3 Ground -> Ground
PIN 4 Digital Output -> MISO
PIN 5 VCC -> 5V
PIN 6 CS -> SS Slave
Can anyone help me with the program?
11-10-2014 05:13 PM
Are you sure the device will work using SPI?
Also, there are several of the VI's that you shouldn't be using in the while loop including "Pin Mode" and all of the SPI configuration and Init VIs. The Init VI should be after your configure the SPI port also.
11-11-2014 01:00 AM
hello nathan,
First of all thank you for the fast reply.
I 'm not sure if the encoder outputs really SPI .
In the notes I send a photo from a functioned C code that works in the Arduino program . Can someone help me put this code into a .vi
11-11-2014 05:49 PM
That code doesn't use SPI so you should not expect SPI to work. You would
need to create a new custom function to implement that code to have it
return the raw data to LabVIEW where you would interpret it there.