wget https://pypi.python.org/packages/source/R/RPi.GPIO/RPi.GPIO-0.5.3a.tar.gz
tar xvf RPi.GPIO-0.5.3a.tar.gz
cd RPi.GPIO-0.5.3a/
sudo python setup.py install
source/py_gpio.c:23:20: fatal error: Python.h: No such file or directory
sudo apt-get install python-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libexpat1-dev python2.7-dev
The following NEW packages will be installed:
libexpat1-dev python-dev python2.7-dev
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 28.9 MB of archives.
After this operation, 36.0 MB of additional disk space will be used.
Do you want to continue [Y/n]?
Err http://mirrordirector.raspbian.org/raspbian/ wheezy/main python-dev all 2.7.3-4
404 Not Found
Get:1 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libexpat1-dev armhf 2.1.0-1 [210 kB]
Get:2 http://mirrordirector.raspbian.org/raspbian/ wheezy/main python2.7-dev armhf 2.7.3-6 [28.7 MB]
Fetched 28.9 MB in 5min 16s (91.4 kB/s)
Failed to fetch http://mirrordirector.raspbian.org/raspbian/pool/main/p/python-defaults/python-dev_2.7.3-4_all.deb 404 Not Found
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install python-dev
sudo python setup.py install
#!/usr/bin/python
import time
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
GPIO.setup(11, GPIO.IN)
while True:
mybutton = GPIO.input(11)
if mybutton == False:
print "giggle"
time.sleep(.2)
sudo python gpio.py
// Teensy 3.0 has the LED on pin 13
const int ledPinSeg1DOT = 13;
const int ledPinSeg2 = 14;
const int ledPinSeg3 = 16;
const int ledPinSeg4 = 19;
const int ledPinSeg5 = 23;
const int ledPinSeg6 = 12;
const int ledPinSeg7 = 9;
const int ledPinSeg8 = 5;
int count=0;
// the setup() method runs once, when the sketch starts
void setup() {
// initialise the digital pin as an output.
pinMode(ledPinSeg1DOT, OUTPUT);
pinMode(ledPinSeg2, OUTPUT);
pinMode(ledPinSeg3, OUTPUT);
pinMode(ledPinSeg4, OUTPUT);
pinMode(ledPinSeg5, OUTPUT);
pinMode(ledPinSeg6, OUTPUT);
pinMode(ledPinSeg7, OUTPUT);
pinMode(ledPinSeg8, OUTPUT);
Serial.begin(38400);
Serial.println("Let us begin");
}
// the loop() method runs over and over again,
// as long as the board has power
void loop() {
///////////////////////// 9
//digitalWrite(ledPinSeg1DOT, HIGH); // set the LED on
digitalWrite(ledPinSeg2, HIGH); // set the LED on
digitalWrite(ledPinSeg3, HIGH); // set the LED on
digitalWrite(ledPinSeg4, HIGH); // set the LED on
//digitalWrite(ledPinSeg5, HIGH); // set the LED on
digitalWrite(ledPinSeg6, HIGH); // set the LED on
digitalWrite(ledPinSeg7, HIGH); // set the LED on
digitalWrite(ledPinSeg8, HIGH); // set the LED on
/////////////////////////
delay(500);
digitalWrite(ledPinSeg1DOT, LOW); // set the LED off
digitalWrite(ledPinSeg2, LOW); // set the LED off
digitalWrite(ledPinSeg3, LOW); // set the LED off
digitalWrite(ledPinSeg4, LOW); // set the LED off
digitalWrite(ledPinSeg5, LOW); // set the LED off
digitalWrite(ledPinSeg6, LOW); // set the LED off
digitalWrite(ledPinSeg7, LOW); // set the LED off
digitalWrite(ledPinSeg8, LOW); // set the LED off
//////////////////////// 8
//digitalWrite(ledPinSeg1DOT, HIGH); // set the LED on
digitalWrite(ledPinSeg2, HIGH); // set the LED on
digitalWrite(ledPinSeg3, HIGH); // set the LED on
digitalWrite(ledPinSeg4, HIGH); // set the LED on
digitalWrite(ledPinSeg5, HIGH); // set the LED on
digitalWrite(ledPinSeg6, HIGH); // set the LED on
digitalWrite(ledPinSeg7, HIGH); // set the LED on
digitalWrite(ledPinSeg8, HIGH); // set the LED on
////////////////////////
delay(500);
digitalWrite(ledPinSeg1DOT, LOW); // set the LED off
digitalWrite(ledPinSeg2, LOW); // set the LED off
digitalWrite(ledPinSeg3, LOW); // set the LED off
digitalWrite(ledPinSeg4, LOW); // set the LED off
digitalWrite(ledPinSeg5, LOW); // set the LED off
digitalWrite(ledPinSeg6, LOW); // set the LED off
digitalWrite(ledPinSeg7, LOW); // set the LED off
digitalWrite(ledPinSeg8, LOW); // set the LED off
//////////////////////// 7
//digitalWrite(ledPinSeg1DOT, HIGH); // set the LED on
digitalWrite(ledPinSeg2, HIGH); // set the LED on
digitalWrite(ledPinSeg3, HIGH); // set the LED on
//digitalWrite(ledPinSeg4, HIGH); // set the LED on
//digitalWrite(ledPinSeg5, HIGH); // set the LED on
//digitalWrite(ledPinSeg6, HIGH); // set the LED on
digitalWrite(ledPinSeg7, HIGH); // set the LED on
digitalWrite(ledPinSeg8, HIGH); // set the LED on
////////////////////////
delay(500);
digitalWrite(ledPinSeg1DOT, LOW); // set the LED off
digitalWrite(ledPinSeg2, LOW); // set the LED off
digitalWrite(ledPinSeg3, LOW); // set the LED off
digitalWrite(ledPinSeg4, LOW); // set the LED off
digitalWrite(ledPinSeg5, LOW); // set the LED off
digitalWrite(ledPinSeg6, LOW); // set the LED off
digitalWrite(ledPinSeg7, LOW); // set the LED off
digitalWrite(ledPinSeg8, LOW); // set the LED off
//////////////////////// 6
//digitalWrite(ledPinSeg1DOT, HIGH); // set the LED on
digitalWrite(ledPinSeg2, HIGH); // set the LED on
digitalWrite(ledPinSeg3, HIGH); // set the LED on
digitalWrite(ledPinSeg4, HIGH); // set the LED on
digitalWrite(ledPinSeg5, HIGH); // set the LED on
digitalWrite(ledPinSeg6, HIGH); // set the LED on
//digitalWrite(ledPinSeg7, HIGH); // set the LED on
digitalWrite(ledPinSeg8, HIGH); // set the LED on
////////////////////////
delay(500);
digitalWrite(ledPinSeg1DOT, LOW); // set the LED off
digitalWrite(ledPinSeg2, LOW); // set the LED off
digitalWrite(ledPinSeg3, LOW); // set the LED off
digitalWrite(ledPinSeg4, LOW); // set the LED off
digitalWrite(ledPinSeg5, LOW); // set the LED off
digitalWrite(ledPinSeg6, LOW); // set the LED off
digitalWrite(ledPinSeg7, LOW); // set the LED off
digitalWrite(ledPinSeg8, LOW); // set the LED off
//////////////////////// 5
//digitalWrite(ledPinSeg1DOT, HIGH); // set the LED on
digitalWrite(ledPinSeg2, HIGH); // set the LED on
digitalWrite(ledPinSeg3, HIGH); // set the LED on
digitalWrite(ledPinSeg4, HIGH); // set the LED on
//digitalWrite(ledPinSeg5, HIGH); // set the LED on
digitalWrite(ledPinSeg6, HIGH); // set the LED on
//digitalWrite(ledPinSeg7, HIGH); // set the LED on
digitalWrite(ledPinSeg8, HIGH); // set the LED on
////////////////////////
delay(500);
digitalWrite(ledPinSeg1DOT, LOW); // set the LED off
digitalWrite(ledPinSeg2, LOW); // set the LED off
digitalWrite(ledPinSeg3, LOW); // set the LED off
digitalWrite(ledPinSeg4, LOW); // set the LED off
digitalWrite(ledPinSeg5, LOW); // set the LED off
digitalWrite(ledPinSeg6, LOW); // set the LED off
digitalWrite(ledPinSeg7, LOW); // set the LED off
digitalWrite(ledPinSeg8, LOW); // set the LED off
//////////////////////// 4
//digitalWrite(ledPinSeg1DOT, HIGH); // set the LED on
//digitalWrite(ledPinSeg2, HIGH); // set the LED on
digitalWrite(ledPinSeg3, HIGH); // set the LED on
digitalWrite(ledPinSeg4, HIGH); // set the LED on
//digitalWrite(ledPinSeg5, HIGH); // set the LED on
//digitalWrite(ledPinSeg6, HIGH); // set the LED on
digitalWrite(ledPinSeg7, HIGH); // set the LED on
digitalWrite(ledPinSeg8, HIGH); // set the LED on
////////////////////////
delay(500);
digitalWrite(ledPinSeg1DOT, LOW); // set the LED off
digitalWrite(ledPinSeg2, LOW); // set the LED off
digitalWrite(ledPinSeg3, LOW); // set the LED off
digitalWrite(ledPinSeg4, LOW); // set the LED off
digitalWrite(ledPinSeg5, LOW); // set the LED off
digitalWrite(ledPinSeg6, LOW); // set the LED off
digitalWrite(ledPinSeg7, LOW); // set the LED off
digitalWrite(ledPinSeg8, LOW); // set the LED off
//////////////////////// 3
//digitalWrite(ledPinSeg1DOT, HIGH); // set the LED on
digitalWrite(ledPinSeg2, HIGH); // set the LED on
//digitalWrite(ledPinSeg3, HIGH); // set the LED on
digitalWrite(ledPinSeg4, HIGH); // set the LED on
//digitalWrite(ledPinSeg5, HIGH); // set the LED on
digitalWrite(ledPinSeg6, HIGH); // set the LED on
digitalWrite(ledPinSeg7, HIGH); // set the LED on
digitalWrite(ledPinSeg8, HIGH); // set the LED on
////////////////////////
delay(500);
digitalWrite(ledPinSeg1DOT, LOW); // set the LED off
digitalWrite(ledPinSeg2, LOW); // set the LED off
digitalWrite(ledPinSeg3, LOW); // set the LED off
digitalWrite(ledPinSeg4, LOW); // set the LED off
digitalWrite(ledPinSeg5, LOW); // set the LED off
digitalWrite(ledPinSeg6, LOW); // set the LED off
digitalWrite(ledPinSeg7, LOW); // set the LED off
digitalWrite(ledPinSeg8, LOW); // set the LED off
//////////////////////// 2
//digitalWrite(ledPinSeg1DOT, HIGH); // set the LED on
digitalWrite(ledPinSeg2, HIGH); // set the LED on
//digitalWrite(ledPinSeg3, HIGH); // set the LED on
digitalWrite(ledPinSeg4, HIGH); // set the LED on
digitalWrite(ledPinSeg5, HIGH); // set the LED on
digitalWrite(ledPinSeg6, HIGH); // set the LED on
digitalWrite(ledPinSeg7, HIGH); // set the LED on
//digitalWrite(ledPinSeg8, HIGH); // set the LED on
////////////////////////
delay(500);
digitalWrite(ledPinSeg1DOT, LOW); // set the LED off
digitalWrite(ledPinSeg2, LOW); // set the LED off
digitalWrite(ledPinSeg3, LOW); // set the LED off
digitalWrite(ledPinSeg4, LOW); // set the LED off
digitalWrite(ledPinSeg5, LOW); // set the LED off
digitalWrite(ledPinSeg6, LOW); // set the LED off
digitalWrite(ledPinSeg7, LOW); // set the LED off
digitalWrite(ledPinSeg8, LOW); // set the LED off
//////////////////////// 1
//digitalWrite(ledPinSeg1DOT, HIGH); // set the LED on
//digitalWrite(ledPinSeg2, HIGH); // set the LED on
//digitalWrite(ledPinSeg3, HIGH); // set the LED on
//digitalWrite(ledPinSeg4, HIGH); // set the LED on
//digitalWrite(ledPinSeg5, HIGH); // set the LED on
//digitalWrite(ledPinSeg6, HIGH); // set the LED on
digitalWrite(ledPinSeg7, HIGH); // set the LED on
digitalWrite(ledPinSeg8, HIGH); // set the LED on
////////////////////////
delay(500);
digitalWrite(ledPinSeg1DOT, LOW); // set the LED off
digitalWrite(ledPinSeg2, LOW); // set the LED off
digitalWrite(ledPinSeg3, LOW); // set the LED off
digitalWrite(ledPinSeg4, LOW); // set the LED off
digitalWrite(ledPinSeg5, LOW); // set the LED off
digitalWrite(ledPinSeg6, LOW); // set the LED off
digitalWrite(ledPinSeg7, LOW); // set the LED off
digitalWrite(ledPinSeg8, LOW); // set the LED off
//////////////////////// 0
//digitalWrite(ledPinSeg1DOT, HIGH); // set the LED on
digitalWrite(ledPinSeg2, HIGH); // set the LED on
digitalWrite(ledPinSeg3, HIGH); // set the LED on
//digitalWrite(ledPinSeg4, HIGH); // set the LED on
digitalWrite(ledPinSeg5, HIGH); // set the LED on
digitalWrite(ledPinSeg6, HIGH); // set the LED on
digitalWrite(ledPinSeg7, HIGH); // set the LED on
digitalWrite(ledPinSeg8, HIGH); // set the LED on
////////////////////////
delay(500);
digitalWrite(ledPinSeg1DOT, LOW); // set the LED off
digitalWrite(ledPinSeg2, LOW); // set the LED off
digitalWrite(ledPinSeg3, LOW); // set the LED off
digitalWrite(ledPinSeg4, LOW); // set the LED off
digitalWrite(ledPinSeg5, LOW); // set the LED off
digitalWrite(ledPinSeg6, LOW); // set the LED off
digitalWrite(ledPinSeg7, LOW); // set the LED off
digitalWrite(ledPinSeg8, LOW); // set the LED off
//////////////////////// .
digitalWrite(ledPinSeg1DOT, HIGH); // set the LED on
//digitalWrite(ledPinSeg2, HIGH); // set the LED on
//digitalWrite(ledPinSeg3, HIGH); // set the LED on
//digitalWrite(ledPinSeg4, HIGH); // set the LED on
//digitalWrite(ledPinSeg5, HIGH); // set the LED on
//digitalWrite(ledPinSeg6, HIGH); // set the LED on
//digitalWrite(ledPinSeg7, HIGH); // set the LED on
//digitalWrite(ledPinSeg8, HIGH); // set the LED on
////////////////////////
delay(2500);
// Track animation
for (int i=0;i<10;i++) {
digitalWrite(ledPinSeg5, HIGH); // set the LED on
delay(100);
digitalWrite(ledPinSeg5, LOW); // set the LED off
digitalWrite(ledPinSeg3, HIGH); // set the LED on
delay(100);
digitalWrite(ledPinSeg3, LOW); // set the LED off
digitalWrite(ledPinSeg2, HIGH); // set the LED on
delay(100);
digitalWrite(ledPinSeg2, LOW); // set the LED off
digitalWrite(ledPinSeg7, HIGH); // set the LED on
delay(100);
digitalWrite(ledPinSeg7, LOW); // set the LED off
digitalWrite(ledPinSeg8, HIGH); // set the LED on
delay(100);
digitalWrite(ledPinSeg8, LOW); // set the LED off
digitalWrite(ledPinSeg6, HIGH); // set the LED on
delay(100);
digitalWrite(ledPinSeg6, LOW); // set the LED off
}
digitalWrite(ledPinSeg4, HIGH); // set the LED on
delay(100);
digitalWrite(ledPinSeg4, LOW); // set the LED off
// "Dance" animation
for (int i=0;i<15;i++) {
digitalWrite(ledPinSeg2, HIGH); // set the LED on
delay(100);
digitalWrite(ledPinSeg2, LOW); // set the LED off
digitalWrite(ledPinSeg4, HIGH); // set the LED on
delay(100);
digitalWrite(ledPinSeg4, LOW); // set the LED off
digitalWrite(ledPinSeg6, HIGH); // set the LED on
delay(100);
digitalWrite(ledPinSeg6, LOW); // set the LED off
digitalWrite(ledPinSeg3, HIGH); // set the LED on
delay(100);
digitalWrite(ledPinSeg3, LOW); // set the LED off
digitalWrite(ledPinSeg8, HIGH); // set the LED on
delay(100);
digitalWrite(ledPinSeg8, LOW); // set the LED off
digitalWrite(ledPinSeg7, HIGH); // set the LED on
delay(100);
digitalWrite(ledPinSeg7, LOW); // set the LED off
digitalWrite(ledPinSeg5, HIGH); // set the LED on
delay(100);
digitalWrite(ledPinSeg5, LOW); // set the LED off
}
delay(2500);
count++;
Serial.println(count,DEC);
}
// Teensy 3.0 has the LED on pin 13
const int ledPin1 = 13;
const int ledPin2 = 14;
const int ledPin3 = 15;
// the setup() method runs once, when the sketch starts
void setup() {
// initialise the digital pins as an output.
pinMode(ledPin1, OUTPUT);
pinMode(ledPin2, OUTPUT);
pinMode(ledPin3, OUTPUT);
Serial.begin(38400);
Serial.println("Pins initialised");
}
// the loop() method runs over and over again,
// as long as the board has power
void loop() {
digitalWrite(ledPin1, HIGH); // set the LED on
delay(200);
digitalWrite(ledPin1, LOW); // set the LED off
digitalWrite(ledPin2, HIGH); // set the LED on
delay(200);
digitalWrite(ledPin2, LOW); // set the LED off
digitalWrite(ledPin3, HIGH); // set the LED on
delay(200);
digitalWrite(ledPin3, LOW); // set the LED off
digitalWrite(ledPin2, HIGH); // set the LED on
delay(200);
digitalWrite(ledPin2, LOW); // set the LED off
Serial.println("Repeating sequence");
}
// Teensy 3.0 has the LED on pin 13
const int RedLedPin = 13;
const int OrangeLedPin = 14;
const int GreenLedPin = 15;
// the setup() method runs once, when the sketch starts
void setup() {
// initialise the digital pins as an output.
pinMode(RedLedPin, OUTPUT);
pinMode(OrangeLedPin, OUTPUT);
pinMode(GreenLedPin, OUTPUT);
Serial.begin(38400);
Serial.println("Pins initialised");
}
// the loop() method runs over and over again,
// as long as the board has power
void loop() {
digitalWrite(RedLedPin, HIGH); // set the LED on
delay(4000);
digitalWrite(OrangeLedPin, HIGH); // set the LED on
delay(500);
digitalWrite(OrangeLedPin, LOW); // set the LED off
digitalWrite(GreenLedPin, HIGH); // set the LED on
delay(4000);
digitalWrite(GreenLedPin, LOW); // set the LED off
digitalWrite(OrangeLedPin, HIGH); // set the LED on
delay(500);
digitalWrite(OrangeLedPin, LOW); // set the LED off
Serial.println("Repeat sequence");
}
email
root
flog archives
In fact I'm not responsible for anything ever, so there!
Disclaimer:
This page is by me for me, if you are not me then please be aware of the following
I am not responsible for anything that works or does not work including files and pages made available at www.jumpstation.co.uk
I am also not responsible for any information(or what you or others do with it) available at www.jumpstation.co.uk