This commit is contained in:
Cole Deck 2023-09-07 19:32:53 -05:00
parent f28f5ac12c
commit 8f59f0fb15
2 changed files with 5 additions and 1 deletions

View File

@ -294,7 +294,7 @@ typedef MCP3XXX_<10, 4, 10000> MCP3004;
/// Max clock frequency for 5.0V: 3600000 Hz
/// \sa http://ww1.microchip.com/downloads/en/DeviceDoc/21295C.pdf
//typedef MCP3XXX_<10, 8, 1350000> MCP3008;
typedef MCP3XXX_<10, 8, 5000> MCP3008;
typedef MCP3XXX_<10, 8, 10000> MCP3008;
// /// \brief A typedef for the MCP3202.
// /// Max clock frequency for 2.7V: 900000 Hz

View File

@ -432,6 +432,8 @@ void setup() {
byte startpass = pass;
for (size_t i = 0; i < adc.numChannels(); ++i)
{
Serial.print(" ");
Serial.print(adc.analogRead(i));
if (adc.analogRead(i) != 0 && adc.analogRead(i) != 1023) {
pass = startpass+1; // check that at least one reading is successful to confirm MCP3008 is responding
}
@ -552,6 +554,7 @@ void print_status() {
void loop() {
rp2040.wdt_reset();
comm_parse();
if (getButton(SHOULDER_TOP_RIGHT))
turbo = true;
@ -716,6 +719,7 @@ void loop() {
int loopcount = 0;
void loop1() {
rp2040.wdt_reset();
//drive_left(left_enabled, 255);
//digitalWrite(LED_BUILTIN, HIGH);
if(loopcount == 20) {
//print_status();