Skip to content

Commit c41749f

Browse files
authored
Merge pull request #6 from KravitzLabDevices/dev
Ready for release 0.0.1
2 parents 572362f + db81dd0 commit c41749f

3 files changed

Lines changed: 32 additions & 8 deletions

File tree

library.properties

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name=FORCE2
2+
3+
version=0.0.1
4+
5+
author=Kravitz Lab
6+
7+
maintainer= Alex Legaria <alegariamacal@wustl.edu>
8+
9+
depends= Adafruit GFX Library, Adafruit NeoPixel, Adafruit seesaw Library, Adafruit SPIFlash, Adafruit ST7735 and ST7789, SdFat - Adafruit Fork, Adafruit BusIO
10+
11+
sentence=This is a library for operating FORCE2
12+
13+
paragraph= FORCE2 is a force sensing device for mice, built by Bridget Matikainen-Ankney
14+
15+
category=Device Control
16+
17+
url= https://github.com/KravitzLabDevices/FORCE2
18+
19+
architectures=*

src/Force.cpp

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,9 +1097,7 @@ void Force::graphLegend() {
10971097
if (trial_available) {
10981098
tft.setCursor(60,50);
10991099
tft.setTextColor(ST7735_WHITE);
1100-
tft.print("Trial Available");
1101-
//tft.print((trial_window - trial_length)/1000, 3);
1102-
//tft.fillRect(90, 30, 100, 12, ST7735_BLACK);
1100+
tft.print("Trial Available");
11031101
} else {
11041102
tft.fillRect(45, 30, 100, 12, ST7735_BLACK);
11051103
}
@@ -1464,8 +1462,6 @@ void Force::DispenseLeft() {
14641462
}
14651463
DateTime now = rtc.now();
14661464
dispenseTime = now.unixtime();
1467-
//digitalWrite(A2, LOW);
1468-
//digitalWrite(13, LOW);
14691465
pressTimeLeft = millis();
14701466
pressLengthLeft = 0;
14711467
dispensing = false;
@@ -1525,6 +1521,7 @@ void Force::SenseLeft() {
15251521
pressLengthLeft = (millis() - pressTimeLeft);
15261522
}
15271523

1524+
//Getting the data ready to send output through BNC
15281525
outputValueLeft = map(gramsLeft, 0, 200, 0, 4095);
15291526

15301527
if (outputValueLeft > 4000) outputValueLeft = 4000;
@@ -1539,7 +1536,7 @@ void Force::SenseLeft() {
15391536
pixels.setPixelColor(0, pixels.Color(0, outputValueLeft / 100, outputValueRight / 100));
15401537
pixels.show();
15411538

1542-
lickLeft = digitalRead(LICK1) == HIGH;
1539+
//lickLeft = digitalRead(LICK1) == HIGH;
15431540
Tare();
15441541
}
15451542

@@ -1575,10 +1572,19 @@ void Force::SenseRight() {
15751572
pixels.setPixelColor(0, pixels.Color(0, outputValueLeft / 100, outputValueRight / 100));
15761573
pixels.show();
15771574

1578-
lickRight = digitalRead(LICK2) == HIGH;
1575+
//lickRight = digitalRead(LICK2) == HIGH;
15791576
Tare();
15801577
}
15811578

1579+
//////////////////////////////
1580+
//// Check licks ////
1581+
/////////////////////////////
1582+
void Force::checkLicks() {
1583+
lickLeft = digitalRead(LICK1) == HIGH;
1584+
lickLeft = digitalRead(LICK2) == HIGH;
1585+
}
1586+
1587+
15821588
//////////////////////////////
15831589
//// Prime dispense ////
15841590
/////////////////////////////

src/Force.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ class Force {
154154
int start_timer = 0;
155155
int trial_start = 0;
156156
int trial_window = 10000; // Time window between possible start of the trial and lever press
157-
int trial_length = 0;
158157
bool trial_available = false;
159158

160159
int pressesLeft = 0;

0 commit comments

Comments
 (0)