WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 07-07-2003, 10:29 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

To get data from the serial port within your script you will want to create a Sensor Plug-in. You will need to program in C/C++. If you are interested in this we can give you the appropriate header files and an example.

Vizard supports joysticks through a library called sid. You would probably want to create a timer that checks the current state of the joystick and updates the view. Here's is some sample code for using the joystick.

Code:
import sid
.
.
.

def mytimer(num):

    buttons = sid.buttons()
    if buttons & 1:
        print 'Button 1 is down'
    if buttons & 2:
        print 'Button 2 is down'
    if buttons & 4:
        print 'Button 3 is down'
    

    data = sid.get()
    print 'X axis of joystick at', data[0]
    print 'Y axis of joystick at', data[1]

    slider = sid.slider()
    print 'Joystick slider at', slider
If you have any more questions I'll be happy to help you.
Reply With Quote
 

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 11:55 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC