don't check 3.3V on Pico 0.1 board

pull/182/head
alanbjohnston 3 years ago committed by GitHub
parent c2749f0e9e
commit e493eeac06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2056,10 +2056,11 @@ void read_ina219()
{ {
if (voltage_read && !i2c_bus1 && !i2c_bus3) if (voltage_read && !i2c_bus1 && !i2c_bus3)
Serial.println("Nothing to read"); Serial.println("Nothing to read");
/*
#ifdef PICO_0V1 #ifdef PICO_0V1
digitalWrite(PI_3V3_PIN, HIGH); digitalWrite(PI_3V3_PIN, HIGH);
#endif #endif
*/
float shuntvoltage = 0; float shuntvoltage = 0;
float busvoltage = 0; float busvoltage = 0;
float current_mA = 0; float current_mA = 0;
@ -2818,8 +2819,10 @@ void led_set(int ledPin, bool state)
void start_ina219() { void start_ina219() {
//#define PI_3V3_PIN 9 // for v0.1 hardware //#define PI_3V3_PIN 9 // for v0.1 hardware
Serial.println("Starting INA219"); Serial.println("Starting INA219");
Serial.println(PI_3V3_PIN); // Serial.println(PI_3V3_PIN);
ina219_started = true; ina219_started = true;
#ifndef PICO_0V1
// check if Pi is present by 3.3V voltage // check if Pi is present by 3.3V voltage
pinMode(PI_3V3_PIN, INPUT); pinMode(PI_3V3_PIN, INPUT);
// Serial.print("Pi 3.3V: "); // Serial.print("Pi 3.3V: ");
@ -2830,9 +2833,13 @@ void start_ina219() {
digitalWrite(PI_3V3_PIN, HIGH); digitalWrite(PI_3V3_PIN, HIGH);
} else { } else {
Serial.println("Not powering INA219s since Pi Zero is present"); Serial.println("Not powering INA219s since Pi Zero is present");
// pinMode(MAIN_INA219, OUTPUT);
// digitalWrite(MAIN_INA219, HIGH);
} }
#else
Serial.println("Powering INA219s through 3.3V pin");
pinMode(PI_3V3_PIN, OUTPUT);
digitalWrite(PI_3V3_PIN, HIGH);
#endif
sleep(0.1); sleep(0.1);
i2c_bus1 = ina219_1_0x40.begin(); // check i2c bus 1 i2c_bus1 = ina219_1_0x40.begin(); // check i2c bus 1
ina219_1_0x41.begin(); ina219_1_0x41.begin();

Loading…
Cancel
Save

Powered by TurnKey Linux.