DIY G25 shifter interface with H-pattern, sequential and handbrake modes
20 20

211 posts in this topic

2 hours ago, Regis Souza said:

Sorry Pascalh for missing that. Thx for the reply, I will try to replicate your project ASAP and will post the results!

Hey Stealthblackbird, please post your final code whenever it's read for the driving force shifter's owners! It would help me a lot to have the code ready when I get mine shifter, and will certainly help people who already have one! Thx!

Here you go! Have fun! It works fine, but there is that simultaneous button press issue when you push down, but it shouldn't be a problem. I will update when pascalh let's me know! :D

G27_shifter_en1.zip

Share this post


Link to post
Share on other sites
6 hours ago, pascalh said:

Could you please elaborate on how you did to read the EEPROM?

I attached some Arduino sketches to read & program shifter eeprom. Be careful with WRITE_VERIFY sketch, it will overwrite your eeprom data! Also there is a datasheet for EEPROM and live traffic between wheel base and shifter (yeah, I sniffed SPI data during wheel auto calibration). 

Please post here your eeprom contents. I will try to figure out if there are calibration values in it. Logitech wheel base has 8-bit ADC, so all values must be simple bytes...

G27_EEPROM_READ.ino

G27_EEPROM_WRITE_VERIFY.ino

m95010.pdf

calibration-eeprom.txt

Share this post


Link to post
Share on other sites
On 11/08/2016 at 7:42 AM, RomanST77 said:

I attached some Arduino sketches to read & program shifter eeprom. Be careful with WRITE_VERIFY sketch, it will overwrite your eeprom data! Also there is a datasheet for EEPROM and live traffic between wheel base and shifter (yeah, I sniffed SPI data during wheel auto calibration). 

Please post here your eeprom contents. I will try to figure out if there are calibration values in it. Logitech wheel base has 8-bit ADC, so all values must be simple bytes...

G27_EEPROM_READ.ino

G27_EEPROM_WRITE_VERIFY.ino

m95010.pdf

calibration-eeprom.txt

Thanks ;)

Will check as soon as I'm back home from holidays. Is there any specific wiring required?

Share this post


Link to post
Share on other sites
On 22.04.2014 at 3:41 PM, pascalh said:

Chapter 2: Wiring and canning

SUBD9 connector pinout (G25 shifter point of view):

     pin 1: Power supply    Vcc
     pin 2: Output          Data 
     pin 3: Input           Parallel/serial
     pin 4: Output          X axis
     pin 5: Not connected
     pin 6: Power supply    GND
     pin 7: Input           Clock
     pin 8: Output          Y axis
     pin 9: Not connected

 

Share this post


Link to post
Share on other sites

Guys, I need scatch for arduino to make it to add 2 buttons or switch with 3 positions and to make them USB compatible. I just want to connect my SQ shifter to USB.

 

Any ideas?

Share this post


Link to post
Share on other sites

Also the shifter schematics on the fist page of this thread needs to be fixed. Shift registers are 74HC165D, not HCF4021. They works pretty much the same way, difference is in nCS level, for 74HC165D active level high, for HCF4021 active level low.

All 74HC165D inputs must have pull down resistors, overwise all buttons will be always '1'. 

Share this post


Link to post
Share on other sites

Hello pascalh,

 

first of all, thanks for this nice tutorial. Inspired by your "hardwarehack", I bought a Driving Force Shifter. With a Teensy++2.0 Board it works and the board is small enough, to fits into the Shiftercase without modification

Now there is a little problem. When I switch to reverse, button 7 is pressed by moving the stick down, and button 8 is activated to, when I shift to the gear 6 postion. If I assign the reversegear in Dirt Rally, it assign the button 7, because it is activate in the first. Is it possible to mask the button 7 in the windows properties for gamecontroller, so that only button 8 is detected?

The second issue is, that when I pulldown the stick and button 7 is pressed the buttons 9 to 32 flickering randomly and where detected by games. It is also possible to mask this buttons.

 

Thanks in advanced, Chris

 

sorry for my english, I'm from germany, so is anything unclear feel free to ask.

 

Edited by fishware

Share this post


