中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當(dāng)前位置: 首頁(yè) > news >正文

企業(yè)建設(shè)網(wǎng)站的預(yù)期收益網(wǎng)絡(luò)營(yíng)銷(xiāo)的8個(gè)基本職能

企業(yè)建設(shè)網(wǎng)站的預(yù)期收益,網(wǎng)絡(luò)營(yíng)銷(xiāo)的8個(gè)基本職能,上海天華建筑設(shè)計(jì)有限公司待遇,網(wǎng)站模板制作教程視頻基于Jetson Nano板子搭建一個(gè)無(wú)人車(chē),少不了減速電機(jī)驅(qū)動(dòng)輪子滾動(dòng),那如何驅(qū)動(dòng)呢?從Jetson.GPIO庫(kù)文件來(lái)說(shuō),里面沒(méi)有支持產(chǎn)生PWM的引腳,也就意味著Jetson nano沒(méi)有硬件產(chǎn)生PWM的能力,所以我們不得不使用別的方…

基于Jetson Nano板子搭建一個(gè)無(wú)人車(chē),少不了減速電機(jī)驅(qū)動(dòng)輪子滾動(dòng),那如何驅(qū)動(dòng)呢?

從Jetson.GPIO庫(kù)文件來(lái)說(shuō),里面沒(méi)有支持產(chǎn)生PWM的引腳,也就意味著Jetson nano沒(méi)有硬件產(chǎn)生PWM的能力,所以我們不得不使用別的方法產(chǎn)生PWM完成驅(qū)動(dòng)控制,而剛好STM8解決了這一問(wèn)題并且節(jié)約了它有限的GPIO資源,我們借助STM8這款MCU作為協(xié)處理器,大大增強(qiáng)了Jetson nano的驅(qū)動(dòng)能力,PWM的周期和占空比(在一個(gè)脈沖循環(huán)內(nèi),通電時(shí)間相對(duì)于總時(shí)間所占的比例)都完全可控。

我們來(lái)看下它的參數(shù):

我們使用的是上圖所示的QFN20封裝的STM8,它主要參數(shù)特征如下:

1. I2C接口,支持多路PWM輸出
2. 內(nèi)置16MHz晶振,可不連接外部晶振,也可以連接外部晶振
3. 支持2.95V-5.5V電壓,最大耐壓值5.5V
4. 具有上電復(fù)位,以及軟件復(fù)位等功能

由上圖三極管驅(qū)動(dòng)的有源蜂鳴器電路,而三極管控制引腳接在協(xié)處理器可知,開(kāi)啟蜂鳴器只需要通過(guò)IIC給協(xié)處理器對(duì)應(yīng)的指令即可,下面我們看到通訊協(xié)議:

在上一篇文章我們演示的蜂鳴器,我們通過(guò)IIC向協(xié)處理器(地址0x1B)的寄存器0x06發(fā)送1即可打開(kāi)蜂鳴器,發(fā)送0即關(guān)閉蜂鳴器

bus.write_byte_data(0x1B,0x06,1或0)

同樣的給出兩路電機(jī)的電路圖:

我們來(lái)實(shí)際驅(qū)動(dòng)電機(jī)看下,這里電機(jī)控制部分用到了Jetbotmini的庫(kù):

