Skip to content

Instantly share code, notes, and snippets.

View robotjoosen's full-sized avatar
🤖
Beep Boop Beep

Roald Joosen robotjoosen

🤖
Beep Boop Beep
View GitHub Profile
@robotjoosen
robotjoosen / veins-74HC595.ino
Created October 10, 2012 19:58
Veins 74HC595 PWM code
/* ------------------------------------------------------------------------------------------------
* Cynaptic Collective - Veins Basic v1.0
*
* Project : Veins
* Client : Melkweg Amsterdam / OffCentre 2012 / Deframe Collective
* Author : Roald Joosen
* Start date : 21 aug 2012
* End date : 16 sept 2012
*
* ------------------------------------------------------------------------------------------------ */
@robotjoosen
robotjoosen / jerrycan-light-seq.ino
Created October 10, 2012 20:13
Jerrycan Light Sequencer Old Code
/*
* Author : Roald Joosen
* Project : OFFCENTRE, Jerrycan Lighting
* Date : 10 Sept, 2011
*
*/
int seqSelected;
int timerNext;
int timerSpeed;
//Declare CD4021 Pins
int __cd4021b_latchPin = 8;
int __cd4021b_dataPin = 9;
int __cd4021b_clockPin = 7;
void setup() {
//Start Serial Communication
Serial.begin(9600);
//Set pinMode of CD4021BCN
@robotjoosen
robotjoosen / readCD4051
Created May 11, 2013 11:50
Basic code for reading a CD4051 with an Arduino.
int ldrArr[2][8];
int port[2];
int portLength = 2;
void setup(){
DDRB = DDRB | B00000111;
Serial.begin(9600);
port[0] = 0;
port[1] = 1;
}
@robotjoosen
robotjoosen / 75HC595_option_1
Last active December 17, 2015 05:39
Different ways of using a 75HC595 on an Arduino.
int SER_Pin = 9; //pin 14 on the 75HC595
int RCLK_Pin = 10; //pin 12 on the 75HC595
int SRCLK_Pin = 11; //pin 11 on the 75HC595
//How many of the shift registers - change this
#define number_of_74hc595s 2
//do not touch
#define numOfRegisterPins number_of_74hc595s * 8
int SER_Pin = 9; //pin 14 on the 75HC595
int RCLK_Pin = 10; //pin 12 on the 75HC595
int SRCLK_Pin = 11; //pin 11 on the 75HC595
#define number_of_74hc595s 2 //How many of the shift registers - change this
#define numOfRegisterPins number_of_74hc595s * 8 //do not touch
boolean registers[numOfRegisterPins];
void setup(){
pinMode(SER_Pin, OUTPUT);
int SER_Pin = 9; //pin 14 on the 75HC595
int RCLK_Pin = 10; //pin 12 on the 75HC595
int SRCLK_Pin = 11; //pin 11 on the 75HC595
#define number_of_74hc595s 1 //How many of the shift registers - change this
#define numOfRegisterPins number_of_74hc595s * 8 //do not touch
boolean registers[numOfRegisterPins];
unsigned long nextStep = 0;
unsigned long timer = 0;
@robotjoosen
robotjoosen / simple-robot.ino
Last active January 26, 2019 21:33
Simple robot code used for the coding of a simple robot part of a workshop.
//Laad de servo bibliotheek zodat je het zelf niet hoeft te schrijven.
#include <Servo.h>
//IR_SENSOR
static int ir_sensor = 0; //Analoge poort A0
static int ir_threshold = 400; //0-1023 [0 = 0v / 1023 = 5v]
int ir_value;
//SERVO
static int servo_pin_left = 2; //Digital pin 2
#include <Wire.h>
#include <Adafruit_ADS1015.h>
#include "DigiKeyboard.h"
Adafruit_ADS1115 ads;
void setup(void)
{
Serial.begin(9600);
ads.begin();
@robotjoosen
robotjoosen / arduino_led_pushbutton.ino
Last active April 12, 2020 12:40
Led toggle by pushbutton - Arduino
int button = 2;
int led0 = 3;
int led1 = 4;
boolean ledToggle = false;
void setup()
{
pinMode(button, INPUT);
pinMode(led0, OUTPUT);
pinMode(led1, OUTPUT);