Paso 2: Código de ejemplo
#include int adc_id = 2; int delay_us = 100000; int HistoryValue = 0; char buffer[100]; void setup() { memset(buffer,0,sizeof(buffer)); } void loop() { int value = analogRead(adc_id); // get adc value value = ((float)value/4096)*sizeof(buffer); if(((HistoryValue>=value) && ((HistoryValue - value) > 2)) || ((HistoryValue 2))) { memset(buffer,'*',value); buffer[value] = 0; printf("%s\n",buffer); } HistoryValue = value; }