-------------------------------------------------------------------------> I'm just Awesome

lying-hearts:

Last night we set up a bed on the third story balcony overlooking the water.. The sun woke us up but we didnt mind. // Wrightsville Beach, NC

lycanthropique:

dalishpeach:

Tender-hearted heroes are so important to me.

Heroes that are soft-spoken and kind, that want nothing more than to take care of everyone.

Heroes that are sweet and good, that always leave folks smiling in their wake.

Heroes that see good in everyone, who want to be good to everyone.

Heroes that are gentle and compassionate, that wish to share the boundless joy in their hearts with the world.

image

bestdad2013:

when someone explains something to you for the 3rd time and you still dont get it so you kinda just 

image

theubergrump:

I’m actually loving this “gay marriage caused Hurricane Sandy” thing.

That’s right, assholes, better give us our rights.

We control the weather.

vividlily:

Finally got to experiment with the Raspberry Pi’s GPIO (General Purpose Input/Output) pins.  I tried three methods: Python, Bash and C, and will describe each.  But first, here’s some setup information.

  • Connecting to the RPi’s GPIO header: I used an old floppy disk drive IDE ribbon cable.  It has 34 pins, but the RPi’s header is only 26 pins, so part of the connector is unused. I soldered some breadboard-friendly header pins onto the other end, which is working pretty well so far. Bear in mind that some IDE cables may be more complicated than they look. Before powering anything up, make sure you check that each conductor is indeed separate and you’re not accidentally grounding or shorting anything. You can always make your own by getting some 26-conductor IDC connectors and using a vice to crimp it onto a piece of ribbon cable.
     
  • Pin Connections: …are confusing! There’s a master table here, and a diagram here.  Looking at the diagram, my breakout header starts with 3.3V and moves left to right, top to bottom.  Here are the pin connections from my header as pictured:
    • Pin 2: 5V
    • Pin 3: “GPIO0″. Connected to one end of the switch (the other end is connected to ground, since this GPIO pin has an internal pull-up resistor.  This means that when the switch is not closed, the pin reads as “High,” and when closed, “Low.”
    • Pin 6: GND (note that it’s jumpered to my ground rail on my breakout board)
    • Pin 7: “GPIO4″. The anode of the LED through a 220-ohm resistor.
  • I’ll use this breakout board setup for all the following examples.  Different libraries/tools use different pin numbers, adding to the confusion, so I’ll try to clear it up.  Also note that I’m doing this through an SSH session, so there’s no monitor attached to the RPi. See my beginning instructions here if you don’t already have an SSH connection to your Pi.
  • Important Note: The RPi Wiki takes pains to remind you that these GPIO pins are unbuffered and unprotected, so if you short something out, you could fry your whole Pi, so be careful!  There are a number of other breakout boards being developed that should make this safer.
  • Important Note: Any program that accesses the GPIO pins must be run as root, so if you get an error, remember to “sudo” your command.
  • Python: One of my preferred languages, so I figured I’d try it out. First, install pip (Python package installer):
  • Bash: Something I’ve always loved about Unix is the idea that everything is a file.  On the Raspberry Pi, the GPIO pins are files too! With the pictured breadboard setup, we can do the following to turn the LED on and off (note that this uses the “BCM” pin numbering but the breadboard stays the same!):
    • (You can’t just put sudo before each command because the second command that the output is directed to would not be run as root. So, for simplicity, we drop into root first.)
      sudo su -
      echo "4" > /sys/class/gpio/export
      echo "4" > /sys/class/gpio/export
      echo "out" > /sys/class/gpio/gpio4/direction
      echo "1" > /sys/class/gpio/gpio4/value
      echo "0" > /sys/class/gpio/gpio4/value
    • To read from an input, ‘cat’ it like any other file!
      echo "0" > /sys/class/gpio/export
      echo "in" > /sys/class/gpio/gpio0/direction
      cat /sys/class/gpio/gpio0/value
  • C: Good old C.  The native example for C is really hairy, but luckily a plucky fellow named Gordon wrote an Arduino-like library just for the Raspberry Pi!  Here’s what you need to do:
    • Download and install the library:
      cd /tmp
      wget http://project-downloads.drogon.net/files/wiringPi.tgz
      
      tar xfz wiringPi.tgz
      cd wiringPi/wiringPi
      make
      sudo make install
      cd ../gpio
      make
      sudo make install
    • Your Pi’s system now has the wiringPi library installed, so we can write a little program that uses it.
      cd ~
      nano blink.c
    • Type or paste in this program:
      1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
      view raw blink.c This Gist brought to you by GitHub.
    • And compile it:
      cc -o blink blink.c -L/usr/local/lib -lwiringPi
    • And run it:
      sudo ./blink
    • You should have a happily blinking LED. Yay! Now for something more interesting:
      1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
      /*
      * buttonLED.c:
      * Simple test program to change the blinking rate of an LED when a button is pressed
      */
       
      #include <wiringPi.h>
      #include <stdio.h>
       
      int main (void)
      {
      int pin_LED = 7; // GPIO7 / header pin 7
      int pin_switch = 8; // SDA0 / header pin 3
      int del = 250;
       
      printf (“Raspberry Pi wiringPi button LED test\n) ;
       
      if (wiringPiSetup() == -1)
      exit (1);
       
      pinMode(pin_LED, OUTPUT);
      pinMode(pin_switch, INPUT);
       
      for (;;){
      if (digitalRead (8) == 0){ // button pressed
      del = 100;
      } else {
      del = 250;
      }
       
      digitalWrite(pin_LED, 1);
      delay(del);
      digitalWrite(pin_LED, 0);
      delay(del);
      }
       
      return 0 ;
      }
  • Where’s my analogRead?  Sadly, unlike an Arduino, the RPi doesn’t have an onboard ADC (Analog to Digital Converter). However, some of the breakout boards being designed will include an external ADC, such as the Gertboard.  You can add your own external ADC, such as this one, by using the SPI bus on the RPi (the MOSI, MISO and SCK pins).
  • That’s all for now! Hope this helps, and as always, let me know if it works or you run into any problems.

Source: http://log.liminastudio.com/writing/tutorials/tutorial-how-to-use-your-raspberry-pi-like-an-arduino

ziggles:

I made a book that has an Altoids tin, some cords and stuff in it.  And in that tin the book is a computer.  And that stuff is a hard drive and a usb hub.  It can plug into just about any tv and play just about any movie in hd.  It also internets.

I’m eventually going to make a different book and refine the Altoids case, but there you go, a Raspberry Pi.  Neat.

tristannicolas:

I just ordered my Kano, a kit built on Raspberry pi. I am really excited to start playing wit it&#160;!

tristannicolas:

I just ordered my Kano, a kit built on Raspberry pi. I am really excited to start playing wit it !

welikeraspberrypi:

tabbooks:


Raspberry Pi Cake Does Bites Instead Of Bytes

keeing this… great as an Happy Birthday e-card for all pi-fans! :)

welikeraspberrypi:

tabbooks:

Raspberry Pi Cake Does Bites Instead Of Bytes

keeing this… great as an Happy Birthday e-card for all pi-fans! :)