Skip to content

Instantly share code, notes, and snippets.

View tedbauer's full-sized avatar

Theodore Bauer tedbauer

View GitHub Profile
import "primitives/std.lib";
component main(go: 1, clk: 1) -> (done: 1) {
cells {
lt = prim std_lt(1);
a1 = prim std_reg(1);
a2 = prim std_reg(1);
a3 = prim std_reg(1);
a4 = prim std_reg(1);
a5 = prim std_reg(1);
a6 = prim std_reg(1);
import "primitives/std.lib";
component main() -> () {
cells {
lt = prim std_lt(1);
a1 = prim std_reg(1);
a2 = prim std_reg(1);
a3 = prim std_reg(1);
a4 = prim std_reg(1);
int sPin = A5; // Pin for the servo signal input
int buttonPin = D0; // Pin for the button input
Servo serv; // Instance of Servo object; takes care of low-level servo communication
void setup() {
serv.attach(sPin); // Tells the Servo object which pin the servo is connected to
// Allows us to use the button pin for input.
// Read about "pull up" resistors here: http://playground.arduino.cc/CommonTopics/PullUpDownResistor
pinMode(buttonPin, INPUT_PULLUP);
int sPin = A5; // Pin for the servo signal input
int buttonPin = D0; // Pin for the button input
Servo serv; // Instance of Servo object; takes care of low-level servo communication
void setup() {
serv.attach(sPin); // Tells the Servo object which pin the servo is connected to
// Allows us to use the button pin for input.
// Read about "pull up" resistors here: http://playground.arduino.cc/CommonTopics/PullUpDownResistor
pinMode(buttonPin, INPUT_PULLUP);
/* Combo Sweep with PushButton
*/
#include <Servo.h>
#include <Adafruit_NeoPixel.h>
#define NUM_PIXELS 1
#define PIN_NUMBER 1
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_PIXELS, PIN_NUMBER);
int sPin = A5; // Pin for the servo signal input
int buttonPin = D0; // Pin for the button input
Servo serv; // Instance of Servo object; takes care of low-level servo communication
void setup() {
serv.attach(sPin); // Tells the Servo object which pin the servo is connected to
// Allows us to use the button pin for input.
// Read about "pull up" resistors here: http://playground.arduino.cc/CommonTopics/PullUpDownResistor
pinMode(buttonPin, INPUT_PULLUP);
/* Combo Sweep with PushButton
*/
#include <Servo.h>
Servo myservo; // create servo object to control a servo
// twelve servo objects can be created on most boards
int pos = 0; // variable to store the servo position