Link to post
Share on other sites

btw I'm planning to start selling stm32 based adapters for logitech pedals and shifters real soon. It will have open source firmware and open hardware design documents. the price will be similar to teensy boards but you don't have to solder anything to it.

If anybody plans to fork the design and making it yourself - it's okay for me.

adapter.png

Share this post


Link to post
Share on other sites
20 hours ago, fishware said:

Hello pascalh,

 

first of all, thanks for this nice tutorial. Inspired by your "hardwarehack", I bought a Driving Force Shifter. With a Teensy++2.0 Board it works and the board is small enough, to fits into the Shiftercase without modification

Now there is a little problem. When I switch to reverse, button 7 is pressed by moving the stick down, and button 8 is activated to, when I shift to the gear 6 postion. If I assign the reversegear in Dirt Rally, it assign the button 7, because it is activate in the first. Is it possible to mask the button 7 in the windows properties for gamecontroller, so that only button 8 is detected?

The second issue is, that when I pulldown the stick and button 7 is pressed the buttons 9 to 32 flickering randomly and where detected by games. It is also possible to mask this buttons.

 

Thanks in advanced, Chris

 

sorry for my english, I'm from germany, so is anything unclear feel free to ask.

 

You are right: unwanted buttons need to be masked with a AND logical operator. I will upload a modified version of the code this evening.

Share this post


Link to post
Share on other sites

I fixed it by myself

//
//  G27 shifter to USB interface
//  based on a Teensy++ 2.0
//  Original by pascalh from insidesimracing.tv
//  http://insidesimracing.tv/forums/topic/13189-diy-g25-shifter-interface-with-h-pattern-sequential-and-handbrake-modes/


//  1 operating mode
//  - H-pattern shifter
//
//
//  G27 shifter pinout
//
//  DB9  Color    Shifter Description       Teensy
//  1    Purple    1      Button Clock      pin 2
//  2    Grey     7       Button Data       pin 3
//  3    Yellow   5       Button !CS & !PL  pin 4
//  4    Orange   3       Shifter X axis    pin 38 (A0)
//  5    White      2       SPI input 
//  6    Black    8       GND               GND
//  7    Red   6       +5V               VCC
//  8    Green    4       Shifter Y axis    pin 39 (A1)
//  9    Red    1       +5V

// Teensy pin definitions
#define LED_PIN            11
#define DATA_IN_PIN        44
#define MODE_PIN           43
#define CLOCK_PIN          42
#define X_AXIS_PIN         39
#define Y_AXIS_PIN         38

// H-shifter mode analog axis thresholds
#define HS_XAXIS_12        400 //Gears 1,2
#define HS_XAXIS_56        600 //Gears 5,6, R
#define HS_YAXIS_135       750 //Gears 1,3,5
#define HS_YAXIS_246       300 //Gears 2,4,6, R

// Digital inputs definitions
#define DI_REVERSE         1


byte NESButtonData;
// Called at startup
// Must initialize hardware and software modules
void setup()
{
  // G27 shifter analog inputs configuration 
  pinMode(X_AXIS_PIN, INPUT_PULLUP);   // X axis
  pinMode(Y_AXIS_PIN, INPUT_PULLUP);   // Y axis
  
  // G27 shift register interface configuration 
  pinMode(DATA_IN_PIN, INPUT);         // Data in
  pinMode(MODE_PIN, OUTPUT);           // Parallel/serial mode
  pinMode(CLOCK_PIN, OUTPUT);          // Clock
  
  // Virtual joystick configuration 
  Joystick.useManualSend(true);        // Joystick output is synchronized
}

