Нажмите на изображение для увеличения
Название: 20160819_121724[1].jpg
Просмотров: 117
Размер:	43.2 Кб
ID:	1243138

собственно это он
а это код ардуины :

// Display: SDA pin -> Arduino Analog 4 or the dedicated SDA pin
// SCL pin -> Arduino Analog 5 or the dedicated SCL pin

//
// The internal pull-up resistors will be activated when using the
// hardware I2C interfaces.

#include <OLED_I2C.h>

OLED myOLED(SDA, SCL, 8);

extern uint8_t SmallFont[];
extern uint8_t BigFont[];
extern uint8_t MediumNumbers[];
extern uint8_t BigNumbers[];

int sensorPin0 = A0; // select the input pin for otput lm324 (3)
int sensorValue0 = 0; // variable to store the value coming from the sensor
int sensorPin1 = A1; // select the input pin for otput lm324 (7)
int sensorValue1 = 0; // variable to store the value coming from the sensor
int sensorPin2 = A2; // select the input pin for otput lm324 (8)
int sensorValue2 = 0; // variable to store the value coming from the sensor
int sensorPin3 = A3; // select the input pin for otput lm324 (12)
int sensorValue3 = 0; // variable to store the value coming from the sensor
int BatVoltage = 5000;
int Bat1Voltage = 5000;
int Bat2Voltage = 5000;
int Bat3Voltage = 5000;



void setup()
{
myOLED.begin();
myOLED.setFont(SmallFont);
}

void loop()
{
sensorValue0 = analogRead(sensorPin0);
BatVoltage = (sensorValue0*4.919);
sensorValue1 = analogRead(sensorPin1);
Bat1Voltage = (sensorValue1*4.919);
sensorValue2 = analogRead(sensorPin2);
Bat2Voltage = (sensorValue2*4.919);
sensorValue3 = analogRead(sensorPin3);
Bat3Voltage = (sensorValue3*4.919);





myOLED.setFont(SmallFont);
myOLED.print("V", CENTER, 10);
myOLED.print("V", CENTER, 50);

myOLED.setFont(BigNumbers);
myOLED.printNumF(float(BatVoltage/10)/100, 2, LEFT, 0);
myOLED.setFont(BigNumbers);
myOLED.printNumF(float(Bat1Voltage/10)/100, 2, LEFT, 40);
myOLED.setFont(BigNumbers);
myOLED.printNumF(float(Bat2Voltage/10)/100, 2, RIGHT, 0);
myOLED.setFont(BigNumbers);
myOLED.printNumF(float(Bat3Voltage/10)/100, 2, RIGHT, 40);

myOLED.update();
myOLED.clrScr();
}