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
/* | |
toneDelay Example: | |
Based on toneMelody by Tom Igoe. | |
The toneDelay function is an alternative to the tone function. | |
Basically is the same except it is a blocking function, i.e. it does not use a timer for frequency generation | |
Author: Federico Lanza | |
*/ |
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
// | |
// SoundAndMusic | |
// | |
// Play music and blink the LED in synchronization | |
// | |
// We are using port S0 on the Duinobot board | |
// | |
// NOTES: | |
// - Ports S0-S5 are analog input pins | |
// - S0 is identical to Arduino A0 and so on (S5=A5) |
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
//Mario main them song | |
int melody[] = { | |
NOTE_E7, NOTE_E7, 0, NOTE_E7, | |
0, NOTE_C7, NOTE_E7, 0, | |
NOTE_G7, 0, 0, 0, | |
NOTE_G6, 0, 0, 0, | |
NOTE_C7, 0, 0, NOTE_G6, | |
0, 0, NOTE_E6, 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
// | |
// ISeeLight | |
// | |
// Print the value of the light sensor to the Serial Monitor. | |
// Also, make electronic music ... like a theremin. | |
// | |
// We are using port S2 on the Duinobot board for the light sensor. | |
// | |
// NOTES: | |
// - Ports S0-S5 are analog input pins |
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
// | |
// UltrasoundPingTest | |
// | |
// Test the Ultrasound Sensor | |
// | |
// We are using port S5 on the Duinobot board | |
// | |
// NOTES: | |
// - Ports S0-S5 are analog input pins | |
// - S0 is identical to Arduino A0 and so on (S5=A5) |
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
//I got my DuinoBot to play In the Hall of the Mountain King! | |
//Here's the sketch if you want to try it out. | |
//(I've also included the sketch to stop the program, because | |
//I foolishly started it before I could stop it from playing. all. day.) | |
//I used one of the examples to do this, DelayTone. | |
//http://www.kendormusic.com/str2004/parts/9841p1.jpg | |
//This is only the first 4 bars of the melody, so if any of you are interested |
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
// | |
// Morse_Blinker | |
// | |
// Use the LED to send out arbitrary messages in morse code. | |
// | |
// We use pin 13 as depending on the Arduino board | |
// (the Duinobot in our case), it has either: | |
// - a built-in LED or, | |
// - a built-in resistor so that you only need to add an LED. | |
// |
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
// | |
// Morse_Hello2 | |
// | |
// Use the LED to send out 'HELLO' in morse code. | |
// This is an example solution to assignment 2. | |
// | |
// The Circuit: | |
// We use pin 13 as depending on the Arduino board | |
// (the Duinobot in our case), it has either: | |
// - a built-in LED or, |
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
// | |
// morse_decoder | |
// | |
// Convert light signals received via light sensor from morse code to text | |
// | |
// We are using port S1 on the Duinobot board for the light sensor. | |
// The value of THRESHOLD is dependent on your ambiant light ... it | |
// may need to be adjusted for your environment. | |
// A morse dot is assumed to be 500 msec (see DOT) ... have not tried any | |
// other speeds yet. |
OlderNewer