Skip to content

Commit

Permalink
-------
Browse files Browse the repository at this point in the history
  • Loading branch information
cclngit committed Jul 4, 2024
1 parent d853267 commit 8a8a90a
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 2 deletions.
1 change: 1 addition & 0 deletions Firmware/MTR_Charger_X5S/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ framework = arduino

lib_deps =
https://github.com/MoreThanRobotsFR/MTR_STUSB4500#main
https://github.com/MoreThanRobotsFR/MTR_ADS7830#main
23 changes: 22 additions & 1 deletion Firmware/MTR_Charger_X5S/src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@

#include <Wire.h>
#include <MTR_STUSB4500.h>
#include <MTR_ADS7830.h>

#define ADS7830_ADDRESS 0x48 // I2C Address (assuming A0 and A1 are both tied to GND)

// Create an instance of the ADS7830 class
MTR_ADS7830 adc;

// Create an instance of the STUSB4500 class
MTR_STUSB4500 stusb4500;

void setup() {

// Initialize the serial port
Serial.begin(9600);

adc.init();

// Initialize the STUSB4500 device
stusb4500.init();

Expand Down Expand Up @@ -41,5 +54,13 @@ void loop() {
Serial.println(deviceID, HEX);
}

delay(1000); // Wait for 1 second
for (uint8_t i = 0; i < 8; i++) {
uint8_t value = adc.readChannel(i);
Serial.print("Channel ");
Serial.print(i);
Serial.print(": ");
Serial.println(value);
}

delay(1000); // Wait for a second before the next read
}
Binary file not shown.
Binary file not shown.
1 change: 0 additions & 1 deletion Hardware/~MTR_Charger_X5S.kicad_sch.lck

This file was deleted.

0 comments on commit 8a8a90a

Please sign in to comment.