⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme

📁 这个开发机器人项目源码
💻
📖 第 1 页 / 共 2 页
字号:
                             characteristics. Command 105 releases the lock and                             discards the stored event (command 10 would                              return zero immediately after command 105 is                              issued).Read Byte Data, Command =11: Report the "IR Triggered Event Mode" setting (one                             data byte). 1 = First Event (stop storing events                             after the first one is triggered), 2 = Last Event                             (overwrite the stored event each time one is                             detected, so that the most recent event is always                             the one that's stored), and 3 = Maximum Event                             (only overwrite the stored event if an event is                             detected with a bigger detection spike than the                             stored event). 0 = IR sensing completely disabled.Read Byte Data, Command =12: Report the IR triggered event ADC bitcount (one                             data bye).  Host should use command 10 first to                             check if a detection event occurred, and to                             "lock" it (i.e. prevent it from being                             overwitten by another event).Read Byte Data, Command =13: Report the 8-bit timer value at the time the                             stored IR event was triggered (one data byte).                             Host should use command 10 first to                             check if a detection event occurred, and to                             "lock" it (i.e. prevent it from being                             overwitten by another event).Read Byte Data, Command =14: Report the current 8-bit timer value (one data                             byte). This is a free running counter that                              increments by one every 20ms (the servo drive                              period), so it wraps around every 5.12 seconds.Read Byte Date, Command =15: Report the status of the PWM outputs.                             0 = outputs disabled (servos limp). This is the                             initial default, low power mode. In this mode,                             the free running timer counter and the infrared                             sensing is also disabled.                             1 = PWM output active (timer counter and infrared                             sensing also enabled).Write Byte Data, Command = 100 : Set the Pan servo position setpoint (one data                                 byte).Write Byte Data, Command = 101 : Set the Tilt servo position setpoint (one data                                 byte).Write Byte Data, Command = 102 : Set the "Maximum Change Per Period" setting                                 (one data byte). This is the maximum change                                  per update period (which is 20ms) of a                                 servo's driven position. The smaller this                                  value is, the slower (and smoother) the                                  servos will appear to respond to changes in                                  setpoint. For example, a value of 1                             means that a servo's actual driven position can                             only change by a maximum of 1 count per period.                             Since the maximum range of driven position is                              expressed as a 1 byte value (0 to 255), the time                             it would take to pan from one stop to the other                             is [20ms x 256], which is just over 5 seconds. A                             setting value of 2 would halve that time. If you                             want to get meaningful Pan position data from the                             IR sensor triggered detections, this setting                             should be low enough to ensure that the loaded                             servos can keep up with driven positions.                              Another advantage of driving the servos in this                             way is that the smoother motion will put less                             stress on the servos' gears and bearings,                             prolonging their life. If you're not interested in                             the IR sensor data and you just want the servos to                             move to a new setpoint position as fast as                              possible, use 255 as the value for this setting.                             This configuration setting is stored in                              nonvolatile EEPROM.                     Write Byte Data, Command = 103 : Set the "IR Sensor Neutral Value" setting                                 (one data byte). This configuration setting                                 is stored in nonvolatile EEPROM.Write Byte Data, Command = 104 : Set the "IR Sensor Trigger Threshold" setting                                 (one data byte). This configuration setting                                 is stored in nonvolatile EEPROM.Send Byte, Command = 105       : Reset the IR triggered event (no data bytes).Write Byte Data, Command = 106 : Set the "IR Triggered Event Mode" setting                                 (one data byte). 1 = First Event (stop storing                                 events after the first one is triggered),                                  2 = Last Event (overwrite the stored event                                 each time one is detected, so that the most                                 recent event is always the one that's stored),                                 and 3 = Maximum Event (only overwrite the                                  stored event if an event is detected with a                                  bigger detection spike than the stored event).                                 0 = IR sensing completely disabled. This                                 configuration setting is stored in nonvolatile                                 EEPROM.Send Byte, Command = 107       : Reset the 8-bit timer counter (no data bytes).Send Byte, Command = 108       : Activate PWM Output. Also enables the free                                 running timer counter and infrared sensing.Send Byte, Command = 109       : Disable PWM Output. In this low power mode,                                  the free running timer counter and the                                  infrared sensing are also disabled. This is                                  the initial default mode of the module.PEC (Packet Error Checking) is disabled for all SMBus commands.FIRMWARE NOTES--------------The software for the PICMicro is written in assembly language, and compiles using the GNU PIC Assembler, gpasm. To compile the source code into a hex file suitable for programming a PIC16F819 device, type    gpasm -n head_control_module.asmThe resulting hex file will be called head_control_module.hex  The -n option puts DOS-style CR-LF newline sequences in the .hex file, required by most device programmers. It also compiles with the MPASM compiler for Microsoft Windows that is a partof the MPLAB suite from Microchip. However, you must make sure the assembly(.asm) file is in Windows/DOS format (i.e. with CR-LF sequences at the end ofeach line) before it will successfully compile in MPASM for Windows.Some device programmers require the configuration bits to be set manually. Itis very important that these are set correctly. The Head Control Modulerequires the following configuration bit settings: - Flash Code Protection off - CCP1 on RB3 - In-circuit Debugger disabled - Flash write enable off - EE Code Protection off - Low Voltage Programming Enable off, RB3 is I/O - Brown-out Reset Enable on - RA5/MCLR pin function is digital I/O - Power-Up Timer on - Watchdog Timer off - Oscillator: INTRC, port I/O function of RA6 and RA7The above configuration settings are represented by the configuration word2F50 in hexadecimal.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -