Flex Fuel Oled

Odpovědět
mato2sk
Příspěvky: 11
Registrován: 28 čer 2018, 08:08
Reputation: 0

Flex Fuel Oled

Příspěvek od mato2sk » 28 čer 2018, 09:01

Zdravím komunitu Arduino.
Chcem si zostrojiť do auta flex fuel anylzér ktorý na základe hotnoty etanolu upravuje riadiacu jednotku auta našiel som kód ktorý by mi vyhovoval, až na to že hodnotu etanolu zobrazuje cez PLX iMFD display ktorý je pomerne drahý, tak to chcem prerobyť na Oled 1306.
Upravil som preto kód na nasledujúci, ale hodnotu etanolu mi zobrazuje stále 0. Arduinu som vpodstate začiatočník preto sa obraciam na vás o radu.

Kód: Vybrat vše

//Flex Fuel sensor code
//Input frequency on pin 8 - pulled up to 5V through 1.8K resistor
//V_out pin 3 - 0-5V output through 1.8K resistor with 100uF capacitor to ground
//PLX iMFD serial packet on Tx pin 0 through 3.3V TTL voltage divider (3.3K/6.8K)

//TRAC double click code
//Input switch on pin 6 - pulled up to 5V through 3.3K resistor + 3.3uF capacitor.
//Output on pin 10 through NPN transistor to take VSC connection to ground



#include <Arduino.h>
#include <FreqMeasure.h>
#include <EEPROM.h>
#include "U8glib.h"
U8GLIB_SSD1306_128X64 mujOled(U8G_I2C_OPT_NONE);

//FlexFuel sensor
double sum = 0;
int count = 0;
int ethanol_int, V_out_int;
float freq, ethanol, V_out, V_out_avg, E_scalar;
float E0 = 55.4; //calibration data for pure gasoline
float E85 = 130.8; //calibration data for E85

//EEPROM store
int EE_V_addr = 0;
float V_out_default = 147;
long Elast, Enow, Edelta;

//PLX data
//long Plast, Pnow, Pdelta;
// byte PLXpacket[7] {0x80, 0x00, 0x11, 0x00, 0x00, 0x00, 0x40};



//PLX iMFD packet, sent every 100ms:
//0x80      Start byte
//0x00 0x11 Sensor device fuel level
//0x00      Sensor instance
//0x00 0x00 Sensor value (integer, unscaled)
//0x40      Stop byte

//TRAC switch double click
bool TRAC_buttonMonitor = HIGH;
int debounce = 20;
int doubleClick = 200;
int longClick = 3000;
int TRAC_initializeDelay = 5000;
int TRAC_buttonState = 4; //initialize to 0 for normal operation, 4 for on by default after delay
long TRAC_buttonCounter = 0;

//char str[1];
//void drawTest(void) {
 //mujOled.setFont(u8g_font_unifont);
 //mujOled.drawStr( 0, 20, "Flex Fuel");
  //}
  
  

void setup()
{
  pinMode (3, OUTPUT);
  pinMode (10, OUTPUT);
  digitalWrite (10, LOW);
  pinMode (6, INPUT);

  EEPROM.get(EE_V_addr, V_out_avg); //load last V_out_avg
  if (isnan(V_out_avg))
  {
    V_out_avg = V_out_default;
  }
  V_out_int = (int)V_out_avg; //convert to integer for analogWrite
  analogWrite(3, V_out_int); //output V_out as PWM voltage on pin 3

  Elast = millis();

  E_scalar = (E85 - E0) / 85;

  FreqMeasure.begin();
  Serial.begin(9600);
  //Plast = millis();
  //Serial.println("Flex Fuel");
}

 
void loop()
{

  //Read FlexFuel sensor frequency
  if (FreqMeasure.available())
  {
    // average several readings together
    sum = sum + FreqMeasure.read();
    count = count + 1;
    if (count > 24)
    {
      freq = FreqMeasure.countToFrequency(sum / count);
      sum = 0;
      count = 0;

      //Convert frequency to E%

      ethanol = (freq - E0) / E_scalar; //scale frequency to E% interpolating E0 and E85 values
      if (ethanol > 100)
      {
        ethanol = 100;
      }
      if (ethanol < 0)
      {
        ethanol = 0;
      }
      ethanol_int = (int)ethanol;

      //FlexFuel voltage output

      V_out = 255 - (2.55 * ethanol);
      V_out_avg = V_out_avg + (0.1 * (V_out - V_out_avg)); //V_out_avg as moving average
      V_out_int = (int)V_out_avg; //convert to integer for analogWrite

      analogWrite(3, V_out_int); //output V_out as PWM voltage on pin 3
    }
  }

  //Store EEPROM data every 5 minutes

  Enow = millis();
  Edelta = Enow - Elast;
  if (Edelta >= 300000)
  {
    Elast = Enow;
    EEPROM.put(EE_V_addr,  V_out_avg ); //store V_out_avg to EEPROM
  }

  //PLX data packet

  //Pnow = millis(); //send PLX packet on Tx pin every 100ms
 // Pdelta = Pnow - Plast;
//if (Pdelta >= 100)
//{
//if (ethanol_int > 63) { //PLX iMFD only uses 6 LSB bits, 2 MSB must be 00 in each byte
 //     Plast = Pnow;
//      PLXpacket[4] = 0x01;
  //    int ethanol_int_LSB = ethanol_int - 64;
    //  PLXpacket[5] = ethanol_int_LSB;
      //Serial.write(PLXpacket, 7);
  //  }
  //  else {
    //  Plast = Pnow;
    //  PLXpacket[4] = 0x00;
     // PLXpacket[5] = ethanol_int; //set data byte in PLX packet to E%
     // Serial.write(PLXpacket, 7);
   // }
 //}

mujOled.firstPage();
    do { 
  
      
    mujOled.setFont(u8g_font_helvB08);
    mujOled.setPrintPos( 0, 15);
    mujOled.print("Eth:");
    mujOled.setPrintPos( 40, 15);
    mujOled.print(ethanol_int);
    mujOled.setPrintPos( 80, 15);
    mujOled.print("%");
    
     } while( mujOled.nextPage() );
   

  
  //TRAC switch doubleclick

  TRAC_buttonMonitor = digitalRead(6);
  switch (TRAC_buttonState)
  {
    case 0: //inactive

      if (TRAC_buttonMonitor == LOW)  // button pressed
      {
        digitalWrite (10, HIGH); //Transistor on
        TRAC_buttonState = 1; //increment state
      }
      break;

    case 1: //check for release
      if (TRAC_buttonMonitor == HIGH) //if button released
      {
        TRAC_buttonCounter = millis(); //start counter
        TRAC_buttonState = 2; //increment state
      }
      break;

    case 2: //wait for doubleClick
      if (TRAC_buttonMonitor == LOW && (millis() - TRAC_buttonCounter) > debounce && (millis() - TRAC_buttonCounter) < doubleClick) //second click registered
      {
        TRAC_buttonState = 3; //increment state
      }
      else if ((millis() - TRAC_buttonCounter) > doubleClick)
      {
        digitalWrite (10, LOW); //Transistor off
        TRAC_buttonState = 0; //reset state
      }
      break;

    case 3: //doubleClick made
      if ((millis() - TRAC_buttonCounter) > longClick)
      {
        digitalWrite (10, LOW); //Transistor off
        TRAC_buttonState = 0; //reset state
      }
      break;

    case 4: //initialize after delay by default
      if (millis() > TRAC_initializeDelay)
      {
        digitalWrite (10, HIGH); //Transistor on
        TRAC_buttonCounter = millis(); //start counter
        TRAC_buttonState = 3; //set state to doubleClick
      }
      break;
  }

}

mato2sk
Příspěvky: 11
Registrován: 28 čer 2018, 08:08
Reputation: 0

Re: Flex Fuel Oled

Příspěvek od mato2sk » 01 črc 2018, 13:29

Problém zo zobrazením som už vyriešil prekopal som kód ale eŠte ma trápi že mi neobnovuje údaje na obrazovke zobrazia sa po zapnutí a keď sa zmenia hodnoty tak zostávajú zobrazené pôvodné viete mi stím poradiť. ďakujem

Kód: Vybrat vše

// Adafruit_SSD1306 - Version: Latest 
#include <Arduino.h>
#include <Wire.h>
#include <EEPROM.h>
#include <U8glib.h>
U8GLIB_SSD1306_128X64 mujOled(U8G_I2C_OPT_NONE);

//long prepis = 0;
//char str[10];
uint16_t pwm_output  = 0;      //integer for storing PWM value (0-255 value)
int HZ = 0;                  //unsigned 16bit integer for st
int inpPin = 8;
int V_out_int;
float V_out, V_out_avg, E_scalar;
float E0 = 55.4; //calibration data for pure gasoline
float E85 = 130.8; //calibration data for E85


//Define global variables
volatile uint16_t revTick;    //Ticks per revolutionoring HZ input
int ethanol = 0;              //Store ethanol percentage here
float expectedv;              //store expected voltage here - range for typical GM sensors is usually 0.5-4.5v
uint16_t voltage = 0;              //store display millivoltage here (0-5000)
//temperature variables
int duty;                     //Duty cycle (0.0-100.0)
float period;                 //Store period time here (eg.0.0025 s)
float temperature = 0;        //Store fuel temperature here
int fahr = 0;
int cels = 0;
int celstemp = 0;
float fahrtemp = 0;
static long highTime = 0;
static long lowTime = 0;
static long tempPulse;

//EEPROM store
int EE_V_addr = 0;
float V_out_default = 147;
long Elast, Enow, Edelta;

//TRAC switch double click
bool TRAC_buttonMonitor = HIGH;
int debounce = 20;
int doubleClick = 200;
int longClick = 3000;
int TRAC_initializeDelay = 5000;
int TRAC_buttonState = 4; //initialize to 0 for normal operation, 4 for on by default after delay
long TRAC_buttonCounter = 0;

void setupTimer()   // setup timer1
{           
  TCCR1A = 0;      // normal mode
  TCCR1B = 132;    // (10000100) Falling edge trigger, Timer = CPU Clock/256, noise cancellation on
  TCCR1C = 0;      // normal mode
  TIMSK1 = 33;     // (00100001) Input capture and overflow interupts enabled
  
  TCNT1 = 0;       // start from 0
}

ISR(TIMER1_CAPT_vect)    // PULSE DETECTED!  (interrupt automatically triggered, not called by main program)
{
  revTick = ICR1;      // save duration of last revolution
  TCNT1 = 0;       // restart timer for next revolution
}

ISR(TIMER1_OVF_vect)    // counter overflow/timeout
{ revTick = 0; }        // Ticks per second = 0



void setup() {

  pinMode (3, OUTPUT);
  pinMode (10, OUTPUT);
  digitalWrite (10, LOW);
  pinMode (6, INPUT);

  EEPROM.get(EE_V_addr, V_out_avg); //load last V_out_avg
  if (isnan(V_out_avg))
  {
    V_out_avg = V_out_default;
  }
  V_out_int = (int)V_out_avg; //convert to integer for analogWrite
  analogWrite(3, V_out_int); //output V_out as PWM voltage on pin 3
  
E_scalar = (E85 - E0) / 85;

  setupTimer();
  Serial.begin(9600);

  // by default, we'll generate the high voltage from the 3.3v line internally! (neat!)  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  // initialize with the I2C addr 0x3D (for the 128x64)
  // init done
}

void loop() {
  getfueltemp(inpPin); //read fuel temp from input duty cycle
  
  if (revTick > 0) // Avoid dividing by zero, sample in the HZ
      {HZ = 62200 / revTick;}     // 3456000ticks per minute, 57600 per second 
      else                        // 62200 calibrated for more accuracy
      {HZ = 0;}                   
  
    //calculate ethanol percentage
     /* if (HZ > 50) // Avoid dividing by zero
      {ethanol = HZ-50;}
      else
      {ethanol = 0;}
  
  if (ethanol > 99) // Avoid overflow in PWM
  {ethanol = 99;}
  */
  ethanol = (HZ - E0) / E_scalar; //scale frequency to E% interpolating E0 and E85 values
      if (ethanol > 100)
      {
        ethanol = 100;
      }
      if (ethanol < 0)
      {
        ethanol = 0;
      }
    //  ethanol_int = (int)ethanol;
 {
    V_out = 255 - (2.55 * ethanol);
      V_out_avg = V_out_avg + (0.1 * (V_out - V_out_avg)); //V_out_avg as moving average
      V_out_int = (int)V_out_avg; //convert to integer for analogWrite

      analogWrite(3, V_out_int); //output V_out as PWM voltage on pin 3
    }
  

  //Store EEPROM data every 5 minutes

  Enow = millis();
  Edelta = Enow - Elast;
  if (Edelta >= 300000)
  {
    Elast = Enow;
    EEPROM.put(EE_V_addr,  V_out_avg ); //store V_out_avg to EEPROM
  }

    
//if (millis()-prepis > 1) {
    // následující skupina příkazů
    // obnoví obsah OLED displeje
  

    mujOled.firstPage();
  do {
    mujOled.setFont(u8g_font_helvB08);
    
    //Printing the data on the OLED
mujOled.drawStr(0, 15, "Eth: ");
mujOled.drawStr(0, 30, "Temp: ");
mujOled.drawStr(0, 45, "Freq: ");
mujOled.setPrintPos(72, 15);         //setting the dimensions to print the ethanol
mujOled.print(ethanol, 10);
mujOled.println("%"); 
mujOled.setPrintPos(72, 30);   //setting the dimensions to print the temperature fuel
mujOled.print(cels, 10);     
mujOled.println("C");
mujOled.setPrintPos(72, 45);   //setting the dimensions to print the frequency
mujOled.print(HZ, 10);     
mujOled.println("Hz");

    } 
    while( mujOled.nextPage() );

   // prepis = millis();
  //}
  
 
    
    delay(1000);
}

