-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathisometryx-2.0.ino
64 lines (49 loc) · 1.57 KB
/
isometryx-2.0.ino
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include "Config.h"
#include "Workout.h"
Workout workout;
void setup() {
Serial.begin(1000000);
/*
float latestBodyWeight = readFloat(BODYWEIGHT_EEPROM_ADDRESS);
Serial.print(F("Read climber data from EEPROM : "));
Serial.println(latestBodyWeight);
workout.setBodyWeight(latestBodyWeight);
*/
scaleDown.begin(L_LOADCELL_DOUT_PIN, L_LOADCELL_SCK_PIN);
scaleDown.set_scale(22.04622621848775f);
//scaleDown.set_scale(10.83f);
scaleDown.tare(10);
scaleUp.begin(R_LOADCELL_DOUT_PIN, R_LOADCELL_SCK_PIN);
scaleUp.set_scale(22.04622621848775f);
//scaleUp.set_scale(2.35f);
scaleUp.tare(10);
// SSD1306_SWITCHCAPVCC = generate display voltage from 3.3V internally
if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // Address 0x3C for 128x32
Serial.println(F("SSD1306 allocation failed"));
for (;;); // Don't proceed, loop forever
}
display.clearDisplay();
display.setTextSize(2);
display.setTextColor(WHITE);
display.setCursor(0, 0);
display.println(F("Isometryx"));
display.println(F("Hang"));
display.println(F("Harder"));
display.display();
if ( !ble.begin(VERBOSE_MODE) ) {
error(F("Couldn't find Bluefruit, make sure it's in CoMmanD mode & check wiring?"));
}
//ble.sendCommandCheckOK("AT+GAPDEVNAME=Isometryx");
/* if ( ! ble.factoryReset() ){
error(F("Couldn't factory reset BLE device"));
}
ble.echo(false);
ble.info();*/
ble.setMode(BLUEFRUIT_MODE_DATA);
ble.verbose(false); // debug info is a little annoying after this point!
delay(1000);
}
void loop() {
workout.loop();
delay(FRAME_RATE_MS);
}