// Called in a loop after initialization
void loop() 
{
  // Reading of button states from G27 shift register
  int b[2];
  digitalWrite(MODE_PIN, LOW);         // Switch to parallel mode: digital inputs are read into shift register
  delayMicroseconds(10);               // Wait for signal to settle
  digitalWrite(MODE_PIN, HIGH);        // Switch to serial mode: one data bit is output on each clock falling edge
  
  for(int i=0; i<2; i++)              // Reading registers
  {
    digitalWrite(CLOCK_PIN, LOW);      // Generate clock falling edge
    delayMicroseconds(10);             // Wait for signal to settle
  
    b[i]=digitalRead(DATA_IN_PIN);     // Read data bit and store it into bit array
    
    digitalWrite(CLOCK_PIN, HIGH);     // Generate clock rising edge
    delayMicroseconds(10);             // Wait for signal to settle
  }
  
  // Reading of shifter position
  int x=analogRead(0);                 // X axis
  int y=analogRead(1);                 // Y axis
  
  // Current gear calculation
  int gear=0;                          // Default value is neutral

    if(x<HS_XAXIS_12)                  // Shifter on the left?
    {
      if(y>HS_YAXIS_135) gear=1;       // 1st gear
      if(y<HS_YAXIS_246) gear=2;       // 2nd gear
    }
    else if(x>HS_XAXIS_56)             // Shifter on the right?
    {
      if(y>HS_YAXIS_135) gear=5;       // 5th gear
      if(y<HS_YAXIS_246) gear=6;       // 6th gear
    }
    else                               // Shifter is in the middle
    {
      if(y>HS_YAXIS_135) gear=3;       // 3rd gear
      if(y<HS_YAXIS_246) gear=4;       // 4th gear
    }
  
  if(gear!=6) b[DI_REVERSE]=0;         // Reverse gear is allowed only on 6th gear position
  if(b[DI_REVERSE]==1) gear=0;         // 6th gear is deactivated if reverse gear is engaged
  
  // Release virtual buttons for all gears
  Joystick.button(1, LOW);
  Joystick.button(2, LOW);
  Joystick.button(3, LOW);
  Joystick.button(4, LOW);
  Joystick.button(5, LOW);
  Joystick.button(6, LOW);
  Joystick.button(7, b[DI_REVERSE]);
  // Depress virtual button for current gear
  if(gear>0) Joystick.button(gear, HIGH);
    
  // Write new virtual joystick state
  Joystick.send_now();

  // Write inputs and outputs (remove comments to debug)
 /*
  Serial.print(" X axis: ");
  Serial.print(x);
  Serial.print(" Y axis: ");
  Serial.print(y);
  Serial.print(" Digital inputs: ");
  for(int i=0; i<2; i++)Serial.print(b[i]);
  Serial.print(" ");
  Serial.print(" Gear: ");
  Serial.print(gear);
  */ 
  
  delay(10);                                // Wait for 10ms
}

Kind regards Chris

Edited by fishware

Share this post


Link to post
Share on other sites
9 hours ago, fishware said:

I fixed it by myself

//
//  G27 shifter to USB interface
//  based on a Teensy++ 2.0
//  Original by pascalh from insidesimracing.tv
//  http://insidesimracing.tv/forums/topic/13189-diy-g25-shifter-interface-with-h-pattern-sequential-and-handbrake-modes/


//  1 operating mode
//  - H-pattern shifter
//
//
//  G27 shifter pinout
//
//  DB9  Color    Shifter Description       Teensy
//  1    Purple    1      Button Clock      pin 2
//  2    Grey     7       Button Data       pin 3
//  3    Yellow   5       Button !CS & !PL  pin 4
//  4    Orange   3       Shifter X axis    pin 38 (A0)
//  5    White      2       SPI input 
//  6    Black    8       GND               GND
//  7    Red   6       +5V               VCC
//  8    Green    4       Shifter Y axis    pin 39 (A1)
//  9    Red    1       +5V

// Teensy pin definitions
#define LED_PIN            11
#define DATA_IN_PIN        44
#define MODE_PIN           43
#define CLOCK_PIN          42
#define X_AXIS_PIN         39
#define Y_AXIS_PIN         38

// H-shifter mode analog axis thresholds
#define HS_XAXIS_12        400 //Gears 1,2
#define HS_XAXIS_56        600 //Gears 5,6, R
#define HS_YAXIS_135       750 //Gears 1,3,5
#define HS_YAXIS_246       300 //Gears 2,4,6, R

// Digital inputs definitions
#define DI_REVERSE         1