void getfueltemp(int inpPin){ //read fuel temp from input duty cycle
  highTime = 0;
  lowTime = 0;
  
  tempPulse = pulseIn(inpPin,HIGH);
    if(tempPulse>highTime){
    highTime = tempPulse;
    }
  
  tempPulse = pulseIn(inpPin,LOW);
    if(tempPulse>lowTime){
    lowTime = tempPulse;
    }
  
  duty = ((100*(highTime/(double (lowTime+highTime))))); //Calculate duty cycle (integer extra decimal)
  float T = (float(1.0/float(HZ)));             //Calculate total period time
  float period = float(100-duty)*T;             //Calculate the active period time (100-duty)*T
  float temp2 = float(10) * float(period);      //Convert ms to whole number
  temperature = ((40.25 * temp2)-81.25);        //Calculate temperature for display (1ms = -40, 5ms = 80)
  celstemp = int(temperature);
  cels = celstemp;
  fahrtemp = ((temperature*1.8)+32);
  fahr = fahrtemp;

//TRAC switch doubleclick

  TRAC_buttonMonitor = digitalRead(6);
  switch (TRAC_buttonState)
  {
    case 0: //inactive

      if (TRAC_buttonMonitor == LOW)  // button pressed
      {
        digitalWrite (10, HIGH); //Transistor on
        TRAC_buttonState = 1; //increment state
      }
      break;

    case 1: //check for release
      if (TRAC_buttonMonitor == HIGH) //if button released
      {
        TRAC_buttonCounter = millis(); //start counter
        TRAC_buttonState = 2; //increment state
      }
      break;

    case 2: //wait for doubleClick
      if (TRAC_buttonMonitor == LOW && (millis() - TRAC_buttonCounter) > debounce && (millis() - TRAC_buttonCounter) < doubleClick) //second click registered
      {
        TRAC_buttonState = 3; //increment state
      }
      else if ((millis() - TRAC_buttonCounter) > doubleClick)
      {
        digitalWrite (10, LOW); //Transistor off
        TRAC_buttonState = 0; //reset state
      }
      break;

    case 3: //doubleClick made
      if ((millis() - TRAC_buttonCounter) > longClick)
      {
        digitalWrite (10, LOW); //Transistor off
        TRAC_buttonState = 0; //reset state
      }
      break;

    case 4: //initialize after delay by default
      if (millis() > TRAC_initializeDelay)
      {
        digitalWrite (10, HIGH); //Transistor on
        TRAC_buttonCounter = millis(); //start counter
        TRAC_buttonState = 3; //set state to doubleClick
      }
      break;
  }
  }

mato2sk
Příspěvky: 11
Registrován: 28 čer 2018, 08:08
Reputation: 0

Re: Flex Fuel Oled

Příspěvek od mato2sk » 05 črc 2018, 09:43

Zistil som že som si nekúpil display SSD1306 ale SSD1315 nemáte niekto skússenosti s tímto OLED akú knižnicu treba použiť? Číňan mi napísal že stači bežná knižnca pre 1306 tá mi funguje ale ako som už písal zobrazené údaje sa neobnovujú zobrazia sa raz po zapnutí .

mato2sk
Příspěvky: 11
Registrován: 28 čer 2018, 08:08
Reputation: 0

Re: Flex Fuel Oled

