This file contains hidden or 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
; subi_vs_andi.S: Compare the performance of `subi' and `andi' | |
; | |
; Does a bitwise "and" perform better than a subtraction on an | |
; Arduino Uno? | |
; | |
; There are two common ways of converting an ASCII digit to its numeric | |
; value: | |
; | |
; - subtraction: character - '0' | |
; - bitwise and: character & 0x0f |
This file contains hidden or 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
/* | |
* dual-scope.c: Dual channel Arduino/AVR oscilloscope. | |
* | |
* This program alternatively samples analog inputs 0 and 1, with an | |
* overall sampling rate of about 9615 samp/s (one sample every 104 us), | |
* i.e. 4808 samp/s per channel. The samples are output as 8-bit binary | |
* through the serial port at 115200/8N1. A fixed 16-byte ASCII prologue | |
* is sent at program startup, before the actual binary data, for | |
* synchronization purposes. The first byte sent after the prologue is a | |
* sample from channel 0. |
This file contains hidden or 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
/* | |
* stroboscope.ino: Pulse an LED at an adjustable frequency. | |
* | |
* This program strobes an LED at a frequency which is controlled by a | |
* potentiometer. The frequency is continuously displayed on the serial | |
* port. | |
* | |
* The potentiometer sets the frequency, on a logarithmic scale, from | |
* 15.26 to 1012 Hz (assuming a 16 MHz clock). The output is generated | |
* by Timer 1 in phase correct PWM mode with a /8 prescaler. This |
This file contains hidden or 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
/* | |
* sound-meter.ino: Arduino sound meter. | |
* | |
* This program continuously samples a sound signal on analog input 0 | |
* and outputs the computed sound intensity through the serial port. | |
* | |
* The analog-to-digital converter is set to "free running mode" and | |
* takes one sample every 104 us. After subtracting a DC offset | |
* (constant dc_offset below), the samples are squared and low-pass | |
* filtered with a time constant of 256 sample periods (26.6 ms). They |
This file contains hidden or 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
/* | |
* homodyne.ino: Homodyne detection of a 1 kHz signal. | |
* | |
* This program continuously samples analog input 0 and uses an homodyne | |
* detection scheme to identify a signal at 1 kHz (+/- 24 Hz @ -3dB). | |
* | |
* The analog-to-digital converter is set to "free running mode" and | |
* takes one sample every 104 us. The samples are multiplied by two | |
* generated signals at 1 kHz (the "local oscillator"), in quadrature to | |
* one another. The products are then low-pass filtered with a time |
This file contains hidden or 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
/* | |
* interpreter.ino: Simple Arduino command line interpreter. | |
* | |
* This is intended solely as a template for building richer, | |
* application-specific interpreters. Add your specific commands to the | |
* exec() function, and whatever you need to setup() and loop(). | |
* | |
* Usage: | |
* Talk to it through the serial port at 9600/8N1. Commands should be | |
* terminated by CR (\r), answers are terminated by CRLF (\r\n). This |
This file contains hidden or 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
/* | |
* robotic-car-test.ino: Basic tests for a small robotic car. | |
* | |
* Usage: keep the car in your hand and look at the serial monitor. | |
*/ | |
#include <Servo.h> | |
// Pinout. | |
const int MOTOR_LEFT_ENABLE = 6; |
This file contains hidden or 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
/* | |
* ebclock.ino: Edgar's binary clock. | |
* | |
* This is an alternate firmware for Daniel Andrade's binary clock. | |
* For details and schematic, see Daniel's post at | |
* http://www.danielandrade.net/2008/07/15/binary-clock-with-arduino/ | |
* | |
* A few things are changed with respect to the original firmware: | |
* - you can fine-tune the clock speed if it runs too fast or too slow | |
* - you do not need the 2.2 KOhm pull-up resistors |