-
Arduino Pro Micro HID Code for Toggle Switches
04/27/2018 at 10:04 • 0 commentsUse this code to connect a Toggle Flip Switch to an Arduin Pro Micro or Leonardo.
The pin to connect is Digital PIN 8 and GND
ON will output "a"
OFF will output "b"
Change if you like!#include <Keyboard.h> const byte switchPin = 8; byte oldSwitchState = HIGH; // assume switch open because of pull-up resistor const unsigned long debounceTime = 10; // milliseconds void setup () { Serial.begin (9600); pinMode (8, INPUT_PULLUP); } // end of setup void loop () { Keyboard.begin(); // see if switch is open or closed byte switchState = digitalRead (switchPin); // has it changed since last time? if (switchState != oldSwitchState) { oldSwitchState = switchState; // remember for next time delay (debounceTime); // debounce if (switchState == LOW) { Serial.println ("Switch closed."); Keyboard.press('a'); delay(100); Keyboard.releaseAll(); } // end if switchState is LOW else { Serial.println ("Switch opened."); Keyboard.press('b'); delay(100); Keyboard.releaseAll(); } // end if switchState is HIGH } // end of state change // other code here ... } // end of loop
-
Scania 4-Series Opticruise for ETS
03/25/2018 at 19:48 • 0 commentsHi folks!
Today I show you my Scania 4-Series Opticruise working in ETS2. In fact, it will work on any Simulator due to the use of an Arduino Leonardo which Windows will recognize as a HID device (keyboard). I programmed Shift up to "Right Shift" and shift down to "Right CTRL" which are the ETS2 default keys for shifting gear!
Have fun!
Arduino Leonardo Code:
#include "Keyboard.h" #define SHIFTUP_PIN 2 #define SHIFTDOWN_PIN 3 // Works on the Leonardo board // Build by Jeroen van der Velden // https://hackaday.io/project/8448-real-scania-truck-home-simulator static void ShiftUp(void) { Keyboard.press(KEY_RIGHT_SHIFT); } static void ShiftDown(void) { Keyboard.press(KEY_RIGHT_CTRL); } void setup(void) { Keyboard.begin(); // Set pin to input pinMode(SHIFTUP_PIN, INPUT); // Enable pullup resistor digitalWrite(SHIFTUP_PIN, HIGH); // Set pin to input pinMode(SHIFTDOWN_PIN, INPUT); // Enable pullup resistor digitalWrite(SHIFTDOWN_PIN, HIGH); } void loop(void) { static uint8_t shiftUpStateLast = 0; static uint8_t shiftDownStateLast = 0; uint8_t shiftState; shiftState = digitalRead(SHIFTUP_PIN); if (shiftState != shiftUpStateLast) { shiftUpStateLast = shiftState; if (shiftState == 0) { ShiftUp(); delay(100); Keyboard.releaseAll(); } } shiftState = digitalRead(SHIFTDOWN_PIN); if (shiftState != shiftDownStateLast) { shiftDownStateLast = shiftState; if (shiftState == 0) { ShiftDown(); delay(100); Keyboard.releaseAll(); } } delay(50); }
-
Scania 4-series cockpit cluster part 4
04/13/2017 at 20:46 • 0 commentsMy very first test with our new PCB for original 4-Series Clusters.
This film shows how the board below works:
Below is the final result of the PCB on top of the Nucleo. If you are interested in the PCB, please contact me. I do have some spare boards.
Credits for Arcannae who developed the Nucleo integration and code. Check his YouTube for more info:
-
Scania 4-Series Cockpit Cluster Part 3
03/13/2017 at 18:40 • 0 commentsMany thanks to HEX173 ("Ad") who has send me new PCB`s for our Scania Cockpit Cluster.
I`m struggling very hard to get all the components required to complete our board. I also struggle mastering the required Soldering Skills.
Here`s a picture of the progress:
End Result:
-
Scania 4-Series Cockpit Cluster Part 2
02/08/2017 at 19:57 • 0 commentsHi all,
We got the Gerber files for our PCB and a first sample has been made:
We are going to use a "Nucleo F446RE" board along with this print to get our cluster up and running.
Keep following!
-
Scania 4-Series Cockpit Cluster
11/04/2016 at 19:00 • 1 commentWe have a Cluster! Keep following!!
-
Steer Part 2 continued
10/01/2016 at 18:03 • 0 comments -
Steer Part 2
09/03/2016 at 18:55 • 0 commentsHi folks!
Now Mr. Blom has made some beautiful pieces for our Scania Steering Wheel we have started working on the Steering Again.If you have read my old Steer Part 1 you have noticed that we started all over. We warn`t satisfied with our results so I have spoken to our new sponsor and he made me a disc that fits over our Logitech Drivingforce Pro wheel.
This is the result:
The Steering Shaft in the picture is a BMW Steering Shaft, very lightweight and cheap on Ebay and perfect for our simulator. The disc is quite heavy weight but its perfectly tune-able for our sim and if it causes trouble we will cut some slices pizza out of it.
Mr. Blom is now working on the top part of the steering shaft and a bracket to hold it all into place. Keep following for more updates!
-
New Sponsor !!
09/03/2016 at 18:44 • 0 commentsHi folks,
After a long summer-stop we are back in business and this time we are proud to announce our new sponsor "Blom Eethen". Mr. Blom is helping us with some of the metal parts required to get the steering wheel connected to our USB Racing Wheel. Mr. Blom is very skilled and he has over 45 years of experience and just about all the right tools for any kind of metalwork job !!
If you need some "Custom" metal work for you DIY simulator, he`s the person you should talk to!
Mr. Blom Eethen and his tool shop (pictures and video below):
Feel free to have a look at his website for more information: http://www.blomeethen.nl/
-
Pedals Connected!
06/19/2016 at 13:41 • 0 commentsProgress with our Pedals!