@LesLaboratory
  @LesLaboratory
Les Lab | Piano duet with a simple robot! @LesLaboratory | Uploaded 4 years ago | Updated 1 hour ago
Raspberry Pi zero and a single Servo driven by pin 18 plays C2 on a keyboard, leaving 2 hands to play the melody!

Hardware is a Raspberry pi zero, and a single SG90 mini servo.
A 'finger' was made from Perspex lined with silicone rubber so it does not damage my Keys!

A more powerful servo would yield better results.

Python code is below This is just slightly modified from the adafruit example here: learn.adafruit.com/adafruits-raspberry-pi-lesson-8-using-a-servo-motor

# Servo Control
import time
import wiringpi
# use 'GPIO naming'
wiringpi.wiringPiSetupGpio()
# set #18 to be a PWM output
wiringpi.pinMode(18, wiringpi.GPIO.PWM_OUTPUT)
# set the PWM mode to milliseconds stype
wiringpi.pwmSetMode(wiringpi.GPIO.PWM_MODE_MS)
# divide down clock
wiringpi.pwmSetClock(192)
wiringpi.pwmSetRange(2000)
delay_period = 0.095

while True:
wiringpi.pwmWrite(18, 90)
time.sleep(delay_period)
wiringpi.pwmWrite(18, 145)
time.sleep(delay_period)
Piano duet with a simple robot!Supermarket Barcode Scanner Teardown and hack!INSIDE A LASER! An Open Cavity Helium-Neon Laser!Letters Library for Python TurtleThermal camera on the Raspberry Pi! Topdon TC001 Product review!Home made Z80 tinybasic sound testDIY Raspberry Pi Spectrometer NEW SOFTWARE!Raspberry Pi 4 (RPi4) & Google Coral Live object detection using MobileNet-SSD 70FPS!How to build a DIY Raspberry Pi Spectrometer using a Picamera and Spectroscope.How to build a MINIATURE Spectrometer  for the Raspberry PiNitrogen Laser tear down, power up, and Home Made Dye Laser DemonstrationGrowing Laser Crystals used in NUCLEAR FUSION!

Piano duet with a simple robot! @LesLaboratory

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER