[Tuto] Use a Toggle...
 
Notifications
Clear all

[Tuto] Use a Toggle switch as Temporary button

19 Posts
7 Users
3 Reactions
5,336 Views
 sgeg
(@sgeg)
Trusted Member
Joined: 4 years ago
Posts: 54
Topic starter  

@nocloo

happy that it’s helped you… 

enjoy


   
nocloo reacted
ReplyQuote
(@rvaupel23)
New Member
Joined: 2 weeks ago
Posts: 4
 

@sgeg I followed your instructions from the top of this thread and upon compiling I am getting this error:

#error The Joystick library can only be used with a USB MCU (e.g. Arduino Leonardo, Arduino Micro, etc.).

exit status 1
Error compiling for board Arduino/Genuino Uno.

For what it's worth I'm working with a Leonardo.  Single toggle switch on pin 5. 


   
ReplyQuote
 sgeg
(@sgeg)
Trusted Member
Joined: 4 years ago
Posts: 54
Topic starter  

hi @rvaupel23

you're problem looks more about compiling issue, if you use more than one Arduino be sure that you select the right Serial port and board when you are compiling your Leonardo with Simhub Sketch setup.

if you are not sure unplug all other arduino connected.

https://github.com/SHWotever/SimHub/wiki/Arduino--Setup

FYI: don't select your button in the sketch setup to avoid error

 

This post was modified 2 weeks ago by sgeg

   
ReplyQuote
(@rvaupel23)
New Member
Joined: 2 weeks ago
Posts: 4
 

@sgeg I was actually able to solve this a different (and easy) way for iRacing using basic SimHub functionality.  

  • I'm using a single Arduino Leonardo with a basic toggle switch configured using the SimHub hardware configurator / setup tool for Arduino (as a button)
  • In iRacing, under Controls, I mapped the key "I" to ignition
  • In SimHub, navigated to Controls and Events.
  • Hit add mapping
  • Used short press for "on" and simulate the key ("I") as referenced in the game
  • Used released for "off" and simulate the key ("I") again as referenced in the game

Works perfectly for me. 


   
ReplyQuote
Page 2 / 2
Share: