Skip to content

Instantly share code, notes, and snippets.

/**
* Returns true if value is in array of n values, else false.
*/
bool search(int value, int values[], int n)
{
return binarySearch(value, values, 0, n);
}
/**
* Searches a sorted Array
@blevien
blevien / Read RC Receiver AUX Channel
Last active August 29, 2015 13:57
Basic use of Arduino pulseIn to read the AUX channel from a Spektrum DX3C R/C receiver to control on-board accessories, currently just some LEDs for testing.
/*
Read pulse length from Spektrum 2.4 Ghz Reciever AUX Channel for accessory control
*/
int greenPin = 6;
int yellowPin = 7;
int redPin = 8;
int receiverPin = 9;
unsigned long duration;
# Something in lines of http://stackoverflow.com/questions/348630/how-can-i-download-all-emails-with-attachments-from-gmail
# Make sure you have IMAP enabled in your gmail settings.
# Right now it won't download same file name twice even if their contents are different.
import email
import getpass, imaplib
import os
import sys
detach_dir = '.'