How To: Interactive Rick and Morty Painting
193 Views, 1 Favorites, 0 Comments
How To: Interactive Rick and Morty Painting
From the words of Rick Sanchez himself, “Sometimes science is more art than science.”
Today, those words ring especially true as we put our work from Circuit Python and our CPB to create a piece of art! Specifically, a piece of art dedicated to the best show ever: Rick and Morty
Listen to some Rick and Morty Music as you join me for a step by step instructable on how I created this beautiful piece of art that I can't wait to display in my room.
Supplies
- Painting Canvas
- Paintbrush
- Pencil
- Sharpie or any other black marker
- Blue, green, black, white, yellow, purple, brown, paint
- Computer
- Circuit Python
- Adafruit Circuit Playground Bluefruit
- LED Strip Lights
- Battery
- Triple A batteries
- Cable Wires
Painting Instructions
I'm gonna walk you through the first step of this project which is to make your painting! Now, if you don't think you're a great painter don't fret-- it will look great no matter what.
As Rick says, “I’m sorry, but your opinion means very little to me," so it really doesn't matter what your painting looks like! As long as you love it, that's all that matters. If you still are nervous going into this painting stage, then just remember, "When you know nothing matters the universe is yours" (Rick). In other words, your painting and end result is meaningless-- so don't spend time fretting over it. In fact one of my favorite quotes to this day is, "Pointless thinking is worse than no thinking at all" - Haruki Murakami.
So, let's get started artists.
- Find a Rick and Morty image to model your painting off of. I used the one pictured above, but you can really use any image of them that you want. In fact, you can even create one from your imagination!
- I started by using a pencil to draw the outline of Rick and Morty in their spaceship on my canvas
- After that, I chose to draw the Rick and Morty logo on top of my painting-- you can do that or put any other words you want. You can even write Rick's tagline "Wubba Lubba Dub Dub!" there if you want
- Once you have finalized your pencil outline and decide that you like it-- outline it with a sharpie. This is important: make sure you like what you've drawn because once you touch your sharpie to the canvas, it will be much harder to cover up those lines.
- When you've finish outlining your pencil lines, it's time to start painting! I chose to use actual paint, but you can also do this step with markers or whatever color medium you want
- I began by doing the background first-- a nice purple mixed with some black and blue to create the image of the outer galaxy
- Once I got the background done, I started painting in the spaceship and finer details
- After this was done, I painted in my logo with a mix of blue, green, and white paint
- Finally, I reoutlined some of my lines that got mixed up in the painting. Now, I could've first painted and then outlined, but outlining first really helps because it's much more difficult to see the pencil lines once you have started painting
- Ta da! You did it. What a beautiful job! If you were nervous coming into it, now you see that you had no reason to be. “I know that new situations can be intimidating. You’re lookin’ around and it’s all scary and different, but y’know, meeting them head-on, charging into ‘em like a bull — that’s how we grow as people.” (Rick)
“To live is to risk it all; otherwise you’re just an inert chunk of randomly assembled molecules drifting wherever the universe blows you.” -Rick
Time to Get Schwifty!
Now it's time to get on your computers, open up Circuit Python, and begin the code necessary for this interactive project.
The main attributes I really wanted to include in my artwork were sounds and lights. You can really add anything you want here! If you didn't like the features I chose, change them! “I’m a scientist; because I invent, transform, create, and destroy for a living, and when I don’t like something about the world, I change it.” — Pickle Rick. But since this is my instructable, I'm going to walk you through how I made my piece.
- First, connect your striplights to your CPB, your CPB to your computer, and open up Circuit Python
- I started by sourcing the web for the audio files I needed for this project. I chose to get 3 in total: one for Rick, one for Morty, and one for the logo
- You can find some great Rick and Morty sound files here
- To reflect Rick and Morty's expressions in my painting, I chose a "Wubba Lubba Dub Dub" sound for Rick, a "Help" sound for Morty, and a fun "Riggity Riggity Wrecked Son" sound for the logo
- After I had the sounds downloaded to my computer, I dragged them into my CPB device
- For Rick and Morty's sounds, I wanted the CPB to express them when the characters were touched so I used the CPB's touchpads
- Using if statements, I included the sounds under two separate touchpads
- I also made my pixels and strip lights flash with color after Rick and Morty made their sounds
- For the logo statement, I wanted my CPB to express that sound when I moved my painting so it would sound when my painted spaceship was moving, thus I used the accelerometer feature of the CPB
- By doing this, it meant that while my painting was being moved, the strip lights would light up giving my painting some extra BANG
- I decided to animate my strip lights by having them cycle through the rainbow colors
- I also decided to do a fun SOS spaceship emergency function by using the accelerometer again and setting it according to the y axis. This way, when my painting (aka the spaceship) is tilted backwards, siren sounds and pulsing red lights begin to light up.
- Once the code is done, it's time to connect your CPB and strip lights to your painting.
- To connect the designated sounds to each character, I punctured little holes within Rick and Morty as places for the wires to clip on to. Then, from the back of your canvas, clip your wires on to those holes! This way, when you touch either Rick and Morty at the places where the wires are connected, they will speak.
- For the final touches, I taped my strip lights around their spaceship-- you can tape them anywhere on to the painting that you'd would like.
- Finally I taped my CPB and battery to the back of my canvas.
- Ta da! You're done. Now, turn on your battery and let your piece of art come to life.
You did it! One more beautiful piece of art created; let this be a sign that you can do anything you really want, and I hope this interactive piece of art gives you a little bit of happiness.
“Lemme check my list of powers and weaknesses: ability to do anything, but only whenever I want.” - Rick.
Sample Video & Code
Here is my finished code and at the end of this instructable you can find a video demonstrating the functions of my interactive painting!
import board
import neopixel
import time
import digitalio
import touchio
import adafruit_lis3dh
import busio
from audiopwmio import PWMAudioOut as AudioOut
from audiocore import WaveFile
from adafruit_led_animation.color import ( AMBER, #(255, 100, 0) AQUA, # (50, 255, 255) BLACK, #OFF (0, 0, 0) BLUE, # (0, 0, 255) CYAN, # (0, 255, 255) GOLD, # (255, 222, 30) GREEN, # (0, 255, 0) JADE, # (0, 255, 40) MAGENTA, #(255, 0, 20) OLD_LACE, # (253, 245, 230) ORANGE, # (255, 40, 0) PINK, # (242, 90, 255) PURPLE, # (180, 0, 255) RED, # (255, 0, 0) TEAL, # (0, 255, 120) WHITE, # (255, 255, 255) YELLOW, # (255, 150, 0) RAINBOW # a list of colors to cycle through # RAINBOW is RED, ORANGE, YELLOW, GREEN, BLUE, and PURPLE ((255, 0, 0), (255, 40, 0), (255, 150, 0), (0, 255, 0), (0, 0, 255), (180, 0, 255)) )
INDIGO=(63,0,255)
VIOLET=(127,0,255)
MAROON = (128, 0, 0)
colors = [RED,MAGENTA, ORANGE,YELLOW,GREEN,JADE, BLUE,INDIGO,VIOLET, PURPLE] pixels_pin = board.NEOPIXEL
pixels_num_of_lights = 10
pixels = neopixel.NeoPixel(pixels_pin, pixels_num_of_lights, brightness = 0.5, auto_write=True)
strip_pin = board.A4 strip_num_of_lights= 30
strip = neopixel.NeoPixel(strip_pin, strip_num_of_lights, brightness = 0.5, auto_write=True)
speaker = digitalio.DigitalInOut(board.SPEAKER_ENABLE)
speaker.direction = digitalio.Direction.OUTPUT
speaker.value = True
audio = AudioOut(board.SPEAKER)
path = "drumSounds/"
i2c = busio.I2C(board. ACCELEROMETER_SCL, board.ACCELEROMETER_SDA)
int1 = digitalio.DigitalInOut(board.ACCELEROMETER_INTERRUPT)
accelerometer = adafruit_lis3dh.LIS3DH_I2C(i2c, address=0x19, int1=int1)
accelerometer.range = adafruit_lis3dh.RANGE_8_G
touchpad_A1 = touchio.TouchIn(board.A1)
touchpad_A2 = touchio.TouchIn(board.A2)
def play_sound(filename):
with open(path + filename, "rb") as wave_file:
wave = WaveFile(wave_file)
audio.play(wave)
while audio.playing:
pass
while True:
x, y, z = accelerometer.acceleration
if y<-10:
pixels.fill(RED)
strip.fill(RED)
pulse_brightness()
play_sound("siren.wav")
pixels.fill(RED)
strip.fill(RED)
pulse_brightness()
if accelerometer.shake(shake_threshold=15):
play_sound("riggity.wav")
for i in range(len(colors)):
pixels.fill(colors[i])
strip.fill(colors[i])
time.sleep(0.25)
pixels.fill((0,0,0))
strip.fill((0,0,0))
if touchpad_A1.value:
play_sound("Help.wav")
if touchpad_A2.value:
play_sound("wub.wav")