Robotics Technologies microBus-Cam II Uživatelský manuál Strana 19

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 23
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 18
Development of Mobile Robot Based on I
2
C Bus System
211
Step 3 : I2C_ACK ( ),
Step 4 : I2C_SEND ( )Enable analog output, single mode and analog channel
selection,
Step 5 : I2C_ACK ( ),
Step 6 : I2C_STOP ( ),
Step 7 : I2C_START ( ),
Step 8 : I2C_SEND ( ) – Read mode; start to read data from analog input of
selected channel,
Step 9 : I2C_ACK ( ),
Step 10 : I2C_RECEIVE ( ),
Step 11 : I2C_ACK ( ),
Step 12 : I2C_STOP ( ).
5.3.4 Function ordering for temperature reading
To read temperature, it must be programmed in 3 steps; start to convert data, stop to convert
data and read data.
Start to convert data:
Step 1 : I2C_START ( ),
Step 2 : I2C_SEND ( ) – Call slave device address from robot and write mode
configuration,
Step 3 : I2C_ACK ( ),
Step 4 : I2C_SEND ( ) – Send command register, start to convert data,
Step 5 : I2C_ACK ( ),
Step 6 : I2C_STOP ( ),
Stop to convert data:
Step 1 : I2C_START ( ),
Step 2 : I2C_SEND ( ) – Call slave device address from robot and write mode
configuration,
Step 3 : I2C_ACK ( ),
Step 4 : I2C_SEND ( ) – Send command register, stop to convert data,
Step 5 : I2C_ACK ( ),
Step 6 : I2C_STOP ( ),
Read data:
Step 1 : I2C_START ( ),
Step 2 : I2C_SEND ( ) – Call slave device address from robot and write mode
configuration,
Step 3 : I2C_ACK ( ),
Step 4 : I2C_SEND ( ) – Send command register, stop to convert data,
Step 5 : I2C_ACK ( ),
Step 6 : I2C_START ( ),
Step 7 : I2C_SEND ( ) – Send command register, stop to convert data,
Step 8 : I2C_ACK ( ),
Step 9 : I2C_RECEIVE ( ) – Read MSB of temperature register,
www.intechopen.com
Zobrazit stránku 18
1 2 ... 14 15 16 17 18 19 20 21 22 23

Komentáře k této Příručce

Žádné komentáře