Shop OBEX P1 Docs P2 Docs Learn Events
unable to initialize Keyboard/mouse combo object — Parallax Forums

unable to initialize Keyboard/mouse combo object

SiriSiri Posts: 220
edited 2008-10-18 20:41 in Propeller 1
I was trying to use your Keyboard/mouse object.It says to:
“Applications should call config.GetPin(DeviceType) to get the pin for the device.”

I tried placing the call like this:
Pub Start | char, mx, my
  config.Init(@pininfo,0)                               'initialize config setup
  config.GetPin(CONFIG#VGA1) 
  kbm.start(config.GetPin(CONFIG#MOUSE1_DATA),config.GetPin(CONFIG#MOUSE1_CLK), {
}   config.GetPin(CONFIG#KEYBOARD1_DATA),config.GetPin(CONFIG#KEYBOARD1_CLK))





I also tried doing this "config.GetPin(#VGA1) - not succesful


Pub Start | char, mx, my
  config.Init(@pininfo)   'initialize config setup
  
  kbm.start(config.GetPin(CONFIG#MOUSE1_DATA),config.GetPin(CONFIG#MOUSE1_CLK), {
}   config.GetPin(CONFIG#KEYBOARD1_DATA),config.GetPin(CONFIG#KEYBOARD1_CLK)) ,config.GetPin(CONFIG#VGA1) 





and I did not get any display on the VGA Monitor.(I have the monitor hooked up to "Propeller Proto Board and wired per instructions and it does work when I use the VGA object to display text.
What I am I doing wrong.

Regards,

Siri

Comments

  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2008-10-17 19:36
    I'm a little confused by what you are trying to do. It looks like you are using
    some code that calls a "pindefs" file for it's I/O information.

    something like this:
    propeller.wikispaces.com/PinDefs.spin

    If you place the actual number of the connected item does it work?

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Getting started with a Propeller Protoboard?
    Check out: Introduction to the Proboard & Propeller Cookbook 1.4
    Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
    Got an SD card connected? - PropDOS
  • SiriSiri Posts: 220
    edited 2008-10-17 20:09
    Oldbitcollector,
    You are wright it is looking for "PinDefs"They are in a another object which this calls.
    Here is the initialization part of the KBM driver Test - I was trying out the Test program which was included in the kbm oject found in the OBJECT section.

      {{
      KBM driver test
            Tim Moore July 08
    }}
    CON
      _clkmode = xtal1 + pll16x
      _xinfreq = 5_000_000
    
    OBJ 
                                                            '1 Cog here 
      kbm           : "kbm"                                 '1 COG for mouse and keyboard
      
      uarts         : "pcFullDuplexSerial4FC"               '1 COG for 4 serial ports
    
      config        : "config"                              'no COG required
    
    Pub Start | char, mx, my
      config.Init(@pininfo,0)                               'initialize config setup
      
      kbm.start(config.GetPin(CONFIG#MOUSE1_DATA),config.GetPin(CONFIG#MOUSE1_CLK), {
     }  config.GetPin(CONFIG#KEYBOARD1_DATA),config.GetPin(CONFIG#KEYBOARD1_CLK))
        config.GetPin(CONFIG#VGA1) 
    
      waitcnt(clkfreq*3 + cnt)                              'delay for debugging
      
      uarts.Init
      uarts.AddPort(0,config.GetPin(CONFIG#DEBUG_RX),config.GetPin(CONFIG#DEBUG_TX),{
    }   UARTS#PINNOTUSED,UARTS#PINNOTUSED,UARTS#DEFAULTTHRESHOLD, {
    }   UARTS#NOMODE,UARTS#BAUD115200)                      'Add debug port
      uarts.Start                                           'Start the ports
      
      uarts.str(0,string("KBMTest",13))
    
    
    



    Thanks,

    Regards,

    Siri
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2008-10-17 20:30
    Here's an example of the way I called my Pindefs from my loderunner game.

         pd     : "PinDefs"                  ' I/O configuration file
    
      text.start(pd#TV_DAC1)
      snd.start(pd#AUDIO1)  
      fsrw.start(@ioControl)                
      fsrw.mount(pd#FSRW1_DO,pd#FSRW1_Clk,pd#FSRW1_DI,pd#FSRW1_CS)
    
    



    I'm guessing that config.GetPin(CONFIG#VGA1) should be something like start.vga(config#VGA1)
    and kbm.start(config#MOUSE1_DATA,config#MOUSE1_CLK)
    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Getting started with a Propeller Protoboard?
    Check out: Introduction to the Proboard & Propeller Cookbook 1.4
    Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
    Got an SD card connected? - PropDOS

    Post Edited (Oldbitcollector) : 10/17/2008 8:36:43 PM GMT
  • SiriSiri Posts: 220
    edited 2008-10-18 20:41
    Thanks Oldbitcollector

    I got it working.

    Regards,

    Siri
Sign In or Register to comment.