Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

fixed sleep & awake

  • Loading branch information...
1 parent 7bf42aa commit 8d86514de1a719a3fd6f0a064dd07bb936373b10 Matthew Newberry committed
Showing with 1 addition and 6 deletions.
  1. +1 −6 MAX1704.cpp
7 MAX1704.cpp
@@ -118,14 +118,9 @@ boolean MAX1704::isSleeping(){
void MAX1704::sleep(){
- Wire.beginTransmission(MAX1704_ADDR);
- Wire.write(MAX1704_CONFIG);
- Wire.write(MAX1704_ALERT_LEVEL);
- Wire.write(32 - level);
- Wire.endTransmission();
-void MAX1704:awake(){
+void MAX1704::awake(){

5 comments on commit 8d86514


I haven't tried this library yet, but i'm curious as to why the awake() method now does nothing.


I got Tina stoping point with this code some time ago and haven't revisited it yet. I left it blank as a placeholder


Ha, "this", not Tina, damn autocorrect


Okay, that makes more sense. :) I may not need sleep(), but if I do make it work I can email you and Tina a patch.


I actually, made several changes - let me know if you want me to email them to you or something. I have awake() and sleep() working, added batteryMillivolts() and clearAlert(). I made a slightly ugly change, requiring a part name when instantiating (eg: MAX1704 fuelGauge(PART_MAX1703);) - the 1703/1704 return different values for the VCELL register (batteryMillivolts()). Anyway, seems to be working - although I don't have a dying battery to test completely. :)

Please sign in to comment.
Something went wrong with that request. Please try again.