from jetbotmini import Robot
import time
robot = Robot()
print(dir(robot))
#['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getstate__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setstate__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_add_notifiers', '_config_changed', '_cross_validation_lock', '_find_my_config', '_instance', '_load_config', '_log_default', '_notify_trait', '_register_validator', '_remove_notifiers', '_trait_default_generators', '_trait_notifiers', '_trait_validators', '_trait_values', '_walk_mro', 'add_traits', 'backward', 'class_config_rst_doc', 'class_config_section', 'class_get_help', 'class_get_trait_help', 'class_own_trait_events', 'class_own_traits', 'class_print_help', 'class_trait_names', 'class_traits', 'clear_instance', 'config', 'cross_validation_lock', 'forward', 'has_trait', 'hold_trait_notifications', 'i2c_bus', 'initialized', 'instance', 'left', 'left_motor', 'left_motor_alpha', 'left_motor_channel', 'log', 'motor_driver', 'notify_change', 'observe', 'on_trait_change', 'parent', 'right', 'right_motor', 'right_motor_alpha', 'right_motor_channel', 'section_names', 'set_motors', 'set_trait', 'setup_instance', 'stop', 'trait_events', 'trait_metadata', 'trait_names', 'traits', 'unobserve', 'unobserve_all', 'update_config']
print(dir(robot.left_motor))
#['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getstate__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setstate__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_add_notifiers', '_config_changed', '_cross_validation_lock', '_driver', '_find_my_config', '_load_config', '_motor', '_notify_trait', '_observe_value', '_register_validator', '_release', '_remove_notifiers', '_trait_default_generators', '_trait_notifiers', '_trait_validators', '_trait_values', '_write_value', 'add_traits', 'alpha', 'beta', 'class_config_rst_doc', 'class_config_section', 'class_get_help', 'class_get_trait_help', 'class_own_trait_events', 'class_own_traits', 'class_print_help', 'class_trait_names', 'class_traits', 'config', 'cross_validation_lock', 'has_trait', 'hold_trait_notifications', 'notify_change', 'observe', 'on_trait_change', 'parent', 'section_names', 'set_trait', 'setup_instance', 'trait_events', 'trait_metadata', 'trait_names', 'traits', 'unobserve', 'unobserve_all', 'update_config', 'value']
#這個(gè)轉(zhuǎn)速的范圍是[0,1],不過(guò)我設(shè)置成0.1也沒(méi)有轉(zhuǎn),設(shè)置成0.2及以上才轉(zhuǎn),不知道是不是電量不是很足的原因了。
robot.left_motor.value = 0.8
robot.right_motor.value = 0.8
#這樣就可以讓電機(jī)轉(zhuǎn)動(dòng)了,很簡(jiǎn)單,然后做停止電機(jī)的操作
robot.left_motor.value = 0
robot.right_motor.value = 0
#或者直接將robot停止也可以
#robot.stop()

這段賦值左右馬達(dá)的意思就是,控制電機(jī)速度的值的范圍是0~1.0,即代表給出的PWM的占空比為0~100%,所以賦值為0,就是把輸出給電機(jī)的PWM占空比設(shè)置為0,這樣就關(guān)閉了電機(jī)

更多的robot實(shí)例方法可以自行查閱源碼:

Help on Robot in module jetbotmini.robot object:class Robot(traitlets.config.configurable.SingletonConfigurable)|  A configurable that only allows one instance.|  |  This class is for classes that should only have one instance of itself|  or *any* subclass. To create and retrieve such a class use the|  :meth:`SingletonConfigurable.instance` method.|  |  Method resolution order:|      Robot|      traitlets.config.configurable.SingletonConfigurable|      traitlets.config.configurable.LoggingConfigurable|      traitlets.config.configurable.Configurable|      traitlets.traitlets.HasTraits|      traitlets.traitlets.HasDescriptors|      builtins.object|  |  Methods defined here:|  |  __init__(self, *args, **kwargs)|      Create a configurable given a config config.|      |      Parameters|      ----------|      config : Config|          If this is empty, default values are used. If config is a|          :class:`Config` instance, it will be used to configure the|          instance.|      parent : Configurable instance, optional|          The parent Configurable instance of this object.|      |      Notes|      -----|      Subclasses of Configurable must call the :meth:`__init__` method of|      :class:`Configurable` *before* doing anything else and using|      :func:`super`::|      |          class MyConfigurable(Configurable):|              def __init__(self, config=None):|                  super(MyConfigurable, self).__init__(config=config)|                  # Then any other code you need to finish initialization.|      |      This ensures that instances will be configured properly.|  |  backward(self, speed=1.0)|  |  forward(self, speed=1.0, duration=None)|  |  left(self, speed=1.0)|  |  right(self, speed=1.0)|  |  set_motors(self, left_speed, right_speed)|  |  stop(self)|  |  ----------------------------------------------------------------------|  Data descriptors defined here:|  |  i2c_bus|      An int trait.|  |  left_motor|      A trait whose value must be an instance of a specified class.|      |      The value can also be an instance of a subclass of the specified class.|      |      Subclasses can declare default classes by overriding the klass attribute|  |  left_motor_alpha|      A float trait.|  |  left_motor_channel|      An int trait.|  |  right_motor|      A trait whose value must be an instance of a specified class.|      |      The value can also be an instance of a subclass of the specified class.|      |      Subclasses can declare default classes by overriding the klass attribute|  |  right_motor_alpha|      A float trait.|  |  right_motor_channel|      An int trait.|  |  ----------------------------------------------------------------------|  Class methods inherited from traitlets.config.configurable.SingletonConfigurable:|  |  clear_instance() from traitlets.traitlets.MetaHasTraits|      unset _instance for this class and singleton parents.|  |  initialized() from traitlets.traitlets.MetaHasTraits|      Has an instance been created?|  |  instance(*args, **kwargs) from traitlets.traitlets.MetaHasTraits|      Returns a global instance of this class.|      |      This method create a new instance if none have previously been created|      and returns a previously created instance is one already exists.|      |      The arguments and keyword arguments passed to this method are passed|      on to the :meth:`__init__` method of the class upon instantiation.|      |      Examples|      --------|      |      Create a singleton class using instance, and retrieve it::|      |          >>> from traitlets.config.configurable import SingletonConfigurable|          >>> class Foo(SingletonConfigurable): pass|          >>> foo = Foo.instance()|          >>> foo == Foo.instance()|          True|      |      Create a subclass that is retrived using the base class instance::|      |          >>> class Bar(SingletonConfigurable): pass|          >>> class Bam(Bar): pass|          >>> bam = Bam.instance()|          >>> bam == Bar.instance()|          True|  |  ----------------------------------------------------------------------|  Data descriptors inherited from traitlets.config.configurable.LoggingConfigurable:|  |  log|      A trait whose value must be an instance of a specified class.|      |      The value can also be an instance of a subclass of the specified class.|      |      Subclasses can declare default classes by overriding the klass attribute|  |  ----------------------------------------------------------------------|  Methods inherited from traitlets.config.configurable.Configurable:|  |  update_config(self, config)|      Update config and load the new values|  |  ----------------------------------------------------------------------|  Class methods inherited from traitlets.config.configurable.Configurable:|  |  class_config_rst_doc() from traitlets.traitlets.MetaHasTraits|      Generate rST documentation for this class' config options.|      |      Excludes traits defined on parent classes.|  |  class_config_section() from traitlets.traitlets.MetaHasTraits|      Get the config class config section|  |  class_get_help(inst=None) from traitlets.traitlets.MetaHasTraits|      Get the help string for this class in ReST format.|      |      If `inst` is given, it's current trait values will be used in place of|      class defaults.|  |  class_get_trait_help(trait, inst=None) from traitlets.traitlets.MetaHasTraits|      Get the help string for a single trait.|      |      If `inst` is given, it's current trait values will be used in place of|      the class default.|  |  class_print_help(inst=None) from traitlets.traitlets.MetaHasTraits|      Get the help string for a single trait and print it.|  |  section_names() from traitlets.traitlets.MetaHasTraits|      return section names as a list|  |  ----------------------------------------------------------------------|  Data descriptors inherited from traitlets.config.configurable.Configurable:|  |  config|      A trait whose value must be an instance of a specified class.|      |      The value can also be an instance of a subclass of the specified class.|      |      Subclasses can declare default classes by overriding the klass attribute|  |  parent|      A trait whose value must be an instance of a specified class.|      |      The value can also be an instance of a subclass of the specified class.|      |      Subclasses can declare default classes by overriding the klass attribute|  |  ----------------------------------------------------------------------|  Methods inherited from traitlets.traitlets.HasTraits:|  |  __getstate__(self)|  |  __setstate__(self, state)|  |  add_traits(self, **traits)|      Dynamically add trait attributes to the HasTraits instance.|  |  has_trait(self, name)|      Returns True if the object has a trait with the specified name.|  |  hold_trait_notifications(self)|      Context manager for bundling trait change notifications and cross|      validation.|      |      Use this when doing multiple trait assignments (init, config), to avoid|      race conditions in trait notifiers requesting other trait values.|      All trait notifications will fire after all values have been assigned.|  |  notify_change(self, change)|  |  observe(self, handler, names=traitlets.All, type='change')|      Setup a handler to be called when a trait changes.|      |      This is used to setup dynamic notifications of trait changes.|      |      Parameters|      ----------|      handler : callable|          A callable that is called when a trait changes. Its|          signature should be ``handler(change)``, where ``change`` is a|          dictionary. The change dictionary at least holds a 'type' key.|          * ``type``: the type of notification.|          Other keys may be passed depending on the value of 'type'. In the|          case where type is 'change', we also have the following keys:|          * ``owner`` : the HasTraits instance|          * ``old`` : the old value of the modified trait attribute|          * ``new`` : the new value of the modified trait attribute|          * ``name`` : the name of the modified trait attribute.|      names : list, str, All|          If names is All, the handler will apply to all traits.  If a list|          of str, handler will apply to all names in the list.  If a|          str, the handler will apply just to that name.|      type : str, All (default: 'change')|          The type of notification to filter by. If equal to All, then all|          notifications are passed to the observe handler.|  |  on_trait_change(self, handler=None, name=None, remove=False)|      DEPRECATED: Setup a handler to be called when a trait changes.|      |      This is used to setup dynamic notifications of trait changes.|      |      Static handlers can be created by creating methods on a HasTraits|      subclass with the naming convention '_[traitname]_changed'.  Thus,|      to create static handler for the trait 'a', create the method|      _a_changed(self, name, old, new) (fewer arguments can be used, see|      below).|      |      If `remove` is True and `handler` is not specified, all change|      handlers for the specified name are uninstalled.|      |      Parameters|      ----------|      handler : callable, None|          A callable that is called when a trait changes.  Its|          signature can be handler(), handler(name), handler(name, new),|          handler(name, old, new), or handler(name, old, new, self).|      name : list, str, None|          If None, the handler will apply to all traits.  If a list|          of str, handler will apply to all names in the list.  If a|          str, the handler will apply just to that name.|      remove : bool|          If False (the default), then install the handler.  If True|          then unintall it.|  |  set_trait(self, name, value)|      Forcibly sets trait attribute, including read-only attributes.|  |  setup_instance(self, *args, **kwargs)|      This is called **before** self.__init__ is called.|  |  trait_metadata(self, traitname, key, default=None)|      Get metadata values for trait by key.|  |  trait_names(self, **metadata)|      Get a list of all the names of this class' traits.|  |  traits(self, **metadata)|      Get a ``dict`` of all the traits of this class.  The dictionary|      is keyed on the name and the values are the TraitType objects.|      |      The TraitTypes returned don't know anything about the values|      that the various HasTrait's instances are holding.|      |      The metadata kwargs allow functions to be passed in which|      filter traits based on metadata values.  The functions should|      take a single value as an argument and return a boolean.  If|      any function returns False, then the trait is not included in|      the output.  If a metadata key doesn't exist, None will be passed|      to the function.|  |  unobserve(self, handler, names=traitlets.All, type='change')|      Remove a trait change handler.|      |      This is used to unregister handlers to trait change notifications.|      |      Parameters|      ----------|      handler : callable|          The callable called when a trait attribute changes.|      names : list, str, All (default: All)|          The names of the traits for which the specified handler should be|          uninstalled. If names is All, the specified handler is uninstalled|          from the list of notifiers corresponding to all changes.|      type : str or All (default: 'change')|          The type of notification to filter by. If All, the specified handler|          is uninstalled from the list of notifiers corresponding to all types.|  |  unobserve_all(self, name=traitlets.All)|      Remove trait change handlers of any type for the specified name.|      If name is not specified, removes all trait notifiers.|  |  ----------------------------------------------------------------------|  Class methods inherited from traitlets.traitlets.HasTraits:|  |  class_own_trait_events(name) from traitlets.traitlets.MetaHasTraits|      Get a dict of all event handlers defined on this class, not a parent.|      |      Works like ``event_handlers``, except for excluding traits from parents.|  |  class_own_traits(**metadata) from traitlets.traitlets.MetaHasTraits|      Get a dict of all the traitlets defined on this class, not a parent.|      |      Works like `class_traits`, except for excluding traits from parents.|  |  class_trait_names(**metadata) from traitlets.traitlets.MetaHasTraits|      Get a list of all the names of this class' traits.|      |      This method is just like the :meth:`trait_names` method,|      but is unbound.|  |  class_traits(**metadata) from traitlets.traitlets.MetaHasTraits|      Get a ``dict`` of all the traits of this class.  The dictionary|      is keyed on the name and the values are the TraitType objects.|      |      This method is just like the :meth:`traits` method, but is unbound.|      |      The TraitTypes returned don't know anything about the values|      that the various HasTrait's instances are holding.|      |      The metadata kwargs allow functions to be passed in which|      filter traits based on metadata values.  The functions should|      take a single value as an argument and return a boolean.  If|      any function returns False, then the trait is not included in|      the output.  If a metadata key doesn't exist, None will be passed|      to the function.|  |  trait_events(name=None) from traitlets.traitlets.MetaHasTraits|      Get a ``dict`` of all the event handlers of this class.|      |      Parameters|      ----------|      name: str (default: None)|          The name of a trait of this class. If name is ``None`` then all|          the event handlers of this class will be returned instead.|      |      Returns|      -------|      The event handlers associated with a trait name, or all event handlers.|  |  ----------------------------------------------------------------------|  Data descriptors inherited from traitlets.traitlets.HasTraits:|  |  cross_validation_lock|      A contextmanager for running a block with our cross validation lock set|      to True.|      |      At the end of the block, the lock's value is restored to its value|      prior to entering the block.|  |  ----------------------------------------------------------------------|  Static methods inherited from traitlets.traitlets.HasDescriptors:|  |  __new__(cls, *args, **kwargs)|      Create and return a new object.  See help(type) for accurate signature.|  |  ----------------------------------------------------------------------|  Data descriptors inherited from traitlets.traitlets.HasDescriptors:|  |  __dict__|      dictionary for instance variables (if defined)|  |  __weakref__|      list of weak references to the object (if defined)
http://www.risenshineclean.com/news/56822.html

