Skip to content

Commit 11578db

Browse files
Updated required connection time
1 parent c7c4acc commit 11578db

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

MotorDriver/Embedded/Atmel/localEmbedded/localEmbedded/global.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#define MIN_VOLTAGE 5000
1818
#define STOP 0
1919

20-
#define REQUIRED_INTERRUPT_COUNT 2
20+
#define REQUIRED_INTERRUPT_COUNT 1
2121

2222
extern volatile bool lostRemoteConnection;
2323
extern volatile bool overCurrent;

MotorDriver/Embedded/Atmel/localEmbedded/localEmbedded/interrupt.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ ISR(INT0_vect) {
2727
interruptCount++;
2828

2929
if ((PINC & (1 << PINC5)) == (1 << PINC5)) {
30-
setRequiredDirection(true); //set direction as forward if pinc5 is high
30+
setRequiredDirection(false); //set direction as reverse if pinc5 is high
3131
//setDirection(true);
3232
}
3333
else {
34-
setRequiredDirection(false);
34+
setRequiredDirection(true);
3535
//setDirection(false);
3636
}
3737

MotorDriver/Embedded/Atmel/localEmbedded/localEmbedded/timer.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ void timer3_init() {
5353
//64 prescaler, with 8MHz, (125000MHz, 8us per count)
5454
TCCR3B |= (1 << CS30) | (1 << WGM32) | (1 << CS31);
5555

56-
//period = 40ms
57-
OCR3A = 5000;
56+
//period = 150ms
57+
OCR3A = 18750;
5858
//OCR3B = 50;
5959

6060
//enable interrupt on compare match B

0 commit comments

Comments
 (0)