Jump to content
The simFlight Network Forums

matmaun

Members
  • Posts

    6
  • Joined

  • Last visited

matmaun's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. ah haa! thanks heaps pete for your swift response, i realised my mistake a quarter of the way through reading your post. Well i said i was a novice so i guess i just learnt programming lesson 101. thanks again!
  2. My first post here, so firstly a huge thanks to Pete and the wider FS dev community for some really great work over the years. My issue: I'm pulling apart D.J.Ault's RMU/K8055 USB I/O board interface source code (written in C) to assign the digital inputs as a rudder/aileron trim controls. I have to go the long way round as the Velleman K8055 board is not an HID USB device. So i've copied some functioning code and replaced the variables but every time i compile i get a warning "'FSUIPC_Read' makes pointer from integer without a cast" Using FS interrogate, the aileron trim position/control appears to be a signed short var. so i've added a signed short var at the top to the code called "aileron_trim". NB: I have also tried setting the var as an int and other variables but the result is the same. so here's D.J.'s original code that enables the digital input to adjust the AP heading. SetCurrentDevice( 1 ); if( ReadDigitalChannel( 1 ) == 1) //check if heading minus pressed { if(step_increase1 <= 20) { step_increase1+=1; Sleep( 50 ); } else if(step_increase1 <= 100) step_increase1+=5; else if(step_increase1 > 100 ) step_increase1+=20; if(!FSUIPC_Read(0x07CC, 2, &heading, &dwResult) || !FSUIPC_Process(&dwResult)) connect_to_sim(); //read current heading heading-=(int)150+step_increase1; if( !FSUIPC_Write(0x07CC, 2, &heading, &dwResult)) connect_to_sim(); p = 1; } And here's my attempt to get a digital input to adjust the aileron trim else if( ReadDigitalChannel( 2 ) == 1) //check if aileron R plus pressed { if(step_increase1 <= 20) { step_increase1+=1; Sleep( 50 ); } else if(step_increase1 <= 100) step_increase1+=5; else if(step_increase1 > 100 ) step_increase1+=20; if(!FSUIPC_Read (0x0C02, 2, aileron_trim, &dwResult) || !FSUIPC_Process(&dwResult)) connect_to_sim(); //read current heading <==this is the error line aileron_trim+=(signed short)150+step_increase1; if ( !FSUIPC_Write(0x0C02, 2, &aileron_trim, &dwResult)) connect_to_sim(); p = 1; } any tips or pointers to a beginner's tutorial would be much appreciated Thnx
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.