micnolmad 1 Report post Posted December 14, 2015 On 25/11/2015 at 6:35 AM, erak said: Hi, I am missing the shifter for my G25, which makes it impossible for me to change max rotation on my steering wheel. I'm wondering if you could help me adapt your code to make a small 4-button box with this function. The normal way of doing this is holding the two center red buttons and pressing a black button. Using your designations: RED_CR + RED_CL + BL_T: 225° BL_R: 675° BL_L: 450° BL_B: 900° (default) Is this possible with the same hardware, adding four buttons? No USB-interface. Thanks I don't think that would work. That button combination would only work when the shifter in hocked up to the wheel base. I don't think it's possible what you have in mind. I think you would need to make a 4-button box to hock of to the wheel base but you would have to make it send the signals the same way the shifter does it. Share this post Link to post Share on other sites
flaviu 0 Report post Posted December 20, 2015 Hi guys, Pascalh, thank you very much for this topic. I found exactly what I was needed. The G27 shifter works perfect, with some little modification. I have a teensy 2.0 board and my file it is attached bellow. I'm not a programmer person so I need some help to make my pedals work with the shifter. I try to use: #define Z_AXIS_PIN 1 // gas Z axis #define BR_AXIS_PIN 2 // brake left sliders #define CL_AXIS_PIN 3 // clutch right sliders // G27 pedals analog inputs configuration pinMode(Z_AXIS_PIN, INPUT_PULLUP); // Z axix gas pinMode(BR_AXIS_PIN, INPUT_PULLUP); // Slider left brake pinMode(CL_AXIS_PIN, INPUT_PULLUP); // Slider right clutch but couldn't make pedals to work. If anyone have a little time, please give me some help. Thank you. G27_shifter_en1.ino Share this post Link to post Share on other sites
Frank12 2 Report post Posted February 13, 2016 I bought myself a set of G27 shifter and pedal from a guy who had a power surge with a T150 from thrustmaster Im on a budget hehe And well I was wondering as im stil new to this but i saw the 2.0 board was an 8 bit, while the Teensy LC was 32 bit? shoulnd it be better to use the LC to use all 10 bit for the pedal? to get all 1024 steps? or im i mixing up stuff here? Any help would be greatly appreciated Share this post Link to post Share on other sites
flaviu 0 Report post Posted February 17, 2016 This is the G25/G27 wiring diagram to the pedals DB9 connector: On the other side of the pedals DB9 connector, you have to connect: pin 1 to Teensy +5V pin 6 to Teensy GND pin 2, 3, 4 to the 3 Teensy analog input pins defined in the code Hi all, I'm a newby also but I have a question related to this schematics: It is 100% sure or pin 1 and pin 6 are switched? I mean all tree B(ground) must be connected to 6-9 and all R to +5V on teensy board. Thank you guys. Share this post Link to post Share on other sites
Frank12 2 Report post Posted February 18, 2016 Just ordered a tensy LC board, weel see how it goes, Ill be able to answer you flaviu, i got a G27 Pedal and shifter that im gonna do this adapter ^^ ill tell you guys how i did it Share this post Link to post Share on other sites
flaviu 0 Report post Posted February 18, 2016 Thank you Frank, I hope you succed in your project. If you want to try for the G27 shifter my attached file -two post above- work perfect. Gear and all buttons working. Waiting for news Share this post Link to post Share on other sites
pascalh 34 Report post Posted February 18, 2016 (edited) Thank you Frank, I hope you succed in your project. If you want to try for the G27 shifter my attached file -two post above- work perfect. Gear and all buttons working. Waiting for news You will find a modified version of my code attached. I can't test it at the moment so please let me know how it works: I will then publish it in the forum. On the G25/G27 pedals DB9 connector: Connect pin 6 to GND Connect pin 1 to +5V Connect pin 2 to Teensy pin 14 (B5) Connect pin 3 to Teensy pin 15 (B6) Connect pin 4 to Teensy pin 16 (F7) G25_shifter_pedals_en.txt Edited February 18, 2016 by pascalh Share this post Link to post Share on other sites
micnolmad 1 Report post Posted February 19, 2016 // Digital inputs definitions #define DI_REVERSE 1 #define DI_MODE 3 #define DI_RED_CENTERRIGHT 4 #define DI_RED_CENTERLEFT 5 #define DI_RED_RIGHT 6 #define DI_RED_LEFT 7 #define DI_BLACK_TOP 8 #define DI_BLACK_RIGHT 9 #define DI_BLACK_LEFT 10 #define DI_BLACK_BOTTOM 11 #define DI_DPAD_RIGHT 12 #define DI_DPAD_LEFT 13 #define DI_DPAD_BOTTOM 14 #define DI_DPAD_TOP 15 Pascalh: I have tried to change the numbers of the definitions to get another sequence because when I press ie the red buttons in sequence left to right they do not register in order. But it didn't make any difference what numbers I entered. The sequence remained the same. I late thought I might have reset or disconnected the board between uploads but I haven't tried that yet. Well so my question is should I be able to switch the numbers around to get the right sequence? Share this post Link to post Share on other sites
Frank12 2 Report post Posted February 20, 2016 Well im having problems, i got my Teensy LC and i know it is different of teensy 2.0 on which everything here is based on but, Ive made the changes to the appropriate script and i was going only for the shifter for now. So i took in consideration the fact that G27 shifter pin are inversed. So here a image of a Teensy LC board: ive wired my DB9 connector just like the for the G25 but ive inverted pin 1 and 7 (clock and +5v) And ive attacked them respecttively like this : #define DATA_IN_PIN 18 (A4) #define MODE_PIN 17 (A3) #define CLOCK_PIN 16 (A2) #define X_AXIS_PIN 15 (A1) #define Y_AXIS_PIN 14 (A0) I know thats the way they were wired on the teensy 2.0. But i was wondering if things changes or the script had to be changed. or is it simply my teensy that is weirding up. because When i hit compile everything works until it comes to upload. I hit upload and i get this : "Sketch uses 13,284 bytes (20%) of program storage space. Maximum is 63,488 bytes. Global variables use 3,512 bytes (42%) of dynamic memory, leaving 4,680 bytes for local variables. Maximum is 8,192 bytes. Teensy did not respond to a USB-based request to automatically reboot. Please press the PROGRAM MODE BUTTON on your Teensy to upload your sketch." So i hit the button, and teensy loader just keeps telling me to press the button and that "reboot ok" so i disconect and reconnect see if my program is in there, but nothing :/ idk if im doing something wrong. Ive even tried to take out the automatic mode from the teensy loader and there it enters program mode but nothing else. it download the file to the board but still wont activate it the script im using is from Flaviu with the changes done only in the definitions of pins to match my board. Share this post Link to post Share on other sites
Frank12 2 Report post Posted February 21, 2016 (edited) I could get the code uploaded to the board, but it still doesnt seem to activate my shifter. (i changed the LED blink for a longer delay to make sure the code was uploaded) and it doesnt instal a new device or see it as a game controller. Im running windows 10 64 bit. Ill wire the pedals up and see if they do any difference. I hope so the pedal can work. if the pedal work it means the shifter i bought was dead and i can maybe check the cables. Anyone could give me a standalone code with just the Pedals? or i can just take the G25 Shifter and pedal script from pascalh and it will work? ill try right now welding cables ont he connector. Edited February 21, 2016 by Frank12 Share this post Link to post Share on other sites
micnolmad 1 Report post Posted February 24, 2016 Frank 12, did you get pedals to work? If not, I would suggest trying the pro micro clone from eBay. It is very cheap but works well. I am very happy with mine. Pascalh, could you please take a look at my question for you a few posts up from here? Thanks Share this post Link to post Share on other sites
Frank12 2 Report post Posted February 25, 2016 Are the G27 pedal/shifter input require 5v? if so the teensy LC is not gonna work ever, as i just noticed they cannot have more then 3.3v as inputs. not sure if that affects something or not. Share this post Link to post Share on other sites
micnolmad 1 Report post Posted February 25, 2016 (edited) Apparently I don't know Edited March 2, 2016 by micnolmad I was wrong Share this post Link to post Share on other sites
Frank12 2 Report post Posted February 25, 2016 I swapped the LC for a 3.2 So lets see how it goes! Share this post Link to post Share on other sites
pascalh 34 Report post Posted February 25, 2016 On 19/2/2016 at 10:37 AM, micnolmad said: Pascalh: I have tried to change the numbers of the definitions to get another sequence because when I press ie the red buttons in sequence left to right they do not register in order. But it didn't make any difference what numbers I entered. The sequence remained the same. I late thought I might have reset or disconnected the board between uploads but I haven't tried that yet. Well so my question is should I be able to switch the numbers around to get the right sequence? These numbers are only used to calculate the switching from and to handbrake mode. The sequence is given by the internal connection or buttons to the shift registers. Share this post Link to post Share on other sites
pascalh 34 Report post Posted February 25, 2016 16 hours ago, Frank12 said: Are the G27 pedal/shifter input require 5v? if so the teensy LC is not gonna work ever, as i just noticed they cannot have more then 3.3v as inputs. not sure if that affects something or not. No, no +5V required. What is important here is that the same voltage must be connected to analog voltage reference and potentiometers Share this post Link to post Share on other sites
Frank12 2 Report post Posted February 25, 2016 (edited) 8 hours ago, pascalh said: No, no +5V required. What is important here is that the same voltage must be connected to analog voltage reference and potentiometers i got the teensy 3.2, same issue tho. joystick not working or showing up and button "2" seem on while im not rpessing anything. What are the color codes for the wiring in the shifter? I will maybe try to just wire it directly. EDIT: WAHEY! managed to get the pedal working with a standalone code. now i still cant get the shifter to work! this is giving me so much headaches. i dont understand why its notworking as everything is reference well. its like if my pinout werent matching the right order. nearly makes me wanna get the shifter adapter lol. but im sure other will find a use if i am able to make this work for the G27 shifter with the 3.2 Edited February 26, 2016 by Frank12 Share this post Link to post Share on other sites
micnolmad 1 Report post Posted February 26, 2016 Frank, , where do you live? If in Europe, maybe I can make one for you and send it to.. Share this post Link to post Share on other sites
Frank12 2 Report post Posted February 27, 2016 (edited) 7 hours ago, micnolmad said: Frank, , where do you live? If in Europe, maybe I can make one for you and send it to.. In canada. Thanks for the offer tho, im really not sure if its my shifter that maybe its Dead. Tho i found something funny today. powering the ground somehow powers the LED... Im really tempted to just splice the wire of the connector. I got it all opened up ill be checking on the joysticks tomorrow see if there dirty or whatever. Edit: I opened up just out of curiosity and found something odd, the cable that connects the joystick potentiometers at the end of the heat shrink tube it looks like melted and deformed. Tho no signs of burn or board damage smell/visible. (i do have a hobby of miniature trains and had to work with a lot of tiny cables and boards and i got couple of shorted one or burnt ones) the joystick itself seem dirty with grease, ill clean it up the potentiometer tomorrow, and rewire the cable. Ill try and find an 8 pin i have lying somewhere so ill just connect a different cable directly to the teensy and see if that gives any work out. Ill be uploading my pedal standalone code soon aswell as instructions. Edited February 27, 2016 by Frank12 Share this post Link to post Share on other sites
Frank12 2 Report post Posted February 28, 2016 (edited) And my shifter work... Kinda. So i cut the original wire, and i can say that the original DB9 conector was Faulty. hence no signal was being sent. aquardly connecting the tiny cable of the DB9, i managed to get digital output of most of the shifter including the gears. EDIT: Got all Digital output working, need to fix my gear threshold. I dont see any axis movement tho, but that might be due to the cable i mentioned that was melted. So i will have to grab new conectors and rewire my whole Shifter. Edited February 28, 2016 by Frank12 Share this post Link to post Share on other sites
micnolmad 1 Report post Posted March 2, 2016 Ish, a lot of work ahead.. Sorry about the misinformation on the 5v. I don't know crap about this, I just thought I remembered something about from page 1 Hope you get it up and running. I had to tweak my thresholds too for it to work properly. 1 Frank12 reacted to this Share this post Link to post Share on other sites
Frank12 2 Report post Posted March 4, 2016 just wanted to post an update: EVERYTHING WORKS! Just spent 3 hours in asseto corsa driving, now i got to wait for my DFGT to arrive and im ready to really kick this stuff up, ill make a more complete post with steps of what i did to adapt the code for teensy 3.2 (not much but worth for other people) + G27 shifter & pedal file and a pedal only file. 1 pascalh reacted to this Share this post Link to post Share on other sites
flaviu 0 Report post Posted March 14, 2016 On 3/4/2016 at 7:05 AM, Frank12 said: just wanted to post an update: EVERYTHING WORKS! Just spent 3 hours in asseto corsa driving, now i got to wait for my DFGT to arrive and im ready to really kick this stuff up, ill make a more complete post with steps of what i did to adapt the code for teensy 3.2 (not much but worth for other people) + G27 shifter & pedal file and a pedal only file. Hi Frank, I would like to see your pedal only file. With mine something is wrong. Maybe comparing two of them I could figure what it is wrong. Congratulation for your achievement. Share this post Link to post Share on other sites
Frank12 2 Report post Posted March 15, 2016 14 hours ago, flaviu said: Hi Frank, I would like to see your pedal only file. With mine something is wrong. Maybe comparing two of them I could figure what it is wrong. Congratulation for your achievement. 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); 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 1 Regis Souza reacted to this Share this post Link to post Share on other sites
Stealthblackbird 1 Report post Posted June 17, 2016 So has anyone gotten this to work with an Arduino Uno? I was looking at the program UnoJoy for it as it seems it will communicate and show up on Windows as a Joystick but I don't know how to configure it with the sketches. Share this post Link to post Share on other sites