Příspěvek od mato2sk » 24 říj 2018, 20:06

Dávam aj funkčný flex fuel anylyzér (vyhodnocuje percento etanolu v benzíne) ja ho mám na Toyote GT86 viem aj poskytnúť upravenú riadiacu jednotku na flex fuel pre toto auto, ale je to možné použiť aj na iné autá. Bližšie info na nasledujúcom odkaze

Kód: Vybrat vše

http://www.ft86club.com/forums/showthread.php?t=94751&page=6

Kód: Vybrat vše

#include <Arduino.h>
#include <Wire.h>
#include <EEPROM.h>
#include <U8glib.h>
U8GLIB_SSD1306_128X64 mujOled(U8G_I2C_OPT_NONE);

int p;

void pageEthanol();     // Page-1
void pageTemp(); // Page-2
void pageFreq();    // Page-3
void (*pages[])() = { pageEthanol, pageTemp, pageFreq } ;

uint16_t pwm_output  = 0;      //integer for storing PWM value (0-255 value)
int HZ = 0;                  //unsigned 16bit integer for st
int inpPin = 8;
int V_out_int;
float V_out, V_out_avg, E_scalar;
long int prepis = 0;


//Define global variables
volatile uint16_t revTick;    //Ticks per revolutionoring HZ input
int ethanol = 0;              //Store ethanol percentage here
//float expectedv;              //store expected voltage here - range for typical GM sensors is usually 0.5-4.5v
//uint16_t voltage = 0;              //store display millivoltage here (0-5000)
//temperature variables
int duty;                     //Duty cycle (0.0-100.0)
float period;                 //Store period time here (eg.0.0025 s)
float temperature = 0;        //Store fuel temperature here
int fahr = 0;
int cels = 0;
int celstemp = 0;
float fahrtemp = 0;
static long highTime = 0;
static long lowTime = 0;
static long tempPulse;

//EEPROM store
int EE_V_addr = 0;
float V_out_default = 147;
long Elast, Enow, Edelta;

//TRAC switch double click
bool TRAC_buttonMonitor = HIGH;
int debounce = 20;
int doubleClick = 200;
int longClick = 3000;
int TRAC_initializeDelay = 5000;
int TRAC_buttonState = 4; //initialize to 0 for normal operation, 4 for on by default after delay
long TRAC_buttonCounter = 0;

void setupTimer()   // setup timer1
{           
  TCCR1A = 0;      // normal mode
  TCCR1B = 132;    // (10000100) Falling edge trigger, Timer = CPU Clock/256, noise cancellation on
  TCCR1C = 0;      // normal mode
  TIMSK1 = 33;     // (00100001) Input capture and overflow interupts enabled
  
  TCNT1 = 0;       // start from 0
}

ISR(TIMER1_CAPT_vect)    // PULSE DETECTED!  (interrupt automatically triggered, not called by main program)
{
  revTick = ICR1;      // save duration of last revolution
  TCNT1 = 0;       // restart timer for next revolution
}

ISR(TIMER1_OVF_vect)    // counter overflow/timeout
{ revTick = 0; }        // Ticks per second = 0



void setup() {

  pinMode (3, OUTPUT);
  pinMode (10, OUTPUT);
  digitalWrite (10, LOW);
  pinMode (6, INPUT);

  EEPROM.get(EE_V_addr, V_out_avg); //load last V_out_avg
  if (isnan(V_out_avg))
  {
    V_out_avg = V_out_default;
  }
  V_out_int = (int)V_out_avg; //convert to integer for analogWrite
  analogWrite(3, V_out_int); //output V_out as PWM voltage on pin 3
 
  mujOled.setFont(u8g_font_fub25);
  mujOled.setColorIndex(1);
  p = 0;
  setupTimer();
  Serial.begin(9600);

}

