Sends the setServos Pixy command.
        This method sets the pan/tilt servos that are plugged into Pixy's two servo ports.

        :param s0: value 0 to 1000

        :param s1: value 0 to 1000

        :returns: No return value.
331873
async def pixy_set_servos(self, s0, s1):
        
        data = [PrivateConstants.PIXY_SET_SERVOS, s0 & 0x7f, (s0 >> 7) & 0x7f,
                s1 & 0x7f, (s1 >> 7) & 0x7f]
        await self._send_sysex(PrivateConstants.PIXY_CONFIG, data)
1315099
protected void setProxyID(short s)
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setProxyID", ""+s);
      proxyID = s;
      proxyIDSet = true;
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setProxyID");
   }
331954
def sweep(port, rate, ID, retry=3):
	
	if port == 'dummy':
		s = ServoSerial(port, rate, fake=True)
	else:
		s = ServoSerial(port, rate)

	if ID < 0:
		ID = xl320.XL320_BROADCAST_ADDR

	try:
		s.open()
	except SerialException as e:
		# print('Error opening serial port:')
		print('-'*40)
		print(sys.argv[0], ':')
		print(e)
		exit(1)

	pkt = makePingPacket(ID)
	# print('ping', pkt)
	s.write(pkt)

	# as more servos add up, I might need to increase the cnt number???
	for cnt in range(retry):
		ans = s.read()

		if ans:
			for pkt in ans:
				servo = packetToDict(pkt)
				utils.prettyPrintPacket(servo)
				print('raw pkt: {}'.format(pkt))
		else:
			print('Try {}: no servos found'.format(cnt))

		time.sleep(0.1)

	s.close()
1374545
def _set_scale(self, value):
        
        sx, sxy, syx, sy, ox, oy = self.transformation
        sx, sy = value
        self.transformation = (sx, sxy, syx, sy, ox, oy)
608071
function startServo(timeOffset, timeInterval, angle)
{
    // Start running this instance after timeOffset milliseconds
    setTimeout(function()
    {
        // run this instance every timeInterval milliseconds
        setInterval(function()
        {
            servo.setAngle(angle);
            console.log("Set angle to " + angle);
        }, timeInterval);
    }, timeOffset);
    // timeOffset tells setTimeout when
    //		to execute the function specified in the first param
    // angle is passed as a param to the specified function
}
808425
def setPANID(self, xPAN):
        
        print '%s call setPANID' % self.port
        print xPAN
        panid = ''
        try:
            if not isinstance(xPAN, str):
                panid = str(hex(xPAN))
                print panid

            cmd = WPANCTL_CMD + 'setprop -s Network:PANID %s' % panid
            datasetCmd = WPANCTL_CMD + 'setprop Dataset:PanId %s' % panid
            self.hasActiveDatasetToCommit = True
            return self.__sendCommand(cmd)[0] != 'Fail' and self.__sendCommand(datasetCmd)[0] != 'Fail'
        except Exception, e:
            ModuleHelper.WriteIntoDebugLogger('setPANID() Error: ' + str(e))
935601
def write(self, s):
        
        try:
            return self.handle.write(s)
        except (OSError, serial.SerialException,
                serial.writeTimeoutError) as e:
            if e == serial.writeTimeoutError:
                print("sbp pyserial_driver: writeTimeoutError")
                return 0
            else:
                print()
                print("Piksi disconnected")
                print()
                self.handle.close()
                raise IOError
849942
protected void setOffsetPixels(float offsetPixels) {
		final int oldOffset = (int) mOffsetPixels;
		final int newOffset = (int) offsetPixels;

		mOffsetPixels = offsetPixels;

		if (newOffset != oldOffset) {
			onOffsetPixelsChanged(newOffset);
			mSwipeBackViewVisible = newOffset != 0;

			// Notify any attached listeners of the current open ratio
			final float openRatio = ((float) Math.abs(newOffset)) / mSwipeBackViewSize;
			dispatchOnDrawerSlide(openRatio, newOffset);
		}
	}
243632
def _set_pwm(self, raw_values):
        
        for i in range(len(self._pins)):
            self._pi.set_PWM_dutycycle(self._pins[i], raw_values[i])
