I just want to confirm that this error means I'm just trying to send too much at once over the link cable?
"Link message size out of bounds: 833"
Thanks for the help!
"Link message size out of bounds: 833"
Thanks for the help!
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
QuoteJasonTC — 03/22/2022
It is possible to check the battery voltage. The battery is connected on ADC0/GPIO26 to a voltage divider.
I don't have anything in MicroPython, but here's some Arduino C/C++ code someone else wrote:
float total = 0.0f;
const int numberSamples = 25;
for(int i=0; i<numberSamples; i++){
float battVoltage = analogRead(A0);
battVoltage = 2.0 * 3.3 * battVoltage / (4095.0);
battVoltage = (int) (battVoltage * 100.0 + 0.5) / 100.0;
total += battVoltage;
}
Serial.print("Battery: ");
Serial.println(total/numberSamples);
adc = ADC(26)
battVoltage = 1.0
numberSamples = 25
while(1):
total = 0
for int in range (0, numberSamples):
thumby.display.fill(0)
battVoltage = adc.read_u16()
battVoltage = 2.0 * 3.3 * battVoltage / (4095.0)
battVoltage = (battVoltage * 100.0 + 0.5) / 100.0
total = battVoltage + total
thumby.display.update()
thumby.display.fill(0)
thumby.display.drawText("Battery:", 1, 1, 1)
thumby.display.drawText(str(total/numberSamples), 1, 11, 1)
battVoltage = adc.read_u16()
thumby.display.drawText(str(battVoltage), 1, 21, 1)
thumby.display.update()
time.sleep(2)