I have added the values for x, y, z, and r to device strings in Justins excellent GamePort+ Plugin.
He released the source, so I felt at liberty to do this.
This will give the users the ability to script against the values for things like, feedback from cam rotators from a potentiometer, temperature values from a thermister, fluid levels from a float and potentiometer, or any analog input that you desire.
The plugin will create 4 more devices in the housecode that is already assigned to the plugin. Total is 8.
You may need to delete and recreate the devices in the setup dialog for the plugin.
X value is device 5
Y value is device 6
Z value is device 7
R value is device 8
There are settings for Button and Axis Polling Intervals.
There are settings for Dividing each Axis Value Independently.
All settings are kept in an Ini file in the HomeSeer config Folder.
Please note: The GamePort needs to be "wired" for two joysticks to utilize all four axis.
You can retrieve the axis values directly in scripts with this code example:
###########################
sub main()
dim xvalue
dim yvalue
dim zvalue
dim rvalue
xvalue = hs.Plugin ("Gameport Interface+").Xval
hs.writelog "GamePort", xvalue
yvalue = hs.Plugin ("Gameport Interface+").Yval
hs.writelog "GamePort", yvalue
zvalue = hs.Plugin ("Gameport Interface+").Zval
hs.writelog "GamePort", zvalue
rvalue = hs.Plugin ("Gameport Interface+").Rval
hs.writelog "GamePort", rvalue
end sub
###########################
This is the final release on my part, unless someone finds a bug...........JG
Updated to improve performance and now includes a second plugin for a second GamePort.......JG
[This message was edited by Jebus on Sat, 28 June 2003 at 10:08 AM.]
He released the source, so I felt at liberty to do this.
This will give the users the ability to script against the values for things like, feedback from cam rotators from a potentiometer, temperature values from a thermister, fluid levels from a float and potentiometer, or any analog input that you desire.
The plugin will create 4 more devices in the housecode that is already assigned to the plugin. Total is 8.
You may need to delete and recreate the devices in the setup dialog for the plugin.
X value is device 5
Y value is device 6
Z value is device 7
R value is device 8
There are settings for Button and Axis Polling Intervals.
There are settings for Dividing each Axis Value Independently.
All settings are kept in an Ini file in the HomeSeer config Folder.
Please note: The GamePort needs to be "wired" for two joysticks to utilize all four axis.
You can retrieve the axis values directly in scripts with this code example:
###########################
sub main()
dim xvalue
dim yvalue
dim zvalue
dim rvalue
xvalue = hs.Plugin ("Gameport Interface+").Xval
hs.writelog "GamePort", xvalue
yvalue = hs.Plugin ("Gameport Interface+").Yval
hs.writelog "GamePort", yvalue
zvalue = hs.Plugin ("Gameport Interface+").Zval
hs.writelog "GamePort", zvalue
rvalue = hs.Plugin ("Gameport Interface+").Rval
hs.writelog "GamePort", rvalue
end sub
###########################
This is the final release on my part, unless someone finds a bug...........JG
Updated to improve performance and now includes a second plugin for a second GamePort.......JG
[This message was edited by Jebus on Sat, 28 June 2003 at 10:08 AM.]