A keyboard without function!

The great escape!

The day I lost control!

Controlling a 7 segment 4 digit display with a Raspberry Pi

This instructable I made shows how to control a display.
Here is how:
The pins are connected to the Pi through a resistor and some directly.
See the diagram for details and pin positionnement above.

The python modules; time and RPI.GPIO are required for this code.


import RPi.GPIO as GPIO
import time

GPIO.setup(7, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
segments = (24,12,19,21,23,22,15,11)
for segment in segments:
GPIO.setup(segment, GPIO.OUT)
GPIO.output(segment, 0)
digits = (26,18,16,13)
for digit in digits:
GPIO.setup(digit, GPIO.OUT)
GPIO.output(digit, 1)
num = {' ':(0,0,0,0,0,0,0),
while True:
n = time.ctime()[11:13]+time.ctime()[14:16]
s = str(n).rjust(4)
for digit in range(4):
for loop in range(0,7):
GPIO.output(segments[loop], num[s[digit]][loop])
if (int(time.ctime()[18:19])%2 == 0) and (digit == 1)
GPIO.output(11, 1)
GPIO.output(11, 0)
GPIO.output(digits[digit], 0)
GPIO.output(digits[digit], 1)
except KeyboardInterrupt:

And we are done!
This will be a clock.
Have fun!


Today I came upon Brython.
Which is python on web browsers.
This is python 3.
This is similar to codeskulptor (see codeskulptor testing)
To embed a console on a page use this script:
<iframe src="http://brython.info/console.html" width=800 height=400></iframe>
I hope you enjoy this.
Here is a console:

Minecraft Pi with stepper motor...

I am trying to do a minecraft program to turn the stepper motor (http://www.techni.ca/2013/10/stepper-motor-controller.html) so that I import that module as motor and call motor.clockwise(1, 500) or motor.anticlockwise(1, 500) when you move side to side.
Maybe something like this http://www.stuffaboutcode.com/2013/03/raspberry-pi-minecraft-snake.html.
I appreciate all help :)
And one more thing... IN PYTHON.

Python in HTML


<title>Python in HTML</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js" type="text/javascript"></script>
<script src="http://www.skulpt.org/static/skulpt.min.js" type="text/javascript"></script>
<script src="http://www.skulpt.org/static/skulpt-stdlib.js" type="text/javascript"></script>

<script type="text/javascript">
// output functions are configurable.  This one just appends some text
// to a pre element.
function outf(text) {
var mypre = document.getElementById("output");
mypre.innerHTML = mypre.innerHTML   text;
function builtinRead(x) {
if (Sk.builtinFiles === undefined || Sk.builtinFiles["files"][x] === undefined)
throw "File not found: '"   x   "'";
return Sk.builtinFiles["files"][x];

// Here's everything you need to run a python program in skulpt
// grab the code from your textarea
// get a reference to your pre element for output
// configure the output function
// call Sk.importMainWithBody()
function runit() {
var prog = document.getElementById("yourcode").value;
var mypre = document.getElementById("output");
mypre.innerHTML = '';
Sk.canvas = "mycanvas";
Sk.pre = "output";
Sk.configure({output:outf, read:builtinRead});

<h3>Write Python!</h3>
<textarea id="yourcode" cols="40" rows="10">
#Type your code here
</textarea><br />
<button type="button" onclick="runit()">Run</button>
<pre id="output" ></pre>
<!-- If you want turtle graphics include a canvas -->
<canvas id="mycanvas" ></canvas>

Above is the code for putting python in html.
Copy-Paste this into a text edit program and save it as a .html file then oepn it in a browser.

Vote for me please

Please vote for me on instructables at this link: