Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Extending Digital Input using game Controller

digital Input game controller

Best Answer Fahdil, 23 February 2014 - 10:08 PM

I think, this thread was solved.... as mention by Hanz and andy on the other thread.

 

I will try it once i got those chips. thanks any way.... love this forum so much.....

Go to the full post


  • Please log in to reply
7 replies to this topic

#1 Fahdil

Fahdil

    Advanced Member

  • Members
  • PipPipPip
  • 59 posts
  • LocationJakarta, Indonesia

Posted 17 February 2014 - 04:39 PM

hi guys,

 

I'm developing a sensor station.... it will have more than 20 digital sensor. so in this case, I will using IC's 4066 to switch a USB Game Controller buttons. 

 

schema:

 

Digital Sensors ==> 4066 ==> Drive USB Game Controller Buttons ==> Send Byte to PC / Netduino

 

 

I've got no problem to do it in windows app. but hopefully to do it on Netduino. is any one have an idea how to send byte from USB to netduino? can I solve this by using USB host shield? or maybe FTDI cable?

 

appreciate any suggestion.

 

*additional Note:

4066 is just like a relay, it has 4 block switch on 1 IC.



#2 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 23 February 2014 - 10:36 AM

USB gamepads are typically implemented as HID devices and must be connected to a USB host. The host (usually a PC) periodically polls the device to read the current state of buttons, directional pads, thumbsticks and so on. I find your project description to be somewhat cryptic - are you looking to have the Netduino act as USB host reading the gamepad or is it the other way around - e.g. the Netduino should act as a gamepad that will be read by a PC over USB as means of sending sensor information to the PC?

#3 Fahdil

Fahdil

    Advanced Member

  • Members
  • PipPipPip
  • 59 posts
  • LocationJakarta, Indonesia

Posted 23 February 2014 - 11:19 AM

Dear hanz,

 

I find your project description to be somewhat cryptic - are you looking to have the Netduino act as USB host reading the gamepad or is it the other way around - e.g. the Netduino should act as a gamepad that will be read by a PC over USB as means of sending sensor information to the PC?

 

thanks for your response. Actually I just need to watch 16 and more digital input at the same time. last time I did it in my PC using usb gamepad. This gamepad sent data byte to my PC. (button 1 = byte 1, Button 3 = byte 4, button 4 = byte 8 and so on).

 

but I dont know how to do it in the Netduino. 

If there any shield which has 16 button connect to a serial port then it would be solve the problem. 

 

Cheers



#4 Fahdil

Fahdil

    Advanced Member

  • Members
  • PipPipPip
  • 59 posts
  • LocationJakarta, Indonesia

Posted 23 February 2014 - 12:45 PM

Got it.... maybe I can use this....

 

http://www.arduino.c...In#.Uws9WvmSzoE

 

got to try...

 

cheers...



#5 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 23 February 2014 - 01:32 PM

Much better, it's a shift register and you can probably use SPI to read it. MISO, CLK and CS pin for latching before reeling in the bits. ...or you could use the MCP23S17 chip, it has 16 pins controlled with SPI. With the driver I wrote for it, you can easily create a 16 bit wide parallell databus and just read them all into a single unsigned short variable:
ushort my16bits = bus.Value;
Here's the driver with some examples: http://forums.netdui...17-io-expander/ The driver can also alert you with interrupts whenever any of the 16 pins changes.

#6 Fahdil

Fahdil

    Advanced Member

  • Members
  • PipPipPip
  • 59 posts
  • LocationJakarta, Indonesia

Posted 23 February 2014 - 01:46 PM

absolutely cool.....

 

but... I've using SPI pin to control 16x2LCD display using M74HC595, can I use it together?

 

thanks anyway...



#7 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 23 February 2014 - 05:38 PM

Thanks, glad you liked it! Regarding having multiple SPI devices sharing the same SPI bus as the MCP23S17, I eleborated over that in the post that I made over the driver software: http://forums.netdui...der/#entry56306 Also, I think you need to use the "inhibit" pin or similar on your shift register to sort of turn it off while using the SPI bus for other purposes.

#8 Fahdil

Fahdil

    Advanced Member

  • Members
  • PipPipPip
  • 59 posts
  • LocationJakarta, Indonesia

Posted 23 February 2014 - 10:08 PM   Best Answer

I think, this thread was solved.... as mention by Hanz and andy on the other thread.

 

I will try it once i got those chips. thanks any way.... love this forum so much.....






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.