lib/sphero.rb in sphero-1.5.1 vs lib/sphero.rb in sphero-1.5.2
- old
+ new
@@ -65,10 +65,11 @@
def close
return if @sp.nil? || @sp.closed?
begin
stop
+ sleep 2
rescue Exception => e
puts e.message
ensure
@sp.close
end
@@ -110,10 +111,14 @@
def disable_auto_reconnect
queue_packet Request::SetAutoReconnect.new(@seq, 0, flag(false) )
end
+ def enable_stop_on_disconnect
+ queue_packet Request::SetTempOptionFlags.new(@seq, flag(true))
+ end
+
def power_state
queue_packet Request::GetPowerState.new(@seq)
end
def sphero_sleep wakeup = 0, macro = 0
@@ -451,9 +456,10 @@
'peru' => {:r => 205, :g => 133, :b => 63},
'pink' => {:r => 255, :g => 192, :b => 203},
'plum' => {:r => 221, :g => 160, :b => 221},
'powderblue' => {:r => 176, :g => 224, :b => 230},
'purple' => {:r => 128, :g => 0, :b => 128},
+ 'rebeccapurple' => {:r => 102, :g => 51, :b => 153},
'red' => {:r => 255, :g => 0, :b => 0},
'rosybrown' => {:r => 188, :g => 143, :b => 143},
'royalblue' => {:r => 65, :g => 105, :b => 225},
'saddlebrown' => {:r => 139, :g => 69, :b => 19},
'salmon' => {:r => 250, :g => 128, :b => 114},