Shop OBEX P1 Docs P2 Docs Learn Events
The onewire.spin object — Parallax Forums

The onewire.spin object

AcquaLifeAcquaLife Posts: 19
edited 2012-06-06 15:34 in Propeller 1
Okay, so i need some help with this object. I need to know how can i read a specific byte in an array of bytes? For instance i have an array that holds 8 elements. I need to read the 7th and 8th element and store them in different variables.

Comments

  • JonnyMacJonnyMac Posts: 9,195
    edited 2012-06-06 15:34
    someVar := array_name[index]
    


    Now... if the array happens to be in another object you might want to create a method (inside the object) to return an array element:
    pub read(idx)
    
      return array_name[idx]
    
Sign In or Register to comment.