Skip to content

Instantly share code, notes, and snippets.

#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>
// called this way, it uses the default address 0x40
// you can also call it with a different address you want
Adafruit_PWMServoDriver servo1 = Adafruit_PWMServoDriver(0x40);
Adafruit_PWMServoDriver servo2 = Adafruit_PWMServoDriver(0x42);
Adafruit_PWMServoDriver light1 = Adafruit_PWMServoDriver(0x43);
Adafruit_PWMServoDriver light2 = Adafruit_PWMServoDriver(0x44);
@radames
radames / timerArduino.ino
Last active July 10, 2021 18:47
Simple Arduino Hour Minute counter
long lastTime = 0;
long minutes = 0;
long hours = 0;
void setup() {
}
void loop() {
@radames
radames / opencv_video_to_pygame_raspberry_pi.py
Last active August 11, 2022 17:55
OpenCV VideoCapture running on PyGame on Raspberry PI
import pygame
from pygame.locals import *
import cv2
import numpy as np
import time
import picamera
import picamera.array
screen_width = 640
from pygame.locals import KEYDOWN, K_ESCAPE, K_q
import pygame
import cv2
import sys
camera = cv2.VideoCapture(1)
pygame.init()
pygame.display.set_caption("OpenCV camera stream on Pygame")
screen = pygame.display.set_mode([1280, 720])
@radames
radames / Planet_Kronos_x8.ino
Last active June 25, 2022 13:56
Sample code for controlling a motor via OSC messages using Arduino and Ethernet Shield
//Planet_Kronos_x8 The Kazimier Dezember 2015
//The MIT License (MIT)
#include <SPI.h>
#include <Ethernet.h>
#include <EthernetUdp.h>
#include <OSCBundle.h>
#define DEBUG 1
import ddf.minim.*;
import ddf.minim.ugens.*;
Minim minim;
AudioOutput out;
float posx;
float posy;
float incx = 10;
@radames
radames / robotPonginProgress.pde
Last active November 11, 2015 19:02
starting the pong from this template
float posx;
float posy;
float incx = 5;
float incy = 5;
//cointains the pad position and width and height
float posXPad, posYPad;
float padW, padH;
@radames
radames / drawRobotArrowsBlink.pde
Created November 4, 2015 20:04
Draw with blink
@radames
radames / drawRobotArrows.pde
Created November 4, 2015 19:27
testing arrows to move the robot and checking the canvas area
float posx;
float posy;
float scaleValue = 1;
color backColor;
void setup() {
size(800, 500);
frameRate(24);
posx = random(0, width);
posy = random(0, height);
@radames
radames / drawRobot.pde
Created November 4, 2015 18:21
Just a sketch template with function
void setup() {
size(800, 500);
frameRate(24);
}
void draw() {
background(255);
drawRobot(1, 50,50); //calling the function with fixed parameters