Skip to content

Instantly share code, notes, and snippets.

View ajfisher's full-sized avatar

ajfisher ajfisher

View GitHub Profile
@ajfisher
ajfisher / _readme.md
Last active November 21, 2023 16:28
Auto WiFi detection and hotspot creation in boot for RPI

Auto WiFi detection or wifi hostpot creation during boot for RPI

Note: These are rough notes and there may be some variance as versions of raspbian get updated but should be pretty reliable as a guide.

This gist provides some instructions and config in order to have your Raspberry PI automatically connect to a roamed network, however if it fails to discover an available network it will set itself up as a wireless access point for you to connect to.

@ajfisher
ajfisher / .bash_aliases
Last active October 16, 2023 03:30
My vimrc file
alias fritzing='~/fritzing/fritzing-0.8.0b.linux.AMD64/Fritzing'
alias avahi='avahi-browse --all'
@ajfisher
ajfisher / colour_converter.py
Created May 30, 2012 06:56
Convert an 888 RGB value to 565 hex
# Author: Andrew Fisher
# Version: 0.1
# Date: 30/05/2012
# Licence: BSD
# This python converts an rgb value expressed in 8 bit values (eg 255, 128, 0) and returns a hex value that
# has been converted to 565 format. This was highly useful when I was playing with some Arduino
# stuff requiring 16 bit LCD designs and couldn't remember the hex layout.
def rgb_hex565(red, green, blue):
@ajfisher
ajfisher / _PWM for Servos.md
Last active September 12, 2022 17:34
Description of Servo PWM as opposed to normal PWM

Servo PWM vs "Normal" PWM

This started from a chat in the [https://gitter.im/rwaldron/johnny-five](Johnny Five Gitter) and I thought I'd put some notes together because this comes up relatively often as people run into the terminology confusion that is caused by the Servo Manufacturers adopting the term PWM and it's usage amongst the Arduino community in relation to analogWrite().

This is my attempt at an explanation so if I've made any mistakes then please PR and we can make this better for everyone.

Servo is generally served by PWM support, right?

Sort of - PWM is typically a reference to an on/off duty cycle time - if I set my duty cycle to 50% then my pulses are on for 50% of the time and off for 50% of the time. If it's 10% then it's on 10% of the time, off 90%.

@ajfisher
ajfisher / a_nodebot_over_wifi.md
Last active April 21, 2022 23:57
WiFi your nodebot

Taking your nodebot wifi

Controlling your nodebot using a USB cable is great and all, and obviously you could shell out and grab a sparkcore or some other dedicated controller but what if you've got a standard arduino and you want to take an existing nodebot wireless?

Bluetooth is an option and there's this excellent JohnnyFive wiki entry that will help you there. Bluetooth can be a bit flaky though and it's range is pretty lousy. You can also look at things like XBees and what not using point to point serial, but these are expensive and very fiddly to get working.

Really, what we want is a method of transferring data over a nice, simple, standard method, requiring little configuration, low cost and we can utilise a whole stack of the code we've already produced.

Enter the WiFi232 module. These little beauties are [available from AliExpress for $12 each](http://www.aliexpress.com/item/USR-WIFI232-T-wifi-to-uart-tt

@ajfisher
ajfisher / 0x00000.bin
Last active October 10, 2021 00:51
ESP8266 Transparent bridge to J5
@ajfisher
ajfisher / _Ping I2C Johnny Five backpack.md
Last active March 24, 2021 16:20
Building an I2C backpack for HC-SR04 ultrasonic sensor

Building an ultrasonic sensor backpack

Note: This is a bit of a scratch to see what's involved in getting the ping sensor to work as an I2C backpack.

Acknowledgements

Dependencies.

@ajfisher
ajfisher / tsasa.py
Created January 15, 2012 09:50
Send a twitter message to a serial connection on an arduino
# Twitter stream analyser and serial activator (TSASA)
#
# This script analyses a twitter stream for keywords using the twitter
# streaming api - off the back of it, it then makes a serial request passing
# the message across to the serial device
#
# This was done fopr LCA2012 as an extension to the more code generator that
# Luke Weston build for the LeoStick
#
#
@ajfisher
ajfisher / _Minecraft setup.md
Last active February 24, 2021 13:01
Minecraft Server on Raspberry Pi Set up scripts

Set up scripts for Minecraft server on Raspberry Pi

@ajfisher
ajfisher / gist:1061793
Created July 2, 2011 23:48
Make an RGB LED show different colours based on range finder distance
/*
WARMER COOLER GAME
Use a ping sensor to determine distance and then depending on the distance,
show warmer or cooler colours.
Built using a ping))) Sensor and connected to a RGB display.
Uses the ping))) example in the base Arduino install, written by David Mellis & Tom Igoe
http://www.arduino.cc/en/Tutorial/Ping