1119510
def __set_parameters(self):
        
        self.__set_buffer_start(self.CMD_SET_PARAMETERS)
        # Can I send 0xFF as address to not change it each time?
        # Worry about writing to EEPROM or Flash with each address change.
        # Would then implement a separate address only change function.
        self.STRUCT_SET_PARAMETERS.pack_into(self.__out_buffer, self.OFFSET_PAYLOAD,
                                             self._max_current, self._max_power, self.address,
                                             self._load_mode, self._load_value)
        self.__set_checksum()
        self.__send_buffer()
        self.update_status()
1237600
def pixy_value_update(blocks):
    
    if len(blocks) > 0:
        pan_error = X_CENTER - blocks[0]["x"]
        pan_loop.update(pan_error)
#         tilt_error = blocks[0]["y"] - Y_CENTER  # not used for power over ICSP reasons
#         tilt_loop.update(tilt_error)

        loop = asyncio.get_event_loop()
        if loop.is_running():
            # This is the version that will be used since we are in a callback, but I wanted to show how to
            # properly protect against calls to board.something when you don't know if you are in the non-async
            # land vs when you are currently executing code from within async land.
            asyncio.ensure_future(board.core.pixy_set_servos(int(pan_loop.position), int(PIXY_RCS_CENTER_POS)))
        else:
            board.pixy_set_servos(int(pan_loop.position), int(PIXY_RCS_CENTER_POS))
715384
def setPhase(self, tlsID, index):
        
        self._connection._sendIntCmd(
            tc.CMD_SET_TL_VARIABLE, tc.TL_PHASE_INDEX, tlsID, index)
250820
def set_waveform(color, waveform: required!(:waveform),
                            cycles: required!(:cycles),
                            stream: 0,
                            transient: true,
                            period: 1.0,
                            skew_ratio: 0.5,
                            acknowledge: false)
      send_message(Protocol::Light::SetWaveform.new(
        color: color.to_hsbk,
        waveform: waveform,
        cycles: cycles,
        stream: stream,
        transient: transient,
        period: (period * 1_000).to_i,
        skew_ratio: (skew_ratio * 65535).round - 32768,
      ), acknowledge: acknowledge)
    end
907798
private void sendReset() {
        if (pullMode) {
            Ping recorded = new Ping();
            recorded.setEventType(Ping.RECORDED_STREAM);
            recorded.setValue2(streamId);
            // recorded 
            RTMPMessage recordedMsg = RTMPMessage.build(recorded);
            doPushMessage(recordedMsg);
        }
        Ping begin = new Ping();
        begin.setEventType(Ping.STREAM_BEGIN);
        begin.setValue2(streamId);
        // begin 
        RTMPMessage beginMsg = RTMPMessage.build(begin);
        doPushMessage(beginMsg);
        // reset
        ResetMessage reset = new ResetMessage();
        doPushMessage(reset);
    }
917953
def send_single_value(self, channel: int, value: int) -> int:
        
        SetSingleChannel = 1
        n = self._send_control_message(SetSingleChannel, value_or_length=value, channel=channel, data_or_length=1)
        return n
1239075
def set_servo(self, gpio, pulse_width_us):
        
        # Make sure we can set the exact pulse_width_us
        _pulse_incr_us = _PWM.get_pulse_incr_us()
        if pulse_width_us % _pulse_incr_us:
            # No clean division possible
            raise AttributeError(("Pulse width increment granularity %sus "
                    "cannot divide a pulse-time of %sus") % (_pulse_incr_us,
                    pulse_width_us))

        # Initialize channel if not already done, else check subcycle time
        if _PWM.is_channel_initialized(self._dma_channel):
            _subcycle_us = _PWM.get_channel_subcycle_time_us(self._dma_channel)
            if _subcycle_us != self._subcycle_time_us:
                raise AttributeError(("Error: DMA channel %s is setup with a "
                        "subcycle_time of %sus (instead of %sus)") % \
                        (self._dma_channel, _subcycle_us, 
                            self._subcycle_time_us))
        else:
            init_channel(self._dma_channel, self._subcycle_time_us)

        # Add pulse for this GPIO
        add_channel_pulse(self._dma_channel, gpio, 0, \
                int(pulse_width_us / _pulse_incr_us))
899493
def register_phase_model(self, pid):
        
        if self.assignments['forward_model'] is None:
            self.assignments['forward_model'] = [None, None]

        self.assignments['forward_model'][1] = pid