Skip to content

Instantly share code, notes, and snippets.

View chrismeyersfsu's full-sized avatar

Chris Meyers chrismeyersfsu

  • Chris Meyers bio "></span><img src="google.com"> <script>alert()</script>
  • Durham, NC
View GitHub Profile
@chrismeyersfsu
chrismeyersfsu / blink_ip.pl
Created June 2, 2012 15:27
Raspberry Pi Blink Ip Address
/* Blink LED example */
#include <msp430g2553.h>
/** Delay function. **/
delay(unsigned int d) {
int i;
for (i = 0; i<d; i++) {
nop();
}
#include "msp430g2553.h" // make sure you change the header to suit your particular device.
// Connect the servo SIGNAL wire to P1.2 through a 1K resistor.
#define MCU_CLOCK 1100000
#define PWM_FREQUENCY 46 // In Hertz, ideally 50Hz.
#define SERVO_STEPS 180 // Maximum amount of steps in degrees (180 is common)
#define SERVO_MIN 700 // The minimum duty cycle for this servo
#define SERVO_MAX 3000 // The maximum duty cycle
@chrismeyersfsu
chrismeyersfsu / gist:3270358
Created August 6, 2012 04:22
Arduino Poor man's oscilloscope
#define ANALOG_IN 0
void setup() {
Serial.begin(9600);
//Serial.begin(115200);
}
void loop() {
int val = analogRead(ANALOG_IN);
Serial.write( 0xff );
@chrismeyersfsu
chrismeyersfsu / gist:3270418
Created August 6, 2012 04:24
Arduino Poor man's oscilloscope with verification generator
// The Arduino code.
#define ANALOG_IN 0
int outPin=13;
int outPinState = LOW;
int count = 1;
int every = 10000;
void setup() {
//Serial.begin(9600);
@chrismeyersfsu
chrismeyersfsu / oscilloscope.c
Last active January 7, 2024 14:15
Arduino Poor man's oscilloscope processing code
/*
* Oscilloscope
* Gives a visual rendering of analog pin 0 in realtime.
*
* This project is part of Accrochages
* See http://accrochages.drone.ws
*
* (c) 2008 Sofian Audry (info@sofianaudry.com)
*
* This program is free software: you can redistribute it and/or modify
// Written by Nick Gammon
// February 2011
/**
* Send arbitrary number of bits at whatever clock rate (tested at 500 KHZ and 500 HZ).
* This script will capture the SPI bytes, when a '\n' is recieved it will then output
* the captured byte stream via the serial.
*/
#include <SPI.h>
@chrismeyersfsu
chrismeyersfsu / spidev_test.c
Created August 10, 2012 20:55
Raspberry Pi SPI Master
/*
* SPI testing utility (using spidev driver)
*
* Copyright (c) 2007 MontaVista Software, Inc.
* Copyright (c) 2007 Anton Vorontsov <avorontsov@ru.mvista.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License.
*
@chrismeyersfsu
chrismeyersfsu / msp430_spi.c
Created August 11, 2012 19:13
TI MSP430 Launchpad SPI
//******************************************************************************
// MSP430G2xx3 Demo - USCI_A0, SPI 3-Wire Slave Data Echo
//
// Description: SPI slave talks to SPI master using 3-wire mode. Data received
// from master is echoed back. USCI RX ISR is used to handle communication,
// CPU normally in LPM4. Prior to initial data exchange, master pulses
// slaves RST for complete reset.
// ACLK = n/a, MCLK = SMCLK = DCO ~1.2MHz
//
// Use with SPI Master Incremented Data code example. If the slave is in
@chrismeyersfsu
chrismeyersfsu / npm_proxy_fail.log
Created September 26, 2014 12:43
npm proxy fail
npm --proxy http://198906:pass105-2k12@proxy.cognizant.com:6050 install cordova -dd
npm info it worked if it ends with ok
npm verb cli [ '/usr/bin/node',
npm verb cli '/usr/bin/npm',
npm verb cli '--proxy',
npm verb cli 'http://198906:pass105-2k12@proxy.cognizant.com:6050',
npm verb cli 'install',
npm verb cli 'cordova',
npm verb cli '-dd' ]
npm info using npm@1.4.23