This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This sketch demonstrates how to use the BeatDetect object in FREQ_ENERGY mode.<br /> | |
* You can use <code>isKick</code>, <code>isSnare</code>, </code>isHat</code>, <code>isRange</code>, | |
* and <code>isOnset(int)</code> to track whatever kind of beats you are looking to track, they will report | |
* true or false based on the state of the analysis. To "tick" the analysis you must call <code>detect</code> | |
* with successive buffers of audio. You can do this inside of <code>draw</code>, but you are likely to miss some | |
* audio buffers if you do this. The sketch implements an <code>AudioListener</code> called <code>BeatListener</code> | |
* so that it can call <code>detect</code> on every buffer of audio processed by the system without repeating a buffer | |
* or missing one. | |
* <p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Solar code example | |
Example 7 | |
Introduction to Robotics | |
by Rodolfo Cossovich at New York University Shanghai | |
Description: Using and LDR to move a servo to simulate a | |
solar panel tracking the sun. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ArrayList<Weird> w = new ArrayList<Weird>(); | |
int n =round(random(1,50)); //how many shapes to show | |
void setup() { | |
size(640, 480); | |
noStroke(); | |
for (int i=0; i<n; i++) { | |
w.add(new Weird( round(random(200)), round(random(4,8)))) ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float c = 1; | |
int direction = 1; | |
int qty = 10; | |
float[] posX = new float[qty]; | |
float[] posY = new float[qty]; | |
float[] speedX = new float[qty]; | |
float[] speedY = new float[qty]; | |
float[] size = new float[qty]; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import shlex, subprocess, msvcrt, time, sys | |
# input("Press any key to trigger your signal...") | |
char = 0 | |
print('Press any key to continue') | |
while not char: | |
char = msvcrt.getch() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ball bouncing 1 | |
float x, y; | |
int size; | |
float speedX; | |
float speedY; | |
color c; | |
// ball bouncing 1 | |
float x2, y2; | |
int size2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Ball { | |
float x, y; | |
int size; | |
float speedX; | |
float speedY; | |
color c; | |
Ball(int s) { //construct the ball | |
x = random(width); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/********* | |
Rui Santos | |
Complete project details at https://randomnerdtutorials.com | |
Added rainbow function | |
*********/ | |
#include <FastLED.h> | |
#define LED_PIN 32 | |
#define NUM_LEDS 64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int x = 50; | |
// int condition = 100; I changed this | |
int condition = 10; | |
void setup() { | |
size(600, 600); | |
background(255, 255, 255); | |
strokeWeight(25); | |
// frameRate (70); I commented this... why would you set it? | |
colorMode(HSB, 100); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int s1 = 20; | |
int s2 = 20; | |
float x = 100; | |
float y = 100; | |
float spX = random(1, 10); | |
float spY = random(1, 10); | |
color c = color(0,0,0); | |
void setup() { | |
size(600, 800); |