1.44" 128x128 pi zero hat

Got an idea for a project? Found a cool project you want to share? Post it here!
User avatar
JamesW
Posts: 36
Joined: Wed Sep 27, 2017 4:45 pm
Has thanked: 12 times
Been thanked: 20 times

Re: 1.44" 128x128 pi zero hat

Post by JamesW » Sat Mar 10, 2018 5:38 pm

Here are the things I changed to get the screen and buttons working.

/etc/modprobe.d/fbtft.conf

Code: Select all

# /etc/modprobe.d/fbtft.conf
options fbtft_device name=adafruit18_green gpios=reset:27,dc:25,cs:8,led:24 speed=40000000 bgr=1 fps=60 custom=1 height=128 width=128 rotate=180
/boot/config.txt

Code: Select all

# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=-5
#overscan_right=16
#overscan_top=16
#overscan_bottom=-5

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
dtparam=i2c_arm=off
#dtparam=i2s=on
dtparam=spi=on

# Uncomment this to enable the lirc-rpi module
#dtoverlay=lirc-rpi

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on
gpu_mem_256=128
gpu_mem_512=256
gpu_mem_1024=256
#overscan_scale=1

dtoverlay=pwm-2chan,pin=18,func=2,pin2=13,func2=4
hdmi_force_hotplug=1
hdmi_cvt=128 128 60 1 0 0 0
hdmi_group=2
hdmi_mode=1
hdmi_mode=87
display_rotate=1

#disable uart to boost boot speed
enable_uart=0
start_x=0
/boot/retrogame.cfg

Code: Select all

# Sample configuration file for retrogame.
# Really minimal syntax, typically two elements per line w/space delimiter:
# 1) a key name (from keyTable.h; shortened from /usr/include/linux/input.h).
# 2) a GPIO pin number; when grounded, will simulate corresponding keypress.
# Uses Broadcom pin numbers for GPIO.
# If first element is GND, the corresponding pin (or pins, multiple can be
# given) is a LOW-level output; an extra ground pin for connecting buttons.
# A '#' character indicates a comment to end-of-line.
# File can be edited "live," no need to restart retrogame!

# Here's a pin configuration for the PiGRRL 2 project:

LEFT       5  # Joypad left
RIGHT     26  # Joypad right
UP         6  # Joypad up
DOWN      19  # Joypad down
X         20  # 'A' button
z         16  # 'B' button
#Z        27  # 'X' button
#X        22  # 'Y' button
SPACE     21  # 'Select' button
ENTER     13  # 'Start' button
#A        12  # Left shoulder button
#S        13  # Right shoulder button
#ESC      17  # Exit ROM; PiTFT Button 1
#1        22  # PiTFT Button 2
#2        23  # PiTFT Button 3
#3        27  # PiTFT Button 4

# For configurations with few buttons (e.g. Cupcade), a key can be followed
# by multiple pin numbers.  When those pins are all held for a few seconds,
# this will generate the corresponding keypress (e.g. ESC to exit ROM).
# Only ONE such combo is supported within the file though; later entries
# will override earlier.
/opt/retropie/configs/all/retroarch.cfg (PARTIAL)

Code: Select all

# Keyboard input. Will recognize letters ("a" to "z") and the following special keys (where "kp_"
# is for keypad keys):
#
#   left, right, up, down, enter, kp_enter, tab, insert, del, end, home,
#   rshift, shift, ctrl, alt, space, escape, add, subtract, kp_plus, kp_minus,
#   f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12,
#   num0, num1, num2, num3, num4, num5, num6, num7, num8, num9, pageup, pagedown,
#   keypad0, keypad1, keypad2, keypad3, keypad4, keypad5, keypad6, keypad7, keypad8, keypad9,
#   period, capslock, numlock, backspace, multiply, divide, print_screen, scroll_lock,
#   tilde, backquote, pause, quote, comma, minus, slash, semicolon, equals, leftbracket,
#   backslash, rightbracket, kp_period, kp_equals, rctrl, ralt
#
# Keyboard input, Joypad and Joyaxis will all obey the "nul" bind, which disables the bind completely,
# rather than relying on a default.
input_player1_a = "x"
input_player1_b = "z"
input_player1_y = "a"
input_player1_x = "s"
input_player1_start = "enter"
input_player1_select = "space"
#input_player1_l = "alt"
#input_player1_r = "ctrl"
input_player1_left = "left"
input_player1_right = "right"
input_player1_up = "up"
input_player1_down = "down"
# input_player1_l2 =
# input_player1_r2 =
# input_player1_l3 =
# input_player1_r3 =

HerrOttesen
Posts: 2
Joined: Sat Mar 10, 2018 7:44 am
Has thanked: 1 time
Been thanked: 1 time

Re: 1.44" 128x128 pi zero hat

Post by HerrOttesen » Sun Mar 11, 2018 1:54 am

VideoToGif_GIF.GIF
VideoToGif_GIF.GIF (3.93 MiB) Viewed 512 times
Thank you SO much!!!

egrojselarom
Posts: 1
Joined: Thu May 17, 2018 9:55 pm

Re: 1.44" 128x128 pi zero hat

Post by egrojselarom » Thu May 17, 2018 9:58 pm

plase
you could share you .img

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests