Skip to content

Instantly share code, notes, and snippets.

View gregorykelleher's full-sized avatar

Gregory Kelleher gregorykelleher

View GitHub Profile

Keybase proof

I hereby claim:

  • I am gregorykelleher on github.
  • I am gregorykelleher (https://keybase.io/gregorykelleher) on keybase.
  • I have a public key ASDO3LfF9_BykGCdyeV8N1b1P6TqMNkkrzqaw7hle1Qn1Ao

To claim this, I am signing this object:

public static double birthday(int n) {
int dups = 0;
double value = 0.0;
for (int i = 0; i < n; i++) {
boolean foundDup = false;
int[] bday = new int[n];
// assign birthdays to n people
import java.util.Scanner;
import java.util.Stack;
public class Solution {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
//System.out.println("Enter the size of the stack: ");
int size = scan.nextInt();
#include <PWMServo.h>
//servos
int pos1 = 50; //myservo1 pin 6;
int pos2 = 30; //myservo2 pin 7;
PWMServo myservo1;
PWMServo myservo2;
#include <XBOXRECV.h>
// Satisfy IDE, which only needs to see the include statment in the ino.
#ifdef dobogusinclude
#include <spi4teensy3.h>u
#endif
USB Usb;
XBOXRECV Xbox(&Usb);
void setup() {
/*
Example sketch for the Xbox Wireless Reciver library - developed by Kristian Lauszus
It supports up to four controllers wirelessly
For more information see the blog post: http://blog.tkjelectronics.dk/2012/12/xbox-360-receiver-added-to-the-usb-host-library/ or
send me an e-mail: kristianl@tkjelectronics.com
*/
#include <XBOXRECV.h>
// Satisfy IDE, which only needs to see the include statment in the ino.
#ifdef dobogusinclude
@gregorykelleher
gregorykelleher / gist:707dd256d137452d68e2
Created July 27, 2015 12:01
Proximity Sensor w/o delay()
int sensorPin = 0;
int ledPin = 4;
int ledState = LOW;
unsigned long previousMillis = 0;
void setup() {
#include <Servo.h>
Servo myServo;
int pos = 0;
int joystick1 = 7;
int joystick2 = 8;
const byte PIN_ANALOG_X = 0;
/*
Sample Code to run the Sparkfun TB6612FNG 1A Dual Motor Driver using Arduino UNO R3
This code conducts a few simple manoeuvres to illustrate the functions:
- motorDrive(motorNumber, motorDirection, motorSpeed)
- motorBrake(motorNumber)
- motorStop(motorNumber)
- motorsStandby
// Connections:
#include "LedControl.h"
LedControl lc=LedControl(12,11,10,1);
void setup(){
Serial.begin(9600);
lc.shutdown(0,false);
lc.setIntensity(0,10);
lc.clearDisplay(0);