Demo entry 6342121

Fase 1 - 1

   

Submitted by Arnau on Jan 05, 2017 at 18:31
Language: Arduino. Code size: 393 Bytes.

/* Inicialitzacio de constants i variables */
int val = 0;
const int maxPotenciometre = 371;

void setup(){
    Serial.begin(9600); // Velocitat de transmissio de dades
}

void loop(){
    val = analogRead(A0); // El pin ha de ser analogic
    /* Valor percentual del potenciometre */
    Serial.println(val*100/maxPotenciometre);
    delay(100); // Deixem temps per la transmissio de dades
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).