相關(guān)文章:

  • php培訓(xùn)機(jī)構(gòu)企業(yè)做網(wǎng)站網(wǎng)站seo優(yōu)化課程
  • 企業(yè)手機(jī)網(wǎng)站建設(shè)流程免費(fèi)網(wǎng)站建設(shè)哪個(gè)好
  • 廣西壯族自治區(qū)建設(shè)廳網(wǎng)站seo快排技術(shù)教程
  • 做響應(yīng)式網(wǎng)站有什么插件廈門(mén)網(wǎng)站的關(guān)鍵詞自動(dòng)排名
  • 長(zhǎng)春移動(dòng)網(wǎng)站建設(shè)近日網(wǎng)站收錄查詢
  • 江蘇省建設(shè)安全協(xié)會(huì)網(wǎng)站seo推廣軟件
  • wordpress用戶站內(nèi)信網(wǎng)店推廣的方式
  • 物流行業(yè)網(wǎng)站建設(shè)方案杭州網(wǎng)站建設(shè)公司
  • 太原企業(yè)網(wǎng)站制作公司哪個(gè)平臺(tái)推廣效果好
  • 臺(tái)州椒江網(wǎng)站建設(shè)企業(yè)培訓(xùn)機(jī)構(gòu)有哪些
  • 筋鄭州做網(wǎng)站找營(yíng)銷(xiāo)推廣團(tuán)隊(duì)
  • 亳州做商標(biāo)網(wǎng)站的公司個(gè)人接廣告的平臺(tái)
  • 貴陽(yáng)網(wǎng)站建設(shè)公司哪個(gè)好打開(kāi)百度搜索
  • 綿陽(yáng)企業(yè)網(wǎng)站建設(shè)免費(fèi)入駐的賣(mài)貨平臺(tái)
  • 技術(shù)先進(jìn)的網(wǎng)站建設(shè)公司學(xué)it需要什么學(xué)歷基礎(chǔ)
  • 公安網(wǎng)計(jì)算機(jī)可以作為網(wǎng)站開(kāi)發(fā)嗎新鄭網(wǎng)絡(luò)推廣公司
  • wordpress 自定義css百度移動(dòng)排名優(yōu)化軟件
  • 做網(wǎng)站1萬(wàn)多百度推廣有哪些售后服務(wù)
  • 湘潭網(wǎng)絡(luò)推廣臺(tái)州百度推廣優(yōu)化
  • 貴陽(yáng)網(wǎng)站建設(shè)是什么金泉網(wǎng)做網(wǎng)站多少錢(qián)
  • 財(cái)經(jīng)資訊網(wǎng)站該怎么做推廣網(wǎng)絡(luò)關(guān)鍵詞優(yōu)化方法
  • 山東省建設(shè)廳電工證查詢網(wǎng)站搜索引擎營(yíng)銷(xiāo)成功案例
  • 濟(jì)南網(wǎng)站建設(shè)推薦q479185700強(qiáng)涵湖北網(wǎng)絡(luò)推廣seo
  • 做網(wǎng)站的人屬于什么行業(yè)河北軟文搜索引擎推廣公司
  • 武漢營(yíng)銷(xiāo)型網(wǎng)站建設(shè)百度seo排名培訓(xùn)
  • 網(wǎng)站開(kāi)發(fā)的邏輯百度怎么發(fā)布自己的廣告
  • 響應(yīng)式網(wǎng)站好不好推廣方式有哪幾種
  • 網(wǎng)站頁(yè)尾版權(quán)網(wǎng)頁(yè)模板設(shè)計(jì)
  • 自己做電影網(wǎng)站需要的成本國(guó)外b站瀏覽器
  • 做網(wǎng)站分為競(jìng)價(jià)和優(yōu)化seo入門(mén)培訓(xùn)學(xué)校