Skip to content

Instantly share code, notes, and snippets.

View Lauszus's full-sized avatar

Kristian Sloth Lauszus Lauszus

View GitHub Profile
@Lauszus
Lauszus / BalancingRobotFullSize.ino
Last active May 27, 2016 03:55
BalancingRobotFullSize version for Sabertooth in simplified serial mode
/* Copyright (C) 2014 Kristian Lauszus, TKJ Electronics. All rights reserved.
This software may be distributed and modified under the terms of the GNU
General Public License version 2 (GPL2) as published by the Free Software
Foundation and appearing in the file GPL2.TXT included in the packaging of
this file. Please note that GPL2 Section 2[b] requires that all works based
on this software must also be made publicly available under the terms of
the GPL2 ("Copyleft").
Contact information
@Lauszus
Lauszus / Kendall.ino
Last active January 16, 2017 00:45
Example for controlling a servo using a PS3 controller
/*
Example sketch for the PS3 Bluetooth library - developed by Kristian Lauszus
For more information visit my blog: http://blog.tkjelectronics.dk/ or
send me an e-mail: [email protected]
*/
#include <PS3BT.h>
#include <SPI.h>
#include <Servo.h>
#if 0 // Right
#define PWM 9
#define DIR 8
#define PIN_REG COM1A1
#define PWM_REG OCR1A
#else // Left
#define PWM 10
#define DIR 12
@Lauszus
Lauszus / ZomBuster.sh
Last active June 3, 2018 14:09
Install OpenCV on minimal Raspbian image for use with: https://github.com/Lauszus/ImageAnalysisWithMicrocomputer30330
#!/bin/bash -e
gpio mode 8 up # Input with internal pull-up resistor
#echo "Compiling..."
#make -C ~/ImageAnalysisWithMicrocomputer30330/ZomBuster/src 1> /dev/null
echo "Press button to start"
while true; do
while [ $(gpio read 8) == 1 ]; do
@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
@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: [email protected]
*/
#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 / 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: [email protected]
*/
#include <EEPROM.h> // Include the official EEPROM library
@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 / CANBusFilterMaskGenerator.py
Last active February 22, 2025 06:53
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 : [email protected]
// 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