Jump to content

Weird data from Segment display #get_segments


Recommended Posts

Hello,

Maybe I'm wrong, but I have a suspicion BrickletSegmentDisplay4x7V2#get_segments does not return correct values.

I think the Bricklet responds with correct data, but the data is mangled when unpacked.

To be precise, when data is unpacked for the first segment (8 values), too much data is slurped so nothing remains for the other 27 values.

Here is a quick & dirty debug helper:

module Tinkerforge
  class BrickletSegmentDisplay4x7V2

    def debug_get_segments
      puts '                 |.......|.......|.......|.......|.|'
      puts 'get_segments   : ' + get_segments.flatten.map { |b| b ? '1' : '0' }.join
      puts 'actual response: ' + (send_request FUNCTION_GET_SEGMENTS, [], '', 14, '?35' ).map { |b| b ? '1' : '0' }.join
      puts ''
    end

  end
end

 

Link to post
Share on other sites
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...