Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Test_Jig_Firmware.ino
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ byte startReads = 0;
unsigned long stepperCount[5][5];
char port;
char state;
uint8_t current;

void setup()
{
Expand Down Expand Up @@ -255,6 +256,20 @@ void loop()
break;
}

//Set Digital Trimpot
//Format: V<255>
case 'V' :
{
if(isDigit(Serial.peek()))
{
current = Serial.parseInt();
DEBUG_PRINT("setting digital trimpot: ", current);
digipot::setMotorCurrent(current);
}
finished();
break;
}


//Monitor Stepper test
//Format: M<pin to watch>F<frequency>
Expand Down
7 changes: 7 additions & 0 deletions digipot.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,11 @@ void digipot::init() //Initialize Digipot Motor Current
setVoltage(i,digipot_motor_current[i]);
}

void digipot::setMotorCurrent(uint8_t current) //Set Digipot Motor Current
{

SPI.begin();
pinMode(DIGIPOTSS_PIN, OUTPUT);
for(byte i=0; i<=4; i++)
setVoltage(i,current);
}
1 change: 1 addition & 0 deletions digipot.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ namespace digipot{
void write(byte address, byte value);
void init();
void setVoltage(byte driver, byte current);
void setMotorCurrent(uint8_t current); //Set Digipot Motor Current
}
#endif
Empty file modified pins.h
100644 → 100755
Empty file.
Empty file modified rambo.cpp
100644 → 100755
Empty file.
Empty file modified rambo.h
100644 → 100755
Empty file.