Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Created by:
#include <CapacitiveSensor.h>
#define speaker 11
void setup()
{
noteDo.set_CS_AutocaL_Millis(0xFFFFFFFF); // turn off autocalibrate on channel 1 - just as
an example
Serial.begin(9600);
void loop()
// Set a timer.
// "println" - "ln" represent as "line", system will jump to next line after
print the output.
// When hand is touched the sensor, the speaker will produce a tone.
// I set a threshold for it, so that the sensor won't be too sensitive.
if (ValueDo<=150 & ValueDo_<=150 & ValueRe<=150 & ValueRe_<=150 & ValueMi<=150 &
ValueFa<=150 & ValueFa_<=150 & ValueSol<=150 & ValueSol_<=150 & ValueLa<=150 &
ValueLa_<=150 & ValueSi<=150 & ValueDo_oct<=150)
noTone(speaker);