-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aeac2a3
commit ce82d9f
Showing
11 changed files
with
5,927 additions
and
76 deletions.
There are no files selected for viewing
Empty file.
Binary file not shown.
Binary file not shown.
1,397 changes: 1,397 additions & 0 deletions
1,397
examples/serial-test/build/sensebox.samd.sb/serial-test.ino.hex
Large diffs are not rendered by default.
Oops, something went wrong.
2,584 changes: 2,584 additions & 0 deletions
2,584
examples/serial-test/build/sensebox.samd.sb/serial-test.ino.map
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file added
BIN
+29.8 KB
examples/serial-test/build/sensebox.samd.sb/serial-test.ino.with_bootloader.bin
Binary file not shown.
1,857 changes: 1,857 additions & 0 deletions
1,857
examples/serial-test/build/sensebox.samd.sb/serial-test.ino.with_bootloader.hex
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,36 @@ | ||
#include <SolarCharger.h> | ||
#include <SolarChargerSB041.h> | ||
#include <Wire.h> | ||
// #include <senseBoxIO.h> // only needer fo senseBox MCU | ||
|
||
SolarCharger solar; | ||
SolarChargerSB041 charger; | ||
|
||
void setup() { | ||
Wire.begin(); | ||
Serial.begin(9600); | ||
} | ||
|
||
void loop() { | ||
solar.update(); | ||
charger.update(); | ||
|
||
if (solar.isConnected()) { | ||
Serial.print("Solar Panel Voltage: "); | ||
Serial.println(solar.getSolarPanelVoltage()); | ||
Serial.print("Battery Voltage: "); | ||
Serial.println(solar.getBatteryVoltage()); | ||
Serial.print("Battery Level: "); | ||
Serial.println(solar.getBatteryLevel()); | ||
Serial.print("Charging: "); | ||
Serial.println(solar.isCharging() ? "Yes" : "No"); | ||
Serial.print("Fast Charging: "); | ||
Serial.println(solar.isFastCharging() ? "Yes" : "No"); | ||
Serial.print("Battery Temperature: "); | ||
Serial.println(solar.getBatteryTemperature()); | ||
} else { | ||
Serial.println("Solar charger not connected."); | ||
} | ||
Serial.print("Charger Connected: "); | ||
Serial.println(charger.isChargerConnected() ? "true" : "false"); | ||
Serial.print("Solar Panel Voltage: "); | ||
Serial.println(charger.getSolarPanelVoltage()); | ||
Serial.print("Battery Voltage: "); | ||
Serial.println(charger.getBatteryVoltage()); | ||
Serial.print("Charging: "); | ||
Serial.println(charger.isCharging() ? "true" : "false"); | ||
Serial.print("Fast Charging: "); | ||
Serial.println(charger.isFastCharging() ? "true" : "false"); | ||
Serial.print("Battery Level: "); | ||
Serial.println(charger.getBatteryLevel()); | ||
Serial.print("Good Input Voltage: "); | ||
Serial.println(charger.isGoodInputVoltage() ? "true" : "false"); | ||
Serial.print("Battery Present: "); | ||
Serial.println(charger.isBatteryPresent() ? "true" : "false"); | ||
Serial.print("Battery Temperature: "); | ||
Serial.println(charger.getBatteryTemperature()); | ||
Serial.println(); | ||
|
||
delay(1000); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
name=SolarChargerSB041 | ||
version=1.0.0 | ||
author=Dein Name | ||
maintainer=Dein Name <[email protected]> | ||
sentence=Eine Arduino-Bibliothek für das Auslesen des Solarladereglers SB-041. | ||
paragraph=Diese Bibliothek ermöglicht das einfache Auslesen von Daten wie Batterie- und Solarpanel-Spannung, Ladezustand und Temperatur. | ||
author=Björn Luig | ||
maintainer=Björn Luig | ||
sentence=Library to read data from the SB041 solar charger designed for the senseBox. | ||
paragraph=This library enables easy reading of data such as battery and solar panel voltage, charge status, and temperature. | ||
category=Sensors | ||
url=https://github.com/dein-repo | ||
url=https://github.com/sensebox/SolarChargerSB041 | ||
architectures=* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,42 @@ | ||
#ifndef SOLARCHARGER_H | ||
#define SOLARCHARGER_H | ||
/* | ||
SolarChargerSB041.h - Library to read data from the SB041 solar charger | ||
designed for the senseBox. Created by Björn Luig, Dec. 6, 2024. Released into | ||
the public domain. | ||
*/ | ||
|
||
#include <Wire.h> | ||
|
||
class SolarCharger { | ||
public: | ||
SolarCharger(uint8_t address = 0x32); | ||
#ifndef SOLARCHARGER_H | ||
#define SOLARCHARGER_H | ||
#ifndef SOLARCHARGERSB041_H | ||
#define SOLARCHARGERSB041_H | ||
|
||
#include <Wire.h> | ||
|
||
class SolarCharger { | ||
public: | ||
SolarCharger(uint8_t address = 0x32); | ||
|
||
void update(); | ||
bool isConnected() const; | ||
float getSolarPanelVoltage() const; | ||
float getBatteryVoltage() const; | ||
int getBatteryLevel() const; | ||
bool isCharging() const; | ||
bool isFastCharging() const; | ||
float getBatteryTemperature() const; | ||
|
||
private: | ||
uint8_t address; | ||
bool connected; | ||
float solarPanelVoltage; | ||
float batteryVoltage; | ||
int batteryLevel; | ||
bool charging; | ||
bool fastCharging; | ||
float batteryTemperature; | ||
}; | ||
#include "Arduino.h" | ||
|
||
#endif // SOLARCHARGER_H | ||
class SolarChargerSB041 { | ||
public: | ||
SolarChargerSB041(uint8_t address = 0x32); | ||
|
||
void update(); | ||
bool isConnected() const; | ||
bool isChargerConnected() const; | ||
float getSolarPanelVoltage() const; | ||
float getBatteryVoltage() const; | ||
int getBatteryLevel() const; | ||
bool isCharging() const; | ||
bool isFastCharging() const; | ||
int getBatteryLevel() const; | ||
bool isGoodInputVoltage() const; | ||
bool isBatteryPresent() const; | ||
float getBatteryTemperature() const; | ||
|
||
private: | ||
uint8_t address; | ||
bool connected; | ||
bool chargerConnected; | ||
float solarPanelVoltage; | ||
float batteryVoltage; | ||
int batteryLevel; | ||
bool charging; | ||
bool fastCharging; | ||
int batteryLevel; | ||
bool goodInputVoltage; | ||
bool batteryPresent; | ||
float batteryTemperature; | ||
}; | ||
|
||
#endif // SOLARCHARGER_H | ||
#endif // SOLARCHARGERSB041_H |