Skip to content

Instantly share code, notes, and snippets.

View Lauszus's full-sized avatar

Kristian Sloth Lauszus Lauszus

View GitHub Profile
@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.
// 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 / 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: kristianl@tkjelectronics.com
*/
#include <PS3BT.h>
#include <SPI.h>
#include <Servo.h>
M104 S0 ; turn off temperature
M140 S0 ; turn off heatbed
G28 X0 ; home X axis
G1 Y150.0 ; move bed forward
M84 ; disable motors
@Lauszus
Lauszus / gist:5019719
Created February 23, 2013 13:23
Avrdude write to eeprom
avrdude -p m644 -c usbasp -t
avrdude> write eeprom 0x00 0x00 0x20 0x41 0x00 0x00 0x80 0x3f 0x00 0x00 0x40 0x40 0x00 0x00 0x35 0x43
avrdude> dump eeprom 0 15
@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
#
@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 / install-8192eu.sh
Created February 1, 2018 13:12
Small script for downloading and installing the drivers for the Realtek RTL8192EU WiFi adapter from http://fars-robotics.net
#!/bin/bash -e
kernel=$(uname -r | tr -d '+')
build=${build:-$(uname -v | awk '{print $1}' | tr -d '#')}
tarfile=8192eu-$kernel-$build.tar.gz
wget http://fars-robotics.net/$tarfile
tar xzf $tarfile
./install.sh
@Lauszus
Lauszus / script.sh
Created March 10, 2018 21:31
Automount bootcamp as needed for VirtualBox
#!/bin/bash -e
diskutil list
read -p $'This script will unmount "/Volumes/BOOTCAMP" and set the permission for the EFI (/dev/disk0s1) and BOOTCAMP (/dev/disk0s3) permissions to executable\nPress enter to continue'
diskutil unmount /Volumes/BOOTCAMP
sudo chmod 777 /dev/disk0s1
sudo chmod 777 /dev/disk0s3