Skip to content

Instantly share code, notes, and snippets.

View Lauszus's full-sized avatar

Kristian Sloth Lauszus Lauszus

View GitHub Profile
@Lauszus
Lauszus / Makefile
Last active January 30, 2018 17:40
Changes to blhost for Mac
#-----------------------------------------------
# Make command:
# make build=<build> all
# <build>: debug or release, release by default.
#-----------------------------------------------
#-----------------------------------------------
# setup variables
# ----------------------------------------------
@Lauszus
Lauszus / pyqtgraph_pyqt5.py
Last active April 22, 2019 02:24
Scatter plot example using pyqtgraph with PyQT5
#!/usr/bin/python3
#
# Scatter plot example using pyqtgraph with PyQT5
#
# Install instructions for Mac:
# brew install pyqt
# pip3 install pyqt5 pyqtgraph
# python3 pyqtgraph_pyqt5.py
import sys
@Lauszus
Lauszus / sixad
Created July 11, 2017 01:04
OSMC PS3 controller via Bluetooth on the Raspberry Pi 3
#!/bin/bash
### BEGIN INIT INFO
# Provides: sixad
# Required-Start: $local_fs $syslog $remote_fs bluetooth
# Required-Stop: $local_fs $syslog $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start sixad
### END INIT INFO
#
M104 S0 ; turn off temperature
M140 S0 ; turn off heatbed
G28 X0 ; home X axis
G1 Y150.0 ; move bed forward
M84 ; disable motors
// Copyright (c) 2008-2014, Andrew Walker
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
@Lauszus
Lauszus / CANBusFilterMaskGenerator.py
Last active October 12, 2023 13:23
Simple script for calculating filter and mask for CAN bus communication
#!/usr/bin/python
#
# Copyright (C) 2018 Kristian Lauszus, Candela. All rights reserved.
#
# Contact information
# -------------------
# Kristian Lauszus
# Web : http://www.lauszus.com
# e-mail : lauszus@gmail.com
@Lauszus
Lauszus / InputAutoCfg.ini
Last active February 17, 2021 23:38
RetroPie configurations for PS3 & PS4 controller
# /opt/retropie/configs/n64/InputAutoCfg.ini
# See: https://github.com/mupen64plus/mupen64plus-input-sdl/blob/master/data/InputAutoCfg.ini
[PLAYSTATION(R)3 Controller]
[Sony PLAYSTATION(R)3 Controller]
[SHENGHIC 2009/0708ZXW-V1Inc. PLAYSTATION(R)3Conteroller]
plugged = True
plugin = 2
mouse = False
AnalogDeadzone = 4096,4096
@Lauszus
Lauszus / SRWS1_RC_PPM.ino
Last active August 22, 2022 08:03
Code for controlling a RC car using a SteelSeries SRW-S1 Steering Wheel
/*
Code for controlling a RC car using a SteelSeries SRW-S1 Steering Wheel - developed by Kristian Lauszus
The PPM signal is connected to the trainer port of a RC transmitter which then sends the signal to the RC car
The SRWS1 library is part of the USB Host Shield library: https://github.com/felis/USB_Host_Shield_2.0
PPM code is based on: https://code.google.com/archive/p/generate-ppm-signal
For more information visit my blog: http://blog.tkjelectronics.dk/ or
send me an e-mail: kristianl@tkjelectronics.com
*/
#include <EEPROM.h> // Include the official EEPROM library
@Lauszus
Lauszus / Xbee_Reciever_RC_Car.ino
Last active February 26, 2016 01:24
Help for Kevin Boatswain
/*
This is a modified version of the PS3BT.ino example sketch by Kristian Lauszus
For more information visit his blog: http://blog.tkjelectronics.dk/ or
send him an e-mail: kristianl@tkjelectronics.com
*/
#include <Servo.h> // Include the Servo library: https://www.arduino.cc/en/reference/servo
Servo servo1, servo2; // Create instances of type Servo. servo1 is the steering servo and servo2 is the ESC.
@Lauszus
Lauszus / Latex.bash
Last active January 21, 2016 21:50
Calculate "normalpages" of Latex report
$ detex Report.tex | echo "scale=3; `wc -m`/2400" | bc -l
$ detex Report.tex | tr -d ' \t\r\n' | echo "scale=3; `wc -m`/2200" | bc -l