-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathMAX1704.ino
More file actions
44 lines (37 loc) · 1.66 KB
/
MAX1704.ino
File metadata and controls
44 lines (37 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/**************************************************************************
* *
* MAX1704* Driver for Arduino *
* *
* Matthew Newberry *
* mattnewberry@me.com *
* *
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU License. *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU License V2 for more details. *
* *
***************************************************************************/
#include "Arduino.h"
#include "Wire.h"
#include "MAX1704.h"
MAX1704 fuelGauge;
void setup(){
Wire.begin();
Serial.begin(9600);
Serial.println("Starting up...");
delay(1000);
fuelGauge.reset();
fuelGauge.quickStart();
fuelGauge.showConfig();
delay(1000);
}
void loop(){
delay(1000);
float charge = fuelGauge.stateOfCharge();
Serial.println(charge);
delay(1000);
}