byte NESButtonData;
// Called at startup
// Must initialize hardware and software modules
void setup()
{
  // G27 shifter analog inputs configuration 
  pinMode(X_AXIS_PIN, INPUT_PULLUP);   // X axis
  pinMode(Y_AXIS_PIN, INPUT_PULLUP);   // Y axis
  
  // G27 shift register interface configuration 
  pinMode(DATA_IN_PIN, INPUT);         // Data in
  pinMode(MODE_PIN, OUTPUT);           // Parallel/serial mode
  pinMode(CLOCK_PIN, OUTPUT);          // Clock
  
  // Virtual joystick configuration 
  Joystick.useManualSend(true);        // Joystick output is synchronized
}

// Called in a loop after initialization
void loop() 
{
  // Reading of button states from G27 shift register
  int b[2];
  digitalWrite(MODE_PIN, LOW);         // Switch to parallel mode: digital inputs are read into shift register
  delayMicroseconds(10);               // Wait for signal to settle
  digitalWrite(MODE_PIN, HIGH);        // Switch to serial mode: one data bit is output on each clock falling edge
  
  for(int i=0; i<2; i++)              // Reading registers
  {
    digitalWrite(CLOCK_PIN, LOW);      // Generate clock falling edge
    delayMicroseconds(10);             // Wait for signal to settle
  
    b[i]=digitalRead(DATA_IN_PIN);     // Read data bit and store it into bit array
    
    digitalWrite(CLOCK_PIN, HIGH);     // Generate clock rising edge
    delayMicroseconds(10);             // Wait for signal to settle
  }
  
  // Reading of shifter position
  int x=analogRead(0);                 // X axis
  int y=analogRead(1);                 // Y axis
  
  // Current gear calculation
  int gear=0;                          // Default value is neutral

    if(x<HS_XAXIS_12)                  // Shifter on the left?
    {
      if(y>HS_YAXIS_135) gear=1;       // 1st gear
      if(y<HS_YAXIS_246) gear=2;       // 2nd gear
    }
    else if(x>HS_XAXIS_56)             // Shifter on the right?
    {
      if(y>HS_YAXIS_135) gear=5;       // 5th gear
      if(y<HS_YAXIS_246) gear=6;       // 6th gear
    }
    else                               // Shifter is in the middle
    {
      if(y>HS_YAXIS_135) gear=3;       // 3rd gear
      if(y<HS_YAXIS_246) gear=4;       // 4th gear
    }
  
  if(gear!=6) b[DI_REVERSE]=0;         // Reverse gear is allowed only on 6th gear position
  if(b[DI_REVERSE]==1) gear=0;         // 6th gear is deactivated if reverse gear is engaged
  
  // Release virtual buttons for all gears
  Joystick.button(1, LOW);
  Joystick.button(2, LOW);
  Joystick.button(3, LOW);
  Joystick.button(4, LOW);
  Joystick.button(5, LOW);
  Joystick.button(6, LOW);
  Joystick.button(7, b[DI_REVERSE]);
  // Depress virtual button for current gear
  if(gear>0) Joystick.button(gear, HIGH);
    
  // Write new virtual joystick state
  Joystick.send_now();

  // Write inputs and outputs (remove comments to debug)
 /*
  Serial.print(" X axis: ");
  Serial.print(x);
  Serial.print(" Y axis: ");
  Serial.print(y);
  Serial.print(" Digital inputs: ");
  for(int i=0; i<2; i++)Serial.print(b[i]);
  Serial.print(" ");
  Serial.print(" Gear: ");
  Serial.print(gear);
  */ 
  
  delay(10);                                // Wait for 10ms
}

Kind regards Chris

:)

Share this post


Link to post
Share on other sites
On 8/20/2016 at 5:10 PM, fishware said:

I fixed it by myself

//
//  G27 shifter to USB interface
//  based on a Teensy++ 2.0
//  Original by pascalh from insidesimracing.tv
//  http://insidesimracing.tv/forums/topic/13189-diy-g25-shifter-interface-with-h-pattern-sequential-and-handbrake-modes/


