- Posts: 10
USB HID Joystick & PPM-In program
- hmjack2008
- Topic Author
- Offline
(1) in Menu->USB page.
(2) press "DN" to enable USB.
(3) plug-in USB to PC, PC will detect Mass Storage & USB HID Joystick.
(4) press "UP" to enable send Joystick data.
and, my ppm-in program, but "not stable!!" (if plug-in/out when connect)
Please Log in or Create an account to join the conversation.
- SadSack
- Offline
- Posts: 317
Some details on how to add it to build would be handy for dim wits like me
Thanks,Phil
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
Note that is just from inspection I didn't try it.
it will override the normal inputs I think and isn't configurable, so it is more of a proof of concept than anything else.
Still, it is great work, and I look forward to spending more time looking at it.
Please Log in or Create an account to join the conversation.
- SadSack
- Offline
- Posts: 317
So would work for 7e& others or just 10?
Please Log in or Create an account to join the conversation.
- MatCat
- Offline
- Posts: 168
Please Log in or Create an account to join the conversation.
- hmjack2008
- Topic Author
- Offline
- Posts: 10
(1) change : "7" to "5"
(2) change : "15" to "13"
=========== mixer.c ===========
#define devoCH_size 4+1 //devo7;8;10 = 5;5;7
#define devoSW_size 4+1+8 //devo7;8;10 = 13;13;15
/******************** Joystick ********************/
#ifndef EMULATOR
if (JoystickEn && PrevXferComplete) {
if (i<devoCH_size) { // devo7;8;10 = 1~4: Aixs; 5~6:AUX4~AUX5
Joystick_Buffer[i+2] = (s8) ((raw)/79);
} else {
if (i<devoSW_size) { //switch 1st-byte
if (raw>0) {
Joystick_Buffer[1] |= (uint8_t) 0x01<<(i- devoCH_size);
} else {
Joystick_Buffer[1] &= (uint8_t) ~(0x01<<(i- devoCH_size));
} //if (raw>0)
} else { //switch 2nd-byte, devo7 not use
if (raw>0) {
Joystick_Buffer[2] |= (uint8_t) 0x01<<(i- devoSW_size);
} else {
Joystick_Buffer[2] &= (uint8_t) ~(0x01<<(i- devoSW_size));
} //if (raw>0)
} //else if (i< devoSW_size)
} //if (i< devoCH_size)
JoystickBuff = 1;
} //if (JoystickEn && PrevXferComplete)
#endif // #ifndef EMULATOR
/******************** Joystick ********************/
Please Log in or Create an account to join the conversation.
- hmjack2008
- Topic Author
- Offline
- Posts: 10
SadSack wrote: So head tracker be an option soon, sweet possibly option for 7e(hint)
Some details on how to add it to build would be handy for dim wits like me
Thanks,Phil
I use "menu-> about page" to do enable ppmin.c and show the ppmin channels & signal-width.
(0) use trainer cable to connect
(1) in about page
(2) press "ENTER" to enable ppmin
(3) press "DN" to show the ppmin channels & signal-width
NOTE:
Do NOT plug in/out the trainer cable when ppmin enable !!
I got the problem .... if plug in/out when ppmin enable.
=> sometime, LCD become no display,
=> if LCD no display, need reflash to walkera fireware for recover.
====about_page.c====
static u8 _action_cb(u32 button, u8 flags, void *data)
{
(void)data;
if ((flags & BUTTON_PRESS) || (flags & BUTTON_LONGPRESS)) {
if (CHAN_ButtonIsPressed(button, BUT_EXIT)) {
PAGE_ChangeByID(PAGEID_MENU, PREVIOUS_ITEM);
} else {
if (CHAN_ButtonIsPressed(button, BUT_ENTER)) {
#ifndef EMULATOR
// ppm-in
sprintf(up->tmpstr, "ppm: '%d'-'%d'", 0, 65535),
GUI_CreateLabelBox(0, 55, 128, 8,&TINY_FONT, NULL, NULL, up->tmpstr);
ppmin_TIM5_Init();
ppmin_Init();
ppmIN = 1;
}
if (CHAN_ButtonIsPressed(button, BUT_DOWN)) {
ppmin_Stop();
sprintf(up->tmpstr, "ppm#: %d-%d-%d",ppmin_num_channels,ppmChannels[0],ppmChannels[ppmin_num_channels]);
GUI_CreateLabelBox(0, 55, 128, 8,&TINY_FONT, NULL, NULL, up->tmpstr);
}
// ppm-in
#endif // #ifndef EMULATOR
}
}
}
return 1;
}
Please Log in or Create an account to join the conversation.
- SadSack
- Offline
- Posts: 317
Please Log in or Create an account to join the conversation.
- SadSack
- Offline
- Posts: 317
Well i give it ago awhile back and tried to build 10c and 7e no joy lots of build errors. I know you did this for 10c only then added 7e. hoping either you've done more with it or some pointers on how it should be built. I did try build just Hid then PPM and then both.
thanks,Phil
Please Log in or Create an account to join the conversation.
- hmjack2008
- Topic Author
- Offline
- Posts: 10
Edit PB:
Removed entire post due to discussion of illegal software. the zip itself is the usb joystick code and looks ok.
Please read the message posted on the forum page. No discussion of subverting copyright will be tolerated on this board.
Sorry, I included the illegal message, and thanks PhracturedBlue removed these immediate.
below is my updated :
(1) for USB joystick,
(1.1) change for DEVO7;8;10;12.
(1.2) rearrangement the sequence of axis.
(2) for PPM-In
(2.1) the program not compatible with Walkera f/w.
(2.2) the ppm-in need special audio cable to connect.
coach(audio-left, ppm-out) --to--> trainer(audio-right, ppm-in)
Please Log in or Create an account to join the conversation.
- Hexperience
- Offline
- Posts: 588
There are 10 types of people in this world. Those that understand binary and those that don't.
Please Log in or Create an account to join the conversation.
- SadSack
- Offline
- Posts: 317
Phoenix R/C is cheap enough compared to few crash's. Guy puts more updates out than PB Even if you sell up phoenix holds it's value and never up for sale to long. Small heli's hard to say how good but 450 up and trex600 is perfect.
Please Log in or Create an account to join the conversation.
- Hexperience
- Offline
- Posts: 588
hmjack2008 wrote:
(2.2) the ppm-in need special audio cable to connect.
coach(audio-left, ppm-out) --to--> trainer(audio-right, ppm-in)
Which one is the TIP of the plug? I can't recall off the top of my head. If the TIP is left for ppm out, then maybe the standard "mono" cable will work for trainer and sim without having to use an adapter?
Can't wait to see both of these features working... will be great!
(And yes, Phoenix is great! I have Phoenix and RF6.5 but I shouldn't have bothered with RF6.5...)
There are 10 types of people in this world. Those that understand binary and those that don't.
Please Log in or Create an account to join the conversation.
- SadSack
- Offline
- Posts: 317
I started with reflex and at the time thought it was good till started flying with heli pilot and saw how much better it was. And I'm not going to comment about realflight as not to start flame war.
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
So far I only have the menuing created. The actual ppm code is not yet ready.
My idea is that there are 2 modes for PPM-in:
1) Trainer mode: In this mode each input channel is mapped to an output of the transmitter when the relevant switch is enabled, otherwise the channels act as normal
2) FPV mode: in this mode we enable a set of new inputs that can be used like any other analog input. this will allow for head-tracking or whatever other external inputs you like.
The PPM controls will allow specifying the PPM parameters (similar to how the PPM-Out controls work), as well as the channel order (when using train mode)
Please Log in or Create an account to join the conversation.
- SadSack
- Offline
- Posts: 317
FPV great!!!
Thanks, Phil
Please Log in or Create an account to join the conversation.
- FDR
- Offline
I think trainers don't always let control all channels by the tranee anyway...
The point is there should be PPM in inputs assignable to any channel source, All the rest can be done with switches...
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
I agree it could be done with just extra inputs, but configuration would be cumbersome as you'd end up needing to tune every model for train mode. With this configuration, you can very easily configure an existing model for work with a trainer. It is a good point about some channels not being mapped. I'll make sure you can disable the mapping of the input channels in train mode.FDR wrote: IMO even with the only FPV mode one can manage both situations.
I think trainers don't always let control all channels by the tranee anyway...
The point is there should be PPM in inputs assignable to any channel source, All the rest can be done with switches...
Please Log in or Create an account to join the conversation.
- hmjack2008
- Topic Author
- Offline
- Posts: 10
I use my JR-10S (9 channels ppm-out) for DEVO10 ppm singals input.
So, my program not compatible walkera firmware.
Today, I use Arduino to do out put 8 channels ppm signal (Student mode simulation ).
The DEVO(walkera firmware) can use on Coach mode.
Now, I finally know the walkera's algorithm.
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
Thus I can probably setup GPIOA.9 to work (though it will be impossible to use ppmin and ppmout at the same time which is too bad). But hmjack seems to have been able to get it to work with GPIOA.10 and I am not sure how.
It is odd because the plug on the circuit-board exposes both pins, but only one seems to be attached to the phono plug.
Please Log in or Create an account to join the conversation.
- Home
- Forum
- Development
- Development
- USB HID Joystick & PPM-In program