Skip to content

Instantly share code, notes, and snippets.

View benjjo's full-sized avatar
💣

Ben McGUffog benjjo

💣
View GitHub Profile
@benjjo
benjjo / shiftOutDisplay
Last active July 1, 2019 18:09
Shiftbit registers can be a little tricky to setup so I designed this simple Hello World code for doing just that. This example uses a 74HC595 Shift Register in conjunction with a common anode seven segment display. This code is designed to shift the "HIGH" value on the Shift Bit Register from Q0-Q7. This is achieved by sending the values 1,2,4,…
/*
********************************************************************
Name : shiftOutDisplay, Test code
Author : Benjo Charlie
Date : 13 Sept, 2013
Version : 1.0
Notes : Shiftbit registers can be a little tricky to setup so I
: designed this simple Hello World code for doing just that.
: This example uses a 74HC595 Shift Bit Register in conjunction
: with a common anode seven segment display.
@benjjo
benjjo / shiftOutAnalogueDisplay
Created September 14, 2013 06:52
This is an adaptation of the ReadAnalogVoltage tutorial. The idea is to map the analogue input voltage and display that mapped value on a 7 segment display via a shiftbit register.
/*
********************************************************************
Name : shiftOutAnalogueDisplay, Test code
Author : Benjo Charlie
Date : 13 Sept, 2013
Version : 1.0
Notes : This is an adaptation of the ReadAnalogVoltage tutorial.
:
: The idea is to map the analogue input voltage and display that
: mapped value on a 7 segment display via a shiftbit register.
@benjjo
benjjo / piDwarf.py
Last active November 25, 2016 01:03
Minecraft Pi Raspberry Pi. A tunnel building program for the avid Dwarf.
#!/usr/bin/python3.4
#-----------------------------------------------------------------------------------------------
# Name: A tunnel building program for the avid Minecraft Pi dwarf.
# Purpose: Designed to build descending, ascending and straight tunnels in Minecraft Pi.
# This is written very simply for debugging/learning purposes.
# Most of this code is designed to handle user input.
# Eventually this will be integrated into a user interface with QT and pyQT.
# Version: Development
# Author: benjo charlie
# Created: 2016
@benjjo
benjjo / piCompass.py
Created November 20, 2016 04:04
Minecraft Pi compass. Designed to indicate NORTH with a red block and SOUTH with a black block.
#!/usr/bin/python3.4
#--------------------------------------------------------------------------
# Name: A simple compass for Minecraft Pi
# Purpose: Designed to indicate NORTH with a red block and SOUTH with
# a black block.
# Author: benjo charlie
# Created: 2016
#--------------------------------------------------------------------------
# Import libraries and set up the globals
@benjjo
benjjo / StairBlocks.csv
Last active November 20, 2016 06:06
CSV of Minecraft Pi stair blocks
BRICK_STAIRS 108
COBBLESTONE_STAIRS 67
NETHER_BRICK_STAIRS 114
OAK_STAIRS 53
OAK_STAIRS 59
QUARTZ_STAIRS 156
SANDSTONE_STAIRS 128
STONE_BRICK_STAIRS 109
STONE_STAIRS 67
WOOD_STAIRS 53
@benjjo
benjjo / BuildingBlocks.csv
Last active November 20, 2016 06:05
CSV list of Minecraft Pi building blocks
AIR 0
BEDROCK 7
BEDROCK_INVISIBLE 95
BRICK_BLOCK 45
CHEST 54
CLAY 82
COAL_ORE 16
COBBLESTONE 4
CRAFTING_TABLE 58
DIAMOND_BLOCK 57
@benjjo
benjjo / mcpichat.py
Last active November 23, 2016 18:56 — forked from PieCoder314/mcpichat.py
A script for Minecraft Pi Edition that adds a chat box.
#/usr/bin/python3.4
#----------Minecraft Pi Chat---------#
#-----------By PieCoder314-----------#
#---Bringing chat to minecraft pi!---#
# Credit to: PieCoder314/mcpichat.py #
from mcpi import minecraft
mc = minecraft.Minecraft.create()
mc.postToChat("Go to python shell to chat.")
@benjjo
benjjo / dwarfQuoter.py
Last active December 25, 2016 18:11
A random Dwarf quote generator. To help understand Python CLASS objects
#!/usr/bin/python
from random import randrange
class Axe(object):
def __init__(self):
self.start = "Schist!"
def gimli(self):
@benjjo
benjjo / building_blocks.py
Created December 4, 2016 23:35
Minecraft Pi Dictionary list of useble building blocks.
building_blocks = {
'AIR': 0,
'BEDROCK': 7,
'BEDROCK_INVISIBLE': 95,
'BRICK_BLOCK': 45,
'CHEST': 54,
'CLAY': 82,
'COAL_ORE': 16,
'COBBLESTONE': 4,
'CRAFTING_TABLE': 58,
@benjjo
benjjo / stair_blocks.py
Created December 4, 2016 23:35
Minecraft Pi Dictionary list of useble stairs blocks.
stair_blocks = {
'BRICK_STAIRS': 108,
'COBBLESTONE_STAIRS': 67,
'NETHER_BRICK_STAIRS': 114,
'OAK_STAIRS': 53,
'OAK_STAIRS2': 59,
'QUARTZ_STAIRS': 156,
'SANDSTONE_STAIRS': 128,
'STONE_BRICK_STAIRS': 109,
'STONE_STAIRS': 67,