//  1 operating mode
//  - H-pattern shifter
//
//
//  G27 shifter pinout
//
//  DB9  Color    Shifter Description       Teensy
//  1    Purple    1      Button Clock      pin 2
//  2    Grey     7       Button Data       pin 3
//  3    Yellow   5       Button !CS & !PL  pin 4
//  4    Orange   3       Shifter X axis    pin 38 (A0)
//  5    White      2       SPI input 
//  6    Black    8       GND               GND
//  7    Red   6       +5V               VCC
//  8    Green    4       Shifter Y axis    pin 39 (A1)
//  9    Red    1       +5V

// Teensy pin definitions
#define LED_PIN            11
#define DATA_IN_PIN        44
#define MODE_PIN           43
#define CLOCK_PIN          42
#define X_AXIS_PIN         39
#define Y_AXIS_PIN         38

// H-shifter mode analog axis thresholds
#define HS_XAXIS_12        400 //Gears 1,2
#define HS_XAXIS_56        600 //Gears 5,6, R
#define HS_YAXIS_135       750 //Gears 1,3,5
#define HS_YAXIS_246       300 //Gears 2,4,6, R

// Digital inputs definitions
#define DI_REVERSE         1


byte NESButtonData;
// Called at startup
// Must initialize hardware and software modules
void setup()
{
  // G27 shifter analog inputs configuration 
  pinMode(X_AXIS_PIN, INPUT_PULLUP);   // X axis
  pinMode(Y_AXIS_PIN, INPUT_PULLUP);   // Y axis
  
  // G27 shift register interface configuration 
  pinMode(DATA_IN_PIN, INPUT);         // Data in
  pinMode(MODE_PIN, OUTPUT);           // Parallel/serial mode
  pinMode(CLOCK_PIN, OUTPUT);          // Clock
  
  // Virtual joystick configuration 
  Joystick.useManualSend(true);        // Joystick output is synchronized
}

// Called in a loop after initialization
void loop() 
{
  // Reading of button states from G27 shift register
  int b[2];
  digitalWrite(MODE_PIN, LOW);         // Switch to parallel mode: digital inputs are read into shift register
  delayMicroseconds(10);               // Wait for signal to settle
  digitalWrite(MODE_PIN, HIGH);        // Switch to serial mode: one data bit is output on each clock falling edge
  
  for(int i=0; i<2; i++)              // Reading registers
  {
    digitalWrite(CLOCK_PIN, LOW);      // Generate clock falling edge
    delayMicroseconds(10);             // Wait for signal to settle
  
    b[i]=digitalRead(DATA_IN_PIN);     // Read data bit and store it into bit array
    
    digitalWrite(CLOCK_PIN, HIGH);     // Generate clock rising edge
    delayMicroseconds(10);             // Wait for signal to settle
  }
  
  // Reading of shifter position
  int x=analogRead(0);                 // X axis
  int y=analogRead(1);                 // Y axis
  
  // Current gear calculation
  int gear=0;                          // Default value is neutral

    if(x<HS_XAXIS_12)                  // Shifter on the left?
    {
      if(y>HS_YAXIS_135) gear=1;       // 1st gear
      if(y<HS_YAXIS_246) gear=2;       // 2nd gear
    }
    else if(x>HS_XAXIS_56)             // Shifter on the right?
    {
      if(y>HS_YAXIS_135) gear=5;       // 5th gear
      if(y<HS_YAXIS_246) gear=6;       // 6th gear
    }
    else                               // Shifter is in the middle
    {
      if(y>HS_YAXIS_135) gear=3;       // 3rd gear
      if(y<HS_YAXIS_246) gear=4;       // 4th gear
    }
  
  if(gear!=6) b[DI_REVERSE]=0;         // Reverse gear is allowed only on 6th gear position
  if(b[DI_REVERSE]==1) gear=0;         // 6th gear is deactivated if reverse gear is engaged
  
  // Release virtual buttons for all gears
  Joystick.button(1, LOW);
  Joystick.button(2, LOW);
  Joystick.button(3, LOW);
  Joystick.button(4, LOW);
  Joystick.button(5, LOW);
  Joystick.button(6, LOW);
  Joystick.button(7, b[DI_REVERSE]);
  // Depress virtual button for current gear
  if(gear>0) Joystick.button(gear, HIGH);
    
  // Write new virtual joystick state
  Joystick.send_now();

  // Write inputs and outputs (remove comments to debug)
 /*
  Serial.print(" X axis: ");
  Serial.print(x);
  Serial.print(" Y axis: ");
  Serial.print(y);
  Serial.print(" Digital inputs: ");
  for(int i=0; i<2; i++)Serial.print(b[i]);
  Serial.print(" ");
  Serial.print(" Gear: ");
  Serial.print(gear);
  */ 
  
  delay(10);                                // Wait for 10ms
}

