Serial and pixels for breakfast. Arduino + pygame.
Taking a byte of bits of Serial, along with Green screen with Sam, pygame, and an Arduino hooked up to a light sensor and a motor thing. Coffee too? Naturally. Where do we begin? At the end of course. A video of the result... The arduino code #include < Servo .h> Servo myservo; int potpin = 0; int val; void setup () { Serial . begin (9600); myservo. attach (9); } void loop () { val = analogRead (potpin); Serial . println (val); val = map (val, 62, 540, 0, 179); myservo. write (val); delay (15); } python pygame code Extended the " green eggs and ham" code I made recently to read serial data from the Arduino, and paint the screen different shades of green, whilst also making some silly sounds depending on the value read from the light sensor. import os import pygame import serial # guessing serial ports nam...