loading
 
about the I2C bus on the serializer board
fred miller from United States  [3 posts]
13 year
Steven what variables are they on the I2C bus to read from
mostly TPA81 and how do i write them
fred miller from United States  [72 posts] 13 year
Steven have any ideas on this
and the TPA81  variables and the list of TPA81 api commands
Anonymous 13 year
Fred,

RR just supports the generic i2c command to the serializer that is a simple pass through command. RoboticsConnection would know more about connecting the serializer to the TPA81 ... or perhaps even the vendors of the TPA81 could give you some insight as to what commands they send out on the i2c bus.

STeven.
fred miller from United States  [72 posts] 13 year
ok thanks STEVEN
will look into it,looking at building it this week
fred miller from United States  [72 posts] 13 year
Steven on using the I2C bus
SetVariable "my_command", "i2c r 4 1"

in a VBScript module to query the line following sensor
what does r 4 1 meen in your example
Anonymous 13 year
Have a look at page 33 Example 5 in

http://www.roboticsconnection.com/multimedia/docs/Serializer_3.0_UserGuide.pdf

to query a TPA81

Note that RR just passes the text right though so the format/meaning of each of the numbers is entirely based on the device you are querying.

STeven.
fred miller from United States  [72 posts] 13 year
thanks alot Steven,i didnt see that
fred miller from United States  [72 posts] 13 year
STEVEN next question on using TPA81 it there a module that can take the 8 reading and then average them and compare to ambient temperature and get a difference ,also before i take the reading i need to convert celsius to fahrenheit
is there a way it can be done or any ideas
Anonymous 13 year
Have a look at the Filter Variables

http://www.roborealm.com/help/Filter_Variables.php

and select the variable that contains the value and the memory size (past values) to 8 and the method to mean.

Then use a VBScript module with the following code assuming your variable is called "temperature". Note the VBScript module should be AFTER the filter variable.


' get your temperature reading (already averaged)
temp = GetVariable("temperature")

' determine difference from this and past value
diff = temp - GetVariable("last_temperature")

' convert to fahrenheit
diff = ((diff / 5 ) * 9 ) + 32

' save
SetVariable "temperature_difference", diff

' update value for next iteration
SetVariable "last_temperature", temp
fred miller from United States  [72 posts] 13 year
thanks a whole lot Steven,like always you are greatest at finding solutions

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index