Bonjour à tous,
J'ai une question qui va être simple pour beaucoup d'entre vous, (mais pas pour moi...)
Voila j'ai branché sur mon arduino Uno un écran Oled SSD1306 en I2C, et un potentiomètre sur A0.
j'utilise la lib : "ssd1306.h"
Je veux afficher du texte " potar = "sur mon écran, pour cela pas de soucis ça marche nickel.
Mais lorsque je veux afficher la valeur du potentiomètre, celle ci s'affiche en Hex, Bin ou autre...
J'ai essayé différentes polices, aucunes ne marche, il faut probablement convertir la valeur du pot. en une autre, quelqu'un pourrait m'aider svp, je ne sais pas comment afficher la valeur de mon potentiomètre...
#include "ssd1306.h" // Library Ecran
int valPot = A0 ; // Pin Potar
int Potar = 0 ; // Variable Potar
void setup() {
Serial.begin(9600);
ssd1306_128x64_i2c_init(); // on lance l'écran
ssd1306_fillScreen(0x00); // on le colore de noir
ssd1306_setFixedFont(ssd1306xled_font6x8); // on lance la typo
}
void loop() {
Serial.println("Start LOOP");
Potar = analogRead(valPot);
ssd1306_printFixed (15, 32, "Potar = ", STYLE_NORMAL);
ssd1306_printFixed (75, 32, Potar, STYLE_NORMAL);
Serial.print ("Potar = ");
Serial.println(Potar);
delay(300);
Serial.println("End LOOP");
}