Показать сообщение отдельно
Старый 22.07.2016, 13:57   #35
armlive
Старший Пользователь
 
Регистрация: 12.12.2013
Возраст: 44
Город: Армавир
Регион: 23, 93
Машина: Nissan Qashqai
Сообщений: 510
armlive is a glorious beacon of lightarmlive is a glorious beacon of lightarmlive is a glorious beacon of lightarmlive is a glorious beacon of lightarmlive is a glorious beacon of light
По умолчанию

Во первых у тебя библиотека лежит неизвестно знает где, теперь смотри название в библиотеке INA219, а утебя ina219.
у меня все сконвертировалось без проблем. библиотека находиться по пути: Documents\Arduino\libraries\INA219

PHP код:
#include <OneWire.h> 
#include <DallasTemperature.h> 
#include <Wire.h> 
#include <INA219.h> 
#include <SPI.h> 
INA219 monitor
char incomingByte
int analogInput 0
float vout 0.0
float vin 0.0
float R1 100000.0
float R2 10000.0
int value 0
OneWire OW_tempa(9); 
OneWire OW_tempb(10); 
OneWire OW_tempc(11); 
DallasTemperature tempa(&OW_tempa); 
DallasTemperature tempb(&OW_tempb); 
DallasTemperature tempc(&OW_tempc); 
DeviceAddress tempaAddresstempbAddresstempcAddress
void setup(void){ 
Serial.begin(9600); 
 
monitor.begin(69); //i2c addres
  
monitor.configure(0311117);  
// (range, gain, bus_adc, shunt_adc, mode) 
// range = 1 (0-32V bus voltage range) 
// gain = 3 (1/8 gain - 320mV range) 
// bus adc = 3 (12-bit, single sample, 532uS conversion time) 
// shunt adc = 3 (12-bit, single sample, 532uS conversion time) 
// mode = 7 (continuous conversion) 
// test shunt = 115mm of 22AWG solid copper = 0.3 Ohms 
monitor.calibrate(0.0990.1584162); 
//R_шунта, напряж_шунта, макcнапряж, максток 
pinMode(analogInput,INPUT); 
tempa.begin(); 
tempb.begin(); 
tempc.begin(); 

void loop(void){ 
for(
int i 0100i++)  
  { 
  
Serial.println("******************"); 
  
Serial.print("raw shunt voltage: "); 
  
Serial.println(monitor.shuntVoltageRaw()); 
  
Serial.print("raw bus voltage:   "); 
  
Serial.println(monitor.busVoltageRaw()); 
  
Serial.println("--"); 
  
Serial.print("shunt voltage: "); 
  
Serial.print(monitor.shuntVoltage(), 4); 
  
Serial.println(" mV"); 
  
Serial.print("shunt current: "); 
  
Serial.print(monitor.shuntCurrent() * 10004); 
  
Serial.println(" mA"); 
  
Serial.print("bus voltage:   "); 
  
Serial.print(monitor.busVoltage(), 4); 
  
Serial.println(" V"); 
  
Serial.print("bus power:     "); 
  
Serial.print(monitor.busPower() * 10004); 
  
Serial.println(" mW"); 
  
Serial.println(" "); 
  
Serial.println(" ");  
  
i=0

  
value analogRead(analogInput); 
  
vout = (value*5.0)/1024.0
  
vin vout/(R2/(R1+R2)); 
  if(
vin<0.09){ 
    
vin 0.0
  } 
tempa.requestTemperatures(); 
delay(700); 
Serial.print("<InDoor:"); 
if ( !
tempa.getAddress(tempaAddress,0)){ 
Serial.print("0"); 
}else{ 
Serial.print(tempa.getTempCByIndex(0),1); 

Serial.println(">"); 
tempb.requestTemperatures(); 
delay(700); 
Serial.print("<OutDoor:"); 
if ( !
tempb.getAddress(tempbAddress,0)){ 
Serial.print("0"); 
}else{ 
Serial.print(tempb.getTempCByIndex(0),1); 

Serial.println(">"); 
tempc.requestTemperatures(); 
delay(700); 
Serial.print("<Engine:"); 
if ( !
tempc.getAddress(tempcAddress,0)){ 
Serial.print("0"); 
}else{ 
Serial.print(tempc.getTempCByIndex(0),1); 

Serial.println(">"); 
delay(700); 
Serial.print("<Voltage:"); 
Serial.print(vin,2); 
Serial.println(">"); 

Сконвертироваться должно и без ардуино)
__________________
Nexus 7 (2013) Nissan Qashqai

Последний раз редактировалось armlive; 22.07.2016 в 19:33.
armlive вне форума   Ответить с цитированием