Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

It seems even the Internet has trouble finding a solution for this. Here's some from retropie and sixad that actually bypass the default bluetooth toolset and it actually works:

Reference 1(Part: For older versions of RetroPie) Reference 2

Ignore all the tutorials about using bluetoothctl, they won't work as the PS3 controller will keep connecting and disconnecting. You might managed to connect it using bluetoothctl in a Pi but definitely Nano is different.

  1. Start with sixpair, you'll need to do this usb-pairing first. Connect the PS3 controller via USB, you don't have to press any buttons yet.
wget http://www.pabr.org/sixlinux/sixpair.c
@fengye
fengye / instructions.md
Last active June 24, 2021 23:54
Setting up Jetson Nano's VNC and Resolution
@fengye
fengye / ArduBerry.md
Last active January 21, 2021 07:57
Revive ArduBerry in Raspberry Pi 4 and Buster

Overview

The ArduBerry is obsolete while looks handy I want to give it a try. The official installer only partially work: https://github.com/DexterInd/ArduBerry/blob/master/Script/install.sh It lacks:

  1. proper up-to-date WiringPi(they use 2.36 which doesn't recognise Pi 4B)
  2. avrdude and /etc/avrdude.conf needs to be updated.
  3. Arduino installer on buster, along with programmers.txt configuration
  4. udev rules not copied to /etc/udev/rules.d/
  5. does NOT turn off SPI in /boot/config.txt so that avrdude cannot talk to GPIO8 and GPIO9
Pin from ESC(TEU-105BK) to radio receiver(TRU-08):
Red = + voltage(from ESC to receiver)
Black = - voltage(from ESC to receiver)
White = driving signal(from receiver to ESC)
ESC(TEU-105BK) driving signal:
PWM frequency: 57.67Hz (Cycle=17.34ms)
Duty cycle(neutral): 1500us _|~~~|______________________________________________
Duty cycle(full forward): 1100us _|~~|_______________________________________________
Duty cycle(full reverse): 1900us _|~~~~|_____________________________________________
@fengye
fengye / parse.py
Created December 15, 2019 12:46
Parse Google Photo takeout and categories them into date-named folders
#!/usr/bin/env python3
from glob import glob
import os.path
import os
import re
import json
import datetime
import shutil
class PhotoEntry:
@fengye
fengye / rename_to_lowercase.py
Created January 12, 2020 04:34
Rename All Files to Lowercase Recursively
#!/usr/bin/python3
import os
from pathlib import Path
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('directory', metavar='D', help='The working directory')
args = parser.parse_args()
@fengye
fengye / check_wifi.sh
Created September 29, 2019 06:23
Raspberry Pi constantly drop wifi and won't be able to reconnect itself. Run this script on a cron job on a regular basis to keep headless pi connected.
#!/bin/bash
#=================================================================
# Script Variables Settings
wlan='wlx801f02b56d73'
gateway='192.168.0.1'
alias ifup='/sbin/ifup'
alias ifdown='/sbin/ifdown'
alias ifconfig='/sbin/ifconfig'
#=================================================================
date
@fengye
fengye / unimap_cpp_v3.c
Last active August 10, 2019 05:21
HHKB keymapping for C++ programmers V3
#include "unimap_trans.h"
#include "print.h"
enum macro_id {
CPP_POINTER,
CPP_COMMENT,
L3_QUOTE,
L3_MINUS,
L3_LBRACKET,
L3_RBRACKET,
@fengye
fengye / build_latest_spigot.sh
Created August 9, 2019 20:39
Find and build latest spigot minecraft server, suitable for daily or periodic build
#!/bin/bash
latest=$(python find_latest_spigot.py)
stored_latest=$(<latest.txt)
echo Last stored Spigot version $stored_latest
if [ $stored_latest == $latest ]; then
echo Latest version $latest remains unchanged, not building.
else
echo Building Spigot version $latest
echo $latest > latest.txt
java -Xmx1024M -jar BuildTools.jar --output-dir ./daily_build/ --rev $latest
@fengye
fengye / unimap_cpp_v2.c
Last active July 27, 2019 12:31
HHKB for C++ programmers v2
#include "unimap_trans.h"
#include "print.h"
enum macro_id {
CPP_POINTER,
CPP_COMMENT,
L3_QUOTE,
L3_MINUS,
L3_LBRACKET,
L3_RBRACKET,