Kind regards Chris

Hello, could you tell me what you fixed and how you did it? Also is this for the Logitech G Driving Force Shifter?

Share this post


Link to post
Share on other sites

Hallo

Stealthblackbird

 

16 hours ago, Stealthblackbird said:

Also is this for the Logitech G Driving Force Shifter?

I Have this one.

 

http://gaming.logitech.com/de-de/product/driving-force-shifter

The problem was, that this device have no buttons. So, the buttons flickering randomly in Windows properties for Gamecontroller and also in the games.

So I only read the first 2bits from the controller.

 

Quote
int b[2];
  digitalWrite(MODE_PIN, LOW);         // Switch to parallel mode: digital inputs are read into shift register
  delayMicroseconds(10);               // Wait for signal to settle
  digitalWrite(MODE_PIN, HIGH);        // Switch to serial mode: one data bit is output on each clock falling edge
  
  for(int i=0; i<2; i++)              // Reading registers
  {
    digitalWrite(CLOCK_PIN, LOW);      // Generate clock falling edge
    delayMicroseconds(10);             // Wait for signal to settle
  
    b[i]=digitalRead(DATA_IN_PIN);     // Read data bit and store it into bit array
    
    digitalWrite(CLOCK_PIN, HIGH);     // Generate clock rising edge
    delayMicroseconds(10);             // Wait for signal to settle
  }

Finally I only set the reserves button instead to "write" all buttons by a loop.

17 hours ago, Stealthblackbird said:

Joystick.button(7, b[DI_REVERSE]);

I hope it helps.

 

I also do another "Hardwarehack". I think the sound that occurs when you lay in gear is a little too much like a toy. So I put some rubber rolling rings from a plumber on the metalstick. Now, it is a smooth and "feels good" abutment. It costs less then 10 cents.

cheers Chris

Share this post


Link to post
Share on other sites
On 8/23/2016 at 10:22 AM, fishware said:

Hallo

Stealthblackbird

 

I Have this one.

 

http://gaming.logitech.com/de-de/product/driving-force-shifter

The problem was, that this device have no buttons. So, the buttons flickering randomly in Windows properties for Gamecontroller and also in the games.

So I only read the first 2bits from the controller.

 

Finally I only set the reserves button instead to "write" all buttons by a loop.

I hope it helps.

 

I also do another "Hardwarehack". I think the sound that occurs when you lay in gear is a little too much like a toy. So I put some rubber rolling rings from a plumber on the metalstick. Now, it is a smooth and "feels good" abutment. It costs less then 10 cents.

cheers Chris

Thanks! This is exactly what I needed, do you mind attaching the sketch to a post? Also what do you mean "rubber rolling rings" did they go on the post the shifter is on? I'm also guessing this will void the warranty. One more thing, I'm working on a mod to add two more buttons. Would this mean I would have to read 4 bits from the controller? OK, I lied, a couple more things. I noticed you had added this to your code:

Quote

byte NESButtonData;

What does this do?

I have also noticed that you have omitted this line of code in between //Virtual Joystick Configuration, and void loop():

Quote

  // Virtual serial interface configuration
  Serial.begin(38400);

  // Virtual joystick initialization
  Joystick.X(512);  //512 is center
  Joystick.Y(512);  //512 is center
  Joystick.Z(512);  //512 is center
  Joystick.Zrotate(512);      //512 is center
  Joystick.sliderLeft(512);   //512 is center
  Joystick.sliderRight(512);  //512 is center

  // Digital outputs initialization
  digitalWrite(LED_PIN, LOW);
  digitalWrite(MODE_PIN, HIGH);
  digitalWrite(CLOCK_PIN, HIGH);

 What is the reason for this?

OK, last thing, the two buttons I want to add are going to be digital inputs connected to pins 0 and 1 and will be outputted as input 8 and 9 on the computer. Would I have to add a digital input definition like this?

Quote

// Digital inputs definitions
#define DI_REVERSE         1
#define L_PEDAL            8
#define R_PEDAL            9

I have already added the Teensy pin definitions as 0 and 1 and have it say at the bottom that it is input 8 and 9.

Quote

// Release virtual buttons for all gears
  Joystick.button(1, LOW);
  Joystick.button(2, LOW);
  Joystick.button(3, LOW);
  Joystick.button(4, LOW);
  Joystick.button(5, LOW);
  Joystick.button(6, LOW);
  Joystick.button(7, b[DI_REVERSE]);
  Joystick.button(8, LOW);
  Joystick.button(9, LOW);

  // Depress virtual button for current gear ---Not relevant to post
  if (gear > 0) Joystick.button(gear, HIGH); ---Not relevant to post

  // Depress virtual buttons for pedals
  if (lpedal == true) Joystick.button(8, HIGH);
  if (rpedal == true) Joystick.button(9, HIGH);

I think my wall of quotes and text is done, so if you could reply that would be great!

Edited by Stealthblackbird

Share this post


Link to post
Share on other sites

I got my two extra pedals/buttons working! I've included the sketches in the attachments. First one is the sketch fishware made but modified for Teensy 2.0. The second is the same as the first but adds to extra pedals or buttons and it is for Teensy 2.0. The third is the same as the second but for Teensy 2.0++. 

Anyways, all the two extra buttons consist of are just pull switches on a pedal, so really you could use any button or switch to do this with. The pull switches are connected to a phono jack which connects to another phono jack which is then connected to the Teensy. I had to use some 10K Ohm pull down resistors which are connected to the 0 pin and the 1 pin to GND because I had some interference. Also attached is a video of it working, plus a diagram of the whole thing.

G_Driving_Force_Shifter_buttons_fixed_Teensy_2.0.ino

G_Driving_Force_Shifter_buttons_fixed_with_2_more_pedals_Teensy_2.0.ino

G_Driving_Force_Shifter_buttons_fixed_with_2_more_pedals_Teensy_2.0plusplus.ino

WP_20160904_17_36_22_Pro.jpg

WP_20160904_17_29_55_Pro.jpg

WP_20160904_17_30_23_Pro.jpg

WP_20160904_16_33_30_Pro.jpg

WP_20160904_17_28_50_Pro.jpg

G Drving Force Shifter 1.mp4

Share this post


Link to post
Share on other sites

Thanks very much for this guide.  With no prior experience, I have managed to fumble my way through CableCat's adaptation using the Pro Micro, and unbelievably it worked first time!

I'm using a G27 shifter and haven't modified any of the code.

 

I have a couple of questions relating to expansion... At some point I'd like to add a few switches and a rotary encoder to my rig.  Does my Pro Micro have the capacity for a rotary encoder and maybe another few switches?

 

Additionally, I'd like to add a single 3-way toggle switch which is "on - off - momentary".  I found this G27 mod which utilises the connection where the mode switch would be (if it were a G25 shifter). https://poweredbyredstone.com/shifter-upgrades/

Particularly appealing is the LED indicator which will tell me whether or not I've left the switch on....

Will this mod work with the pascalh/Cablecat Pro Micro adapter I've just built?  Do I need to modify the code?  Will the LED indicator work?- for some reason the "on" LED indicator does NOT currently work on my shifter - I don't know if this is due to the DIY adaptor or not?

Share this post


Link to post
Share on other sites
On 14/03/2016 at 10:33 PM, Frank12 said:

Thanks for reminding me about this haha, totally got enjoying playing on Asseto corsa now xD Follow my instruction and im pretty sure they will fix your problem.

 

Well here are my two G27 Files. Now the part where to trouble shoot the installation part.

 

G27  Pedal only:

