Python Forum
mapping joystick axis to specific 'channels' in python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
mapping joystick axis to specific 'channels' in python
#2
Ok, so I now made it like this, mapping channels to joystick axis with a dictionary:

sbusChannel_to_JoystickAxis = {
    0: 3,
    1: 5,
    8: 2,
}

for sbusChannel, joystickaxis in sbusChannel_to_JoystickAxis.items():
    
    rawValue = get_axis[joystickaxis]
    mapped_value = map(rawValue,-1,1,192,1792)

    sbusOutput.set_channel(sbusChannel, int(mapped_value))
Is this the proper way and best way to do it? Or is there a better way?
Reply


Messages In This Thread
RE: mapping joystick axis to specific 'channels' in python - by DashOrion - Jul-07-2020, 04:26 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Joystick-controller in threadings MacTommy 4 1,191 Dec-06-2024, 07:22 AM
Last Post: MacTommy
  trying to change channels with python greggk1 6 1,477 Sep-18-2024, 02:07 AM
Last Post: greggk1
  Adding MIDI Channels to each Input zach1234 6 2,419 Apr-20-2023, 11:51 AM
Last Post: jefsummers
  Mapping a value to an interval JazonKuer 12 4,645 Mar-17-2023, 07:59 PM
Last Post: Gribouillis
  access is denied error 5 for network drive mapping ? ahmedbarbary 2 2,765 Aug-17-2022, 10:09 PM
Last Post: ahmedbarbary
  Sample labels from excel file in order to put them on x-axis and y-axis of a plot hobbyist 11 6,712 Sep-14-2021, 08:29 AM
Last Post: hobbyist
  Pygame with joystick mmagner2022 1 2,301 Aug-06-2021, 07:56 PM
Last Post: SheeppOSU
  Mapping a range ebolisa 5 5,825 Jun-12-2021, 11:17 PM
Last Post: ebolisa
Information Unable to display joystick's value from Python onto display box MelfoyGray 2 2,982 Nov-11-2020, 02:23 AM
Last Post: MelfoyGray
  Difference Between Figure Axis and Sub Plot Axis in MatplotLib JoeDainton123 2 3,377 Aug-21-2020, 10:17 PM
Last Post: JoeDainton123

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020