Diferencia entre revisiones de «Sensor de proximidad infrarrojo»
Sin resumen de edición |
Sin resumen de edición |
||
| Línea 200: | Línea 200: | ||
<syntaxhighlight lang="c++" line copy> | <syntaxhighlight lang="c++" line copy> | ||
/*************************************************** | |||
DFPlayer - A Mini MP3 Player For Arduino | |||
<https://www.dfrobot.com/product-1121.html> | <https://www.dfrobot.com/product-1121.html> | ||
| Línea 263: | Línea 265: | ||
myDFPlayer.volume(20); //Set volume value. From 0 to 30 | myDFPlayer.volume(20); //Set volume value. From 0 to 30 | ||
myDFPlayer.play(1); //Play the first mp3 | |||
myDFPlayer.loop(1); | myDFPlayer.enableLoop(); | ||
//myDFPlayer.loop(1); | |||
pinMode (11, OUTPUT); | pinMode (11, OUTPUT); | ||
int val = 51; | int val = 51; | ||
analogWrite(11, val); | analogWrite(11, val); | ||
| Línea 304: | Línea 307: | ||
delay(50); | delay(50); | ||
if (difference < 0) difference = 0; | // limitamos entre en 0 y 255 | ||
if (difference < 0) difference = 0; | |||
if (difference > 255) difference = 255; | if (difference > 255) difference = 255; | ||
analogWrite(11, difference); | |||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||