You have to use Analog inputs (Axx labels on Teensy) ive put them on my Teensy 3.2 on the following:

#define LED_PIN            13
#define THROTTLE_PIN       21
#define BRAKE_PIN          23
#define CLUTCH_PIN         22

IF you want to connect them somewhere else You HAVE to change the pin's AND also these bit of code here:


  // Reading of shifter position

  int throttle = analogRead(7);       // Throttle pedal
  int brake = analogRead(9);          // Brake pedal
  int clutch = analogRead(8);          // Clutch pedal

You got to change the number in Analogread to match your new pin. on teensy its easy as Analog ports are labeled A0,A1,A2 etc. You need to set thoese right. for exemple if you put throttle on pin 14 (teensy 3,2) you change  analogRead(7); to analogRead(0);  

 

card7a_rev1.png

 

G27 Pedal And Shifter:

 

The same Of above will apply with the X and Y axis. You need to change the AnalogRead number to the correct pin. The Data,clock and mode input can be wired to Any Digital pin. they dont need to be in the analog. 

 

I hope it helps people ^^ any mroe question can be asked to me.

G27_Pedal_Shifter.ino

G27_Pedal_only.ino

My teensy board arrived yesterday and only today me and my brother got time to try it out! Using your Pedal Only file it had worked flawlessly, I just had to change the inputs like you said. I will buy a shifter and will change the code when I got it, but I can use this with my DFGT for now. Awesome! Thx!
 

P_20160929_201953.jpg

P_20160929_201233.jpg

esquema pedal.jpg

Share this post


Link to post
Share on other sites

Did anyone ever put together a shifter and pedals version for arduino? The only one I can see from cablecat looks like it's just for the shifter, it'd be nice to get the pedals too given an arduino is 3 dollars or so while a teensy is still over 20.

Share this post


Link to post
Share on other sites
11 hours ago, poopdog said:

Did anyone ever put together a shifter and pedals version for arduino? The only one I can see from cablecat looks like it's just for the shifter, it'd be nice to get the pedals too given an arduino is 3 dollars or so while a teensy is still over 20.

Most of arduinos do not have USB support (e.g. Arduino Nano for $3, it has only USB-UART bridge). By the contrast cheap STM32 boards have full USB device support. Paying 15-20 dollars for Teensy is madness...

 

stm32f103c8t6.png

Share this post


Link to post
Share on other sites
On 29-10-2016 at 9:43 PM, poopdog said:

Did anyone ever put together a shifter and pedals version for arduino? The only one I can see from cablecat looks like it's just for the shifter, it'd be nice to get the pedals too given an arduino is 3 dollars or so while a teensy is still over 20.

I have made one like this: https://github.com/functionreturnfunction/G27_Pedals_and_Shifter

With this exact Arduino: https://nl.aliexpress.com/item/Free-Shipping-New-Pro-Micro-for-arduino-ATmega32U4-5V-16MHz-Module-with-2-row-pin-header/1348800135.html?detailNewVersion=&categoryId=400103

I now have a working G27 shifter and pedals, and using my Momo steering wheel (still in search of a G27 wheel, I got the pedals and shifter out of a computershop trash can)

Share this post


Link to post
Share on other sites
On ‎31‎/‎10‎/‎2016 at 10:14 AM, MsG said:

I have made one like this: https://github.com/functionreturnfunction/G27_Pedals_and_Shifter

With this exact Arduino: https://nl.aliexpress.com/item/Free-Shipping-New-Pro-Micro-for-arduino-ATmega32U4-5V-16MHz-Module-with-2-row-pin-header/1348800135.html?detailNewVersion=&categoryId=400103

I now have a working G27 shifter and pedals, and using my Momo steering wheel (still in search of a G27 wheel, I got the pedals and shifter out of a computershop trash can)

Trying the same thing, with the exact same sketch but somehow its not working for me....can get the gears to work besides the 6th, when i put into 6th or 7th, it always presses button 7...all the other buttons are always pressed. tried to debug, have been watching the code for hours but i cant figure what is happening. Do i need some kind of resistors? cause i got all connect directly to the board.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
20 20