This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// super awesome Arduino-like pin macros save you from having to remember bitmasks | |
// code from Matthew T. Pandina's Demystifying the TLC5940 tutorial: | |
// URL: https://sites.google.com/site/artcfox/demystifying-the-tlc5940 | |
#define setOutput(ddr, pin) ((ddr) |= (1<< (pin))) | |
#define setLow(port, pin) ((port) &= ~(1 << (pin))) | |
#define setHigh(port, pin) ((port) |= (1 << (pin))) | |
#define outputState(port, pin) ((port) & (1 << (pin))) | |
#define pulse(port, pin) do { \ | |
setHigh((port), (pin)); \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define LEDPORT PORTD | |
#define LEDBIT PD6 | |
#define LEDDDR DDRD | |
#include <avr/io.h> | |
int main (void) | |
{ | |
LEDDDR |= (1 << LEDBIT); // set LED pin as an output | |
TCCR1B |= ((1 << CS10) | (1 << CS11)); // configure timer prescaling |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma mark - Embed Video | |
- (UIWebView *)embedVideoYoutubeWithURL:(NSString *)urlString andFrame:(CGRect)frame { | |
NSString *videoID = [self extractYoutubeVideoID:urlString]; | |
NSString *embedHTML = @"\ | |
<html><head>\ | |
<style type=\"text/css\">\ | |
body {\ | |
background-color: transparent;\ |