void loop() {
   getfueltemp(inpPin); //read fuel temp from input duty cycle
  
  if (revTick > 0) // Avoid dividing by zero, sample in the HZ
     {HZ = 62700 / revTick;}     // (62200)  3456000ticks per minute, 57600 per second 
      else                        // 62200 calibrated for more accuracy
      {HZ = 0;}                   
  
    //calculate ethanol percentage
      if (HZ > 50) // Avoid dividing by zero
      {ethanol = HZ-50;}
      else
      {ethanol = 0;}
  
  if (ethanol > 99) // Avoid overflow in PWM
  {ethanol = 99;}

  
    
 {
    V_out = 255 - (2.65 * ethanol);
      V_out_avg = V_out_avg + (0.1 * (V_out - V_out_avg)); //V_out_avg as moving average
      V_out_int = (int)V_out_avg; //convert to integer for analogWrite

      analogWrite(3, V_out_int); //output V_out as PWM voltage on pin 3
    }
  

  //Store EEPROM data every 5 minutes

  Enow = millis();
  Edelta = Enow - Elast;
  if (Edelta >= 300000)
  {
    Elast = Enow;
    EEPROM.put(EE_V_addr,  V_out_avg ); //store V_out_avg to EEPROM
  }

 mujOled.firstPage();
  do {  
    (*pages[p])();
  } while( mujOled.nextPage() );
    delay(3000); // recovery time Oled 
  p = p+1;
  if (p == 3)
    p=0;
}

void getfueltemp(int inpPin){ //read fuel temp from input duty cycle
  highTime = 0;
  lowTime = 0;
  
  tempPulse = pulseIn(inpPin,HIGH);
    if(tempPulse>highTime){
    highTime = tempPulse;
    }
  
  tempPulse = pulseIn(inpPin,LOW);
    if(tempPulse>lowTime){
    lowTime = tempPulse;
    }
  
  duty = ((100*(highTime/(double (lowTime+highTime))))); //Calculate duty cycle (integer extra decimal)
  float T = (float(1.0/float(HZ)));             //Calculate total period time
  float period = float(100-duty)*T;             //Calculate the active period time (100-duty)*T
  float temp2 = float(10) * float(period);      //Convert ms to whole number
  temperature = ((40.25 * temp2)-81.25);        //Calculate temperature for display (1ms = -40, 5ms = 80)
  celstemp = int(temperature);
  cels = celstemp;
  fahrtemp = ((temperature*1.8)+32);
  fahr = fahrtemp;

//TRAC switch doubleclick
  TRAC_buttonMonitor = digitalRead(6);
  switch (TRAC_buttonState)
  {
    case 0: //inactive

      if (TRAC_buttonMonitor == LOW)  // button pressed
      {
        digitalWrite (10, HIGH); //Transistor on
        TRAC_buttonState = 1; //increment state
      }
      break;

    case 1: //check for release
      if (TRAC_buttonMonitor == HIGH) //if button released
      {
        TRAC_buttonCounter = millis(); //start counter
        TRAC_buttonState = 2; //increment state
      }
      break;

    case 2: //wait for doubleClick
      if (TRAC_buttonMonitor == LOW && (millis() - TRAC_buttonCounter) > debounce && (millis() - TRAC_buttonCounter) < doubleClick) //second click registered
      {
        TRAC_buttonState = 3; //increment state
      }
      else if ((millis() - TRAC_buttonCounter) > doubleClick)
      {
        digitalWrite (10, LOW); //Transistor off
        TRAC_buttonState = 0; //reset state
      }
      break;

    case 3: //doubleClick made
      if ((millis() - TRAC_buttonCounter) > longClick)
      {
        digitalWrite (10, LOW); //Transistor off
        TRAC_buttonState = 0; //reset state
      }
      break;

    case 4: //initialize after delay by default
      if (millis() > TRAC_initializeDelay)
      {
        digitalWrite (10, HIGH); //Transistor on
        TRAC_buttonCounter = millis(); //start counter
        TRAC_buttonState = 3; //set state to doubleClick
      }
      break;
  }
  }
  
void pageEthanol() {
    mujOled.drawStr(0, 28, "Ethanol ");
    mujOled.setPrintPos(32, 64);         //setting the dimensions to print the ethanol
    mujOled.print(ethanol, 10);
    mujOled.println("%");

}
void pageTemp(){
     mujOled.drawStr(10, 28, "Temp: ");
     mujOled.setPrintPos(33, 64);   //setting the dimensions to print the temperature fuel
     mujOled.print(cels, 10);     
     mujOled.println("C");
  
}
void pageFreq() {
 mujOled.drawStr(20, 28, "Freq: ");
mujOled.setPrintPos(12, 64);   //setting the dimensions to print the frequency
mujOled.print(HZ, 10);     
mujOled.println("Hz");

}[code]

Odpovědět

Kdo je online

Uživatelé prohlížející si toto fórum: Žádní registrovaní uživatelé a 7 hostů