LabVIEW for LEGO MINDSTORMS and LabVIEW for Education

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading directly from I2C ports

Hi Folks,
      Does anyone have a working example of how to read bytes directly from the I2C ports?  Here, Sivan Toledo says it can't be done from NXT-G environment.  He says he used "NBC" (appears to be written in assembler) but how?
 
Does anyone know how the NXTSystemCall.NXTCommLSRead method might be used? (I'm seeing a -32 return-code.)   Also, I experimented with sendDirectCommand.vi ("Fantom direct") but see the NXT Terminal throws an error related to CreateNXTObject (which seems to be required if using the "direct" approach.)
 
I only get to work on this when already tired, sorry if I've missed something obvious.
 
Any ideas would be appreciated!
 
"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 1 of 3
(7,124 Views)
... ok, instead of scanning for an example program in the "Advanced Programming" manual, I read the section on LowSpeed reads - also looked at how the Toolkit VIs talk to the UltrasonicSensor.
 
I'd tried just using LSRead, but the Manual says (to the effect) all I2C Port communication begins with  a Write (in a master-slave arrangement), so I write an empty buffer requesting zero-bytes back then (per the manual) check Status - which is returning "32" (busy.)  If the Status-check ever returns "0", then I'll try calling the LSRead.
 
Guess it's time to get-out the scope!
 
 
 
 
 
 
"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 2 of 3
(7,099 Views)
I'm just familiarising myself with the msgs in the LabVIEW Fans of LEGO forum and came across this unanswered post.

Perhaps this thread has the answer you were after.

regards
Peter
Peter
0 Kudos
Message 3 of 3
(6,662 Views)