Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- code used in jamuary02 - Bytebeat
- https://youtu.be/8HQUXlStqK8
- schematic at https://imgur.com/SekUTgN
- noizhardware.com
- enjoy :)
- */
- #include <avr/io.h>
- #define SNDOUT 4 /* pin3 */
- #define POT_A 3 /* pin2 */
- uint8_t out;
- int16_t t = 0;
- uint8_t PARAM_A;
- uint16_t potA16;
- void setup(){
- pinMode(SNDOUT, OUTPUT);
- pinMode(POT_A, INPUT);}
- void loop(){
- potA16 = analogRead(POT_A);
- PARAM_A = (int)(potA16>>2); /* ditch bits to go from 10bit to 8bit */
- out = (t%127)*((t-65&t)>>(PARAM_A/14+7));
- digitalWrite(SNDOUT, out);
- t++;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement