This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
RPi 3 Pypilot control via GPIO push buttons
#24
I'm sorry for creating confusion.  Vince seems to have taken it from this schematic I posted:

  https://forum.openmarine.net/attachment.php?aid=1078

The pinout is correct for this (and only this) keypad, which has pin 3 as the common.

  https://www.ebay.com.au/itm/302783209954

If anyone else wants to use this keypad, pins are thus (assuming pin 7 is on the right, closest to the POWER button):

 Pin 1: AUTO
 Pin 2: MENU
 Pin 3: LEFT
 Pin 4: POWER
 Pin 5: COMMON
 Pin 6: RIGHT
 Pin 7: LED

(2020-11-26, 08:06 PM)seandepagnier Wrote: the 6 pins on the keypad terminals go to the 5 keys and the first pin is ground, not the third one.

Vince, check out J5 here:

 https://pypilot.org/schematics/tinypilot.pdf

For a 5-key setup, here's how it connects to the RPi:

 https://pypilot.org/wiki/lib/exe/fetch.p...pinout.png

I found this post helpful:

  https://forum.openmarine.net/showthread....5#pid11325

The code in that post has since changed.  Here are the possible commands:

  https://github.com/pypilot/pypilot/blob/...age.py#L18

 AUTO, MENU, SMALL_PORT, SMALL_STARBOARD, SELECT, BIG_PORT, BIG_STARBOARD, TACK, NUDGE_PORT, NUDGE_STARBOARD

And the RPi GPIO numbers are here:

 https://github.com/pypilot/pypilot/blob/...pio.py#L34

  [17, 23, 27, 22, 18, 5, 6, 26]

Putting these together, with the J5 and RPi pin numbers:

FN_NAME         GPIO   RPi_PIN J5_PIN HW_KEY_NAMES
AUTO            GPIO17 11      2      AUTO
MENU            GPIO23 16      3      MENU
SMALL_PORT      GPIO27 13      4      UP
SMALL_STARBOARD GPIO22 5       5      DOWN
SELECT          GPIO18 12      6      SELECT, POWER


J5 pin 1 is the common, which is wired to GND (RPi pin 25) through a 2.4k resistor.

Other functions which can be added with additional keys (ie, not through J5):

FN_NAME         GPIO   RPi_PIN
BIG_PORT        GPIO5  29
BIG_STARBOARD   GPIO6  31
TACK            GPIO26 37


There are two other functions defined in the software, although I can't see how to activate them from hardware:

  NUDGE_PORT
  NUDGE_STARBOARD


The source says "these work from any page (even menu) to dodge":

  https://github.com/pypilot/pypilot/blob/...ge.py#L264

Hope this helps anyone wondering about key interfacing.
Reply


Messages In This Thread
RE: RPi 3 Pypilot control via GPIO push buttons - by CapnKernel - 2020-11-27, 03:30 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)