WIP: lokale wijzigingen vóór pull
This commit is contained in:
parent
8ccc9e2510
commit
2b8f55e648
51 changed files with 1800868 additions and 1079645 deletions
110940
12V_30A.stp
110940
12V_30A.stp
File diff suppressed because it is too large
Load diff
4596
35mm_din_railv3.stl
4596
35mm_din_railv3.stl
File diff suppressed because it is too large
Load diff
0
3D Printer 2ND Printer mod/Filament Sensor/Filament_sensor.20230808-123751.FCBak
Executable file → Normal file
0
3D Printer 2ND Printer mod/Filament Sensor/Filament_sensor.20230808-123751.FCBak
Executable file → Normal file
345404
3D Printer 2ND Printer mod/Filament Sensor/Wantai_Stepper_Motor_-_Nema_17_-_42BYGHM809.step
Executable file → Normal file
345404
3D Printer 2ND Printer mod/Filament Sensor/Wantai_Stepper_Motor_-_Nema_17_-_42BYGHM809.step
Executable file → Normal file
File diff suppressed because one or more lines are too long
0
4040cross.FCStd
Executable file → Normal file
0
4040cross.FCStd
Executable file → Normal file
219872
CCR10_flaps-Holder.gcode
Normal file
219872
CCR10_flaps-Holder.gcode
Normal file
File diff suppressed because it is too large
Load diff
301547
CCR10_joystick-Main cover.gcode
Normal file
301547
CCR10_joystick-Main cover.gcode
Normal file
File diff suppressed because it is too large
Load diff
27102
CCR10_joystick-Pot1 Gear002.gcode
Normal file
27102
CCR10_joystick-Pot1 Gear002.gcode
Normal file
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
BIN
Filament Sensor/Filament_sensor-Body001.stl
Normal file
BIN
Filament Sensor/Filament_sensor-Body001.stl
Normal file
Binary file not shown.
BIN
Filament Sensor/Filament_sensor.FCStd
Normal file
BIN
Filament Sensor/Filament_sensor.FCStd
Normal file
Binary file not shown.
BIN
Filament Sensor/Filament_sensorv2.FCStd
Normal file
BIN
Filament Sensor/Filament_sensorv2.FCStd
Normal file
Binary file not shown.
172702
Filament Sensor/Wantai_Stepper_Motor_-_Nema_17_-_42BYGHM809.step
Normal file
172702
Filament Sensor/Wantai_Stepper_Motor_-_Nema_17_-_42BYGHM809.step
Normal file
File diff suppressed because one or more lines are too long
0
Filament_sensor-Body001.stl
Executable file → Normal file
0
Filament_sensor-Body001.stl
Executable file → Normal file
0
Filament_sensor.FCStd
Executable file → Normal file
0
Filament_sensor.FCStd
Executable file → Normal file
0
Filament_sensorv2.FCStd
Executable file → Normal file
0
Filament_sensorv2.FCStd
Executable file → Normal file
0
Filament_sensorv2.FCStd1
Executable file → Normal file
0
Filament_sensorv2.FCStd1
Executable file → Normal file
Binary file not shown.
BIN
Holder/MGN15H-carriage.stl
Normal file
BIN
Holder/MGN15H-carriage.stl
Normal file
Binary file not shown.
BIN
Holder/block_mgn9H_100um.3mf
Normal file
BIN
Holder/block_mgn9H_100um.3mf
Normal file
Binary file not shown.
BIN
Holder/fil_sens_bot.stl
Normal file
BIN
Holder/fil_sens_bot.stl
Normal file
Binary file not shown.
BIN
Holder/fil_sens_top.stl
Normal file
BIN
Holder/fil_sens_top.stl
Normal file
Binary file not shown.
BIN
Holder/linaire rail_hemera.FCStd
Normal file
BIN
Holder/linaire rail_hemera.FCStd
Normal file
Binary file not shown.
BIN
Holder/linaire rail_hemera.FCStd1
Normal file
BIN
Holder/linaire rail_hemera.FCStd1
Normal file
Binary file not shown.
BIN
Hotas_left.stl
BIN
Hotas_left.stl
Binary file not shown.
683188
MKS_Robin.STEP
683188
MKS_Robin.STEP
File diff suppressed because one or more lines are too long
|
|
@ -1,137 +1,137 @@
|
||||||
|
|
||||||
#undef DEBUG
|
#undef DEBUG
|
||||||
|
|
||||||
#define NUM_BUTTONS 40 // you don't need to change this value
|
#define NUM_BUTTONS 40 // you don't need to change this value
|
||||||
#define NUM_AXES 8 // 6 axes to UNO, and 8 to MEGA. If you are using UNO, don't need to change this value.
|
#define NUM_AXES 8 // 6 axes to UNO, and 8 to MEGA. If you are using UNO, don't need to change this value.
|
||||||
|
|
||||||
typedef struct joyReport_t {
|
typedef struct joyReport_t {
|
||||||
int16_t axis[NUM_AXES];
|
int16_t axis[NUM_AXES];
|
||||||
uint8_t button[(NUM_BUTTONS + 7) / 8]; // 8 buttons per byte
|
uint8_t button[(NUM_BUTTONS + 7) / 8]; // 8 buttons per byte
|
||||||
} joyReport_t;
|
} joyReport_t;
|
||||||
|
|
||||||
joyReport_t joyReport;
|
joyReport_t joyReport;
|
||||||
|
|
||||||
uint8_t btn[12];
|
uint8_t btn[12];
|
||||||
int fulloff = 0;
|
int fulloff = 0;
|
||||||
void setup(void);
|
void setup(void);
|
||||||
void loop(void);
|
void loop(void);
|
||||||
void setButton(joyReport_t *joy, uint8_t button);
|
void setButton(joyReport_t *joy, uint8_t button);
|
||||||
void clearButton(joyReport_t *joy, uint8_t button);
|
void clearButton(joyReport_t *joy, uint8_t button);
|
||||||
void sendJoyReport(joyReport_t *report);
|
void sendJoyReport(joyReport_t *report);
|
||||||
|
|
||||||
|
|
||||||
void setup()
|
void setup()
|
||||||
{
|
{
|
||||||
//set pin to input Button
|
//set pin to input Button
|
||||||
for ( int portId = 02; portId < 13; portId ++ )
|
for ( int portId = 02; portId < 13; portId ++ )
|
||||||
{
|
{
|
||||||
pinMode( portId, INPUT_PULLUP);
|
pinMode( portId, INPUT_PULLUP);
|
||||||
}
|
}
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
delay(200);
|
delay(200);
|
||||||
|
|
||||||
|
|
||||||
for (uint8_t ind = 0; ind < 8; ind++) {
|
for (uint8_t ind = 0; ind < 8; ind++) {
|
||||||
joyReport.axis[ind] = ind * 1000;
|
joyReport.axis[ind] = ind * 1000;
|
||||||
}
|
}
|
||||||
for (uint8_t ind = 0; ind < sizeof(joyReport.button); ind++) {
|
for (uint8_t ind = 0; ind < sizeof(joyReport.button); ind++) {
|
||||||
joyReport.button[ind] = 0;
|
joyReport.button[ind] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send an HID report to the USB interface
|
// Send an HID report to the USB interface
|
||||||
void sendJoyReport(struct joyReport_t *report)
|
void sendJoyReport(struct joyReport_t *report)
|
||||||
{
|
{
|
||||||
#ifndef DEBUG
|
#ifndef DEBUG
|
||||||
Serial.write((uint8_t *)report, sizeof(joyReport_t));
|
Serial.write((uint8_t *)report, sizeof(joyReport_t));
|
||||||
#else
|
#else
|
||||||
// dump human readable output for debugging
|
// dump human readable output for debugging
|
||||||
for (uint8_t ind = 0; ind < NUM_AXES; ind++) {
|
for (uint8_t ind = 0; ind < NUM_AXES; ind++) {
|
||||||
Serial.print("axis[");
|
Serial.print("axis[");
|
||||||
Serial.print(ind);
|
Serial.print(ind);
|
||||||
Serial.print("]= ");
|
Serial.print("]= ");
|
||||||
Serial.print(report->axis[ind]);
|
Serial.print(report->axis[ind]);
|
||||||
Serial.print(" ");
|
Serial.print(" ");
|
||||||
}
|
}
|
||||||
Serial.println();
|
Serial.println();
|
||||||
for (uint8_t ind = 0; ind < NUM_BUTTONS / 8; ind++) {
|
for (uint8_t ind = 0; ind < NUM_BUTTONS / 8; ind++) {
|
||||||
Serial.print("button[");
|
Serial.print("button[");
|
||||||
Serial.print(ind);
|
Serial.print(ind);
|
||||||
Serial.print("]= ");
|
Serial.print("]= ");
|
||||||
Serial.print(report->button[ind], HEX);
|
Serial.print(report->button[ind], HEX);
|
||||||
Serial.print(" ");
|
Serial.print(" ");
|
||||||
}
|
}
|
||||||
Serial.println();
|
Serial.println();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// turn a button on
|
// turn a button on
|
||||||
void setButton(joyReport_t *joy, uint8_t button)
|
void setButton(joyReport_t *joy, uint8_t button)
|
||||||
{
|
{
|
||||||
uint8_t index = button / 8;
|
uint8_t index = button / 8;
|
||||||
uint8_t bit = button - 8 * index;
|
uint8_t bit = button - 8 * index;
|
||||||
|
|
||||||
joy->button[index] |= 1 << bit;
|
joy->button[index] |= 1 << bit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// turn a button off
|
// turn a button off
|
||||||
void clearButton(joyReport_t *joy, uint8_t button)
|
void clearButton(joyReport_t *joy, uint8_t button)
|
||||||
{
|
{
|
||||||
uint8_t index = button / 8;
|
uint8_t index = button / 8;
|
||||||
uint8_t bit = button - 8 * index;
|
uint8_t bit = button - 8 * index;
|
||||||
|
|
||||||
joy->button[index] &= ~(1 << bit);
|
joy->button[index] &= ~(1 << bit);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Read Digital port for Button
|
Read Digital port for Button
|
||||||
Read Analog port for axis
|
Read Analog port for axis
|
||||||
*/
|
*/
|
||||||
void loop()
|
void loop()
|
||||||
{
|
{
|
||||||
|
|
||||||
for (int bt = 1; bt < 13; bt ++)
|
for (int bt = 1; bt < 13; bt ++)
|
||||||
{
|
{
|
||||||
// btn[bt] = digitalRead(bt + 1);
|
// btn[bt] = digitalRead(bt + 1);
|
||||||
btn[bt] = LOW;
|
btn[bt] = LOW;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int on = 01; on < 13; on++)
|
for (int on = 01; on < 13; on++)
|
||||||
{
|
{
|
||||||
if (btn[on] == LOW)
|
if (btn[on] == LOW)
|
||||||
{
|
{
|
||||||
setButton(&joyReport, on + 16);
|
setButton(&joyReport, on + 16);
|
||||||
|
|
||||||
delay(1);
|
delay(1);
|
||||||
}
|
}
|
||||||
for (int on = 01; on < 13; on++)
|
for (int on = 01; on < 13; on++)
|
||||||
{
|
{
|
||||||
if (btn[on] == HIGH)
|
if (btn[on] == HIGH)
|
||||||
{
|
{
|
||||||
clearButton(&joyReport, on + 16);
|
clearButton(&joyReport, on + 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//for (uint8_t axis = 0; axis < 1; axis++) {
|
//for (uint8_t axis = 0; axis < 1; axis++) {
|
||||||
// joyReport.axis[axis] = map(analogRead(axis), 0, 1023, -32768, 32767 );
|
// joyReport.axis[axis] = map(analogRead(axis), 0, 1023, -32768, 32767 );
|
||||||
//}
|
//}
|
||||||
|
|
||||||
joyReport.axis[0] = 0;
|
joyReport.axis[0] = 0;
|
||||||
joyReport.axis[1] = 0;
|
joyReport.axis[1] = 0;
|
||||||
joyReport.axis[2] = map(analogRead(2), 0, 1023, -32768, 32767 );
|
joyReport.axis[2] = map(analogRead(2), 0, 1023, -32768, 32767 );
|
||||||
joyReport.axis[3] = map(analogRead(3), 0, 1023, -32768, 32767 );
|
joyReport.axis[3] = map(analogRead(3), 0, 1023, -32768, 32767 );
|
||||||
joyReport.axis[4] = map(analogRead(4), 0, 1023, -32768, 32767 );
|
joyReport.axis[4] = map(analogRead(4), 0, 1023, -32768, 32767 );
|
||||||
joyReport.axis[5] = 0;
|
joyReport.axis[5] = 0;
|
||||||
joyReport.axis[6] = 0;
|
joyReport.axis[6] = 0;
|
||||||
joyReport.axis[7] = 0;
|
joyReport.axis[7] = 0;
|
||||||
joyReport.axis[8] = 0;
|
joyReport.axis[8] = 0;
|
||||||
|
|
||||||
//Send Data to HID
|
//Send Data to HID
|
||||||
sendJoyReport(&joyReport);
|
sendJoyReport(&joyReport);
|
||||||
|
|
||||||
delay(35);
|
delay(35);
|
||||||
fulloff = 0;
|
fulloff = 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,137 +1,137 @@
|
||||||
|
|
||||||
#undef DEBUG
|
#undef DEBUG
|
||||||
|
|
||||||
#define NUM_BUTTONS 40 // you don't need to change this value
|
#define NUM_BUTTONS 40 // you don't need to change this value
|
||||||
#define NUM_AXES 8 // 6 axes to UNO, and 8 to MEGA. If you are using UNO, don't need to change this value.
|
#define NUM_AXES 8 // 6 axes to UNO, and 8 to MEGA. If you are using UNO, don't need to change this value.
|
||||||
|
|
||||||
typedef struct joyReport_t {
|
typedef struct joyReport_t {
|
||||||
int16_t axis[NUM_AXES];
|
int16_t axis[NUM_AXES];
|
||||||
uint8_t button[(NUM_BUTTONS + 7) / 8]; // 8 buttons per byte
|
uint8_t button[(NUM_BUTTONS + 7) / 8]; // 8 buttons per byte
|
||||||
} joyReport_t;
|
} joyReport_t;
|
||||||
|
|
||||||
joyReport_t joyReport;
|
joyReport_t joyReport;
|
||||||
|
|
||||||
uint8_t btn[12];
|
uint8_t btn[12];
|
||||||
int fulloff = 0;
|
int fulloff = 0;
|
||||||
void setup(void);
|
void setup(void);
|
||||||
void loop(void);
|
void loop(void);
|
||||||
void setButton(joyReport_t *joy, uint8_t button);
|
void setButton(joyReport_t *joy, uint8_t button);
|
||||||
void clearButton(joyReport_t *joy, uint8_t button);
|
void clearButton(joyReport_t *joy, uint8_t button);
|
||||||
void sendJoyReport(joyReport_t *report);
|
void sendJoyReport(joyReport_t *report);
|
||||||
|
|
||||||
|
|
||||||
void setup()
|
void setup()
|
||||||
{
|
{
|
||||||
//set pin to input Button
|
//set pin to input Button
|
||||||
for ( int portId = 02; portId < 13; portId ++ )
|
for ( int portId = 02; portId < 13; portId ++ )
|
||||||
{
|
{
|
||||||
pinMode( portId, INPUT_PULLUP);
|
pinMode( portId, INPUT_PULLUP);
|
||||||
}
|
}
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
delay(200);
|
delay(200);
|
||||||
|
|
||||||
|
|
||||||
for (uint8_t ind = 0; ind < 8; ind++) {
|
for (uint8_t ind = 0; ind < 8; ind++) {
|
||||||
joyReport.axis[ind] = ind * 1000;
|
joyReport.axis[ind] = ind * 1000;
|
||||||
}
|
}
|
||||||
for (uint8_t ind = 0; ind < sizeof(joyReport.button); ind++) {
|
for (uint8_t ind = 0; ind < sizeof(joyReport.button); ind++) {
|
||||||
joyReport.button[ind] = 0;
|
joyReport.button[ind] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send an HID report to the USB interface
|
// Send an HID report to the USB interface
|
||||||
void sendJoyReport(struct joyReport_t *report)
|
void sendJoyReport(struct joyReport_t *report)
|
||||||
{
|
{
|
||||||
#ifndef DEBUG
|
#ifndef DEBUG
|
||||||
Serial.write((uint8_t *)report, sizeof(joyReport_t));
|
Serial.write((uint8_t *)report, sizeof(joyReport_t));
|
||||||
#else
|
#else
|
||||||
// dump human readable output for debugging
|
// dump human readable output for debugging
|
||||||
for (uint8_t ind = 0; ind < NUM_AXES; ind++) {
|
for (uint8_t ind = 0; ind < NUM_AXES; ind++) {
|
||||||
Serial.print("axis[");
|
Serial.print("axis[");
|
||||||
Serial.print(ind);
|
Serial.print(ind);
|
||||||
Serial.print("]= ");
|
Serial.print("]= ");
|
||||||
Serial.print(report->axis[ind]);
|
Serial.print(report->axis[ind]);
|
||||||
Serial.print(" ");
|
Serial.print(" ");
|
||||||
}
|
}
|
||||||
Serial.println();
|
Serial.println();
|
||||||
for (uint8_t ind = 0; ind < NUM_BUTTONS / 8; ind++) {
|
for (uint8_t ind = 0; ind < NUM_BUTTONS / 8; ind++) {
|
||||||
Serial.print("button[");
|
Serial.print("button[");
|
||||||
Serial.print(ind);
|
Serial.print(ind);
|
||||||
Serial.print("]= ");
|
Serial.print("]= ");
|
||||||
Serial.print(report->button[ind], HEX);
|
Serial.print(report->button[ind], HEX);
|
||||||
Serial.print(" ");
|
Serial.print(" ");
|
||||||
}
|
}
|
||||||
Serial.println();
|
Serial.println();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// turn a button on
|
// turn a button on
|
||||||
void setButton(joyReport_t *joy, uint8_t button)
|
void setButton(joyReport_t *joy, uint8_t button)
|
||||||
{
|
{
|
||||||
uint8_t index = button / 8;
|
uint8_t index = button / 8;
|
||||||
uint8_t bit = button - 8 * index;
|
uint8_t bit = button - 8 * index;
|
||||||
|
|
||||||
joy->button[index] |= 1 << bit;
|
joy->button[index] |= 1 << bit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// turn a button off
|
// turn a button off
|
||||||
void clearButton(joyReport_t *joy, uint8_t button)
|
void clearButton(joyReport_t *joy, uint8_t button)
|
||||||
{
|
{
|
||||||
uint8_t index = button / 8;
|
uint8_t index = button / 8;
|
||||||
uint8_t bit = button - 8 * index;
|
uint8_t bit = button - 8 * index;
|
||||||
|
|
||||||
joy->button[index] &= ~(1 << bit);
|
joy->button[index] &= ~(1 << bit);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Read Digital port for Button
|
Read Digital port for Button
|
||||||
Read Analog port for axis
|
Read Analog port for axis
|
||||||
*/
|
*/
|
||||||
void loop()
|
void loop()
|
||||||
{
|
{
|
||||||
|
|
||||||
for (int bt = 1; bt < 13; bt ++)
|
for (int bt = 1; bt < 13; bt ++)
|
||||||
{
|
{
|
||||||
// btn[bt] = digitalRead(bt + 1);
|
// btn[bt] = digitalRead(bt + 1);
|
||||||
btn[bt] = LOW;
|
btn[bt] = LOW;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int on = 01; on < 13; on++)
|
for (int on = 01; on < 13; on++)
|
||||||
{
|
{
|
||||||
if (btn[on] == LOW)
|
if (btn[on] == LOW)
|
||||||
{
|
{
|
||||||
setButton(&joyReport, on + 16);
|
setButton(&joyReport, on + 16);
|
||||||
|
|
||||||
delay(1);
|
delay(1);
|
||||||
}
|
}
|
||||||
for (int on = 01; on < 13; on++)
|
for (int on = 01; on < 13; on++)
|
||||||
{
|
{
|
||||||
if (btn[on] == HIGH)
|
if (btn[on] == HIGH)
|
||||||
{
|
{
|
||||||
clearButton(&joyReport, on + 16);
|
clearButton(&joyReport, on + 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//for (uint8_t axis = 0; axis < 1; axis++) {
|
//for (uint8_t axis = 0; axis < 1; axis++) {
|
||||||
// joyReport.axis[axis] = map(analogRead(axis), 0, 1023, -32768, 32767 );
|
// joyReport.axis[axis] = map(analogRead(axis), 0, 1023, -32768, 32767 );
|
||||||
//}
|
//}
|
||||||
|
|
||||||
joyReport.axis[0] = 0;
|
joyReport.axis[0] = 0;
|
||||||
joyReport.axis[1] = 0;
|
joyReport.axis[1] = 0;
|
||||||
joyReport.axis[2] = map(analogRead(2), 0, 1023, -32768, 32767 );
|
joyReport.axis[2] = map(analogRead(2), 0, 1023, -32768, 32767 );
|
||||||
joyReport.axis[3] = map(analogRead(3), 0, 1023, -32768, 32767 );
|
joyReport.axis[3] = map(analogRead(3), 0, 1023, -32768, 32767 );
|
||||||
joyReport.axis[4] = map(analogRead(4), 0, 1023, -32768, 32767 );
|
joyReport.axis[4] = map(analogRead(4), 0, 1023, -32768, 32767 );
|
||||||
joyReport.axis[5] = 0;
|
joyReport.axis[5] = 0;
|
||||||
joyReport.axis[6] = 0;
|
joyReport.axis[6] = 0;
|
||||||
joyReport.axis[7] = 0;
|
joyReport.axis[7] = 0;
|
||||||
joyReport.axis[8] = 0;
|
joyReport.axis[8] = 0;
|
||||||
|
|
||||||
//Send Data to HID
|
//Send Data to HID
|
||||||
sendJoyReport(&joyReport);
|
sendJoyReport(&joyReport);
|
||||||
|
|
||||||
delay(35);
|
delay(35);
|
||||||
fulloff = 0;
|
fulloff = 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
0
Pedals/esptool/esptool
Executable file → Normal file
0
Pedals/esptool/esptool
Executable file → Normal file
|
|
@ -1,137 +1,137 @@
|
||||||
|
|
||||||
#undef DEBUG
|
#undef DEBUG
|
||||||
|
|
||||||
#define NUM_BUTTONS 40 // you don't need to change this value
|
#define NUM_BUTTONS 40 // you don't need to change this value
|
||||||
#define NUM_AXES 8 // 6 axes to UNO, and 8 to MEGA. If you are using UNO, don't need to change this value.
|
#define NUM_AXES 8 // 6 axes to UNO, and 8 to MEGA. If you are using UNO, don't need to change this value.
|
||||||
|
|
||||||
typedef struct joyReport_t {
|
typedef struct joyReport_t {
|
||||||
int16_t axis[NUM_AXES];
|
int16_t axis[NUM_AXES];
|
||||||
uint8_t button[(NUM_BUTTONS + 7) / 8]; // 8 buttons per byte
|
uint8_t button[(NUM_BUTTONS + 7) / 8]; // 8 buttons per byte
|
||||||
} joyReport_t;
|
} joyReport_t;
|
||||||
|
|
||||||
joyReport_t joyReport;
|
joyReport_t joyReport;
|
||||||
|
|
||||||
uint8_t btn[12];
|
uint8_t btn[12];
|
||||||
int fulloff = 0;
|
int fulloff = 0;
|
||||||
void setup(void);
|
void setup(void);
|
||||||
void loop(void);
|
void loop(void);
|
||||||
void setButton(joyReport_t *joy, uint8_t button);
|
void setButton(joyReport_t *joy, uint8_t button);
|
||||||
void clearButton(joyReport_t *joy, uint8_t button);
|
void clearButton(joyReport_t *joy, uint8_t button);
|
||||||
void sendJoyReport(joyReport_t *report);
|
void sendJoyReport(joyReport_t *report);
|
||||||
|
|
||||||
|
|
||||||
void setup()
|
void setup()
|
||||||
{
|
{
|
||||||
//set pin to input Button
|
//set pin to input Button
|
||||||
for ( int portId = 02; portId < 13; portId ++ )
|
for ( int portId = 02; portId < 13; portId ++ )
|
||||||
{
|
{
|
||||||
pinMode( portId, INPUT_PULLUP);
|
pinMode( portId, INPUT_PULLUP);
|
||||||
}
|
}
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
delay(200);
|
delay(200);
|
||||||
|
|
||||||
|
|
||||||
for (uint8_t ind = 0; ind < 8; ind++) {
|
for (uint8_t ind = 0; ind < 8; ind++) {
|
||||||
joyReport.axis[ind] = ind * 1000;
|
joyReport.axis[ind] = ind * 1000;
|
||||||
}
|
}
|
||||||
for (uint8_t ind = 0; ind < sizeof(joyReport.button); ind++) {
|
for (uint8_t ind = 0; ind < sizeof(joyReport.button); ind++) {
|
||||||
joyReport.button[ind] = 0;
|
joyReport.button[ind] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send an HID report to the USB interface
|
// Send an HID report to the USB interface
|
||||||
void sendJoyReport(struct joyReport_t *report)
|
void sendJoyReport(struct joyReport_t *report)
|
||||||
{
|
{
|
||||||
#ifndef DEBUG
|
#ifndef DEBUG
|
||||||
Serial.write((uint8_t *)report, sizeof(joyReport_t));
|
Serial.write((uint8_t *)report, sizeof(joyReport_t));
|
||||||
#else
|
#else
|
||||||
// dump human readable output for debugging
|
// dump human readable output for debugging
|
||||||
for (uint8_t ind = 0; ind < NUM_AXES; ind++) {
|
for (uint8_t ind = 0; ind < NUM_AXES; ind++) {
|
||||||
Serial.print("axis[");
|
Serial.print("axis[");
|
||||||
Serial.print(ind);
|
Serial.print(ind);
|
||||||
Serial.print("]= ");
|
Serial.print("]= ");
|
||||||
Serial.print(report->axis[ind]);
|
Serial.print(report->axis[ind]);
|
||||||
Serial.print(" ");
|
Serial.print(" ");
|
||||||
}
|
}
|
||||||
Serial.println();
|
Serial.println();
|
||||||
for (uint8_t ind = 0; ind < NUM_BUTTONS / 8; ind++) {
|
for (uint8_t ind = 0; ind < NUM_BUTTONS / 8; ind++) {
|
||||||
Serial.print("button[");
|
Serial.print("button[");
|
||||||
Serial.print(ind);
|
Serial.print(ind);
|
||||||
Serial.print("]= ");
|
Serial.print("]= ");
|
||||||
Serial.print(report->button[ind], HEX);
|
Serial.print(report->button[ind], HEX);
|
||||||
Serial.print(" ");
|
Serial.print(" ");
|
||||||
}
|
}
|
||||||
Serial.println();
|
Serial.println();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// turn a button on
|
// turn a button on
|
||||||
void setButton(joyReport_t *joy, uint8_t button)
|
void setButton(joyReport_t *joy, uint8_t button)
|
||||||
{
|
{
|
||||||
uint8_t index = button / 8;
|
uint8_t index = button / 8;
|
||||||
uint8_t bit = button - 8 * index;
|
uint8_t bit = button - 8 * index;
|
||||||
|
|
||||||
joy->button[index] |= 1 << bit;
|
joy->button[index] |= 1 << bit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// turn a button off
|
// turn a button off
|
||||||
void clearButton(joyReport_t *joy, uint8_t button)
|
void clearButton(joyReport_t *joy, uint8_t button)
|
||||||
{
|
{
|
||||||
uint8_t index = button / 8;
|
uint8_t index = button / 8;
|
||||||
uint8_t bit = button - 8 * index;
|
uint8_t bit = button - 8 * index;
|
||||||
|
|
||||||
joy->button[index] &= ~(1 << bit);
|
joy->button[index] &= ~(1 << bit);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Read Digital port for Button
|
Read Digital port for Button
|
||||||
Read Analog port for axis
|
Read Analog port for axis
|
||||||
*/
|
*/
|
||||||
void loop()
|
void loop()
|
||||||
{
|
{
|
||||||
|
|
||||||
for (int bt = 1; bt < 13; bt ++)
|
for (int bt = 1; bt < 13; bt ++)
|
||||||
{
|
{
|
||||||
// btn[bt] = digitalRead(bt + 1);
|
// btn[bt] = digitalRead(bt + 1);
|
||||||
btn[bt] = LOW;
|
btn[bt] = LOW;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int on = 01; on < 13; on++)
|
for (int on = 01; on < 13; on++)
|
||||||
{
|
{
|
||||||
if (btn[on] == LOW)
|
if (btn[on] == LOW)
|
||||||
{
|
{
|
||||||
setButton(&joyReport, on + 16);
|
setButton(&joyReport, on + 16);
|
||||||
|
|
||||||
delay(1);
|
delay(1);
|
||||||
}
|
}
|
||||||
for (int on = 01; on < 13; on++)
|
for (int on = 01; on < 13; on++)
|
||||||
{
|
{
|
||||||
if (btn[on] == HIGH)
|
if (btn[on] == HIGH)
|
||||||
{
|
{
|
||||||
clearButton(&joyReport, on + 16);
|
clearButton(&joyReport, on + 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//for (uint8_t axis = 0; axis < 1; axis++) {
|
//for (uint8_t axis = 0; axis < 1; axis++) {
|
||||||
// joyReport.axis[axis] = map(analogRead(axis), 0, 1023, -32768, 32767 );
|
// joyReport.axis[axis] = map(analogRead(axis), 0, 1023, -32768, 32767 );
|
||||||
//}
|
//}
|
||||||
|
|
||||||
joyReport.axis[0] = 0;
|
joyReport.axis[0] = 0;
|
||||||
joyReport.axis[1] = 0;
|
joyReport.axis[1] = 0;
|
||||||
joyReport.axis[2] = map(analogRead(2), 0, 1023, -32768, 32767 );
|
joyReport.axis[2] = map(analogRead(2), 0, 1023, -32768, 32767 );
|
||||||
joyReport.axis[3] = map(analogRead(3), 0, 1023, -32768, 32767 );
|
joyReport.axis[3] = map(analogRead(3), 0, 1023, -32768, 32767 );
|
||||||
joyReport.axis[4] = map(analogRead(4), 0, 1023, -32768, 32767 );
|
joyReport.axis[4] = map(analogRead(4), 0, 1023, -32768, 32767 );
|
||||||
joyReport.axis[5] = 0;
|
joyReport.axis[5] = 0;
|
||||||
joyReport.axis[6] = 0;
|
joyReport.axis[6] = 0;
|
||||||
joyReport.axis[7] = 0;
|
joyReport.axis[7] = 0;
|
||||||
joyReport.axis[8] = 0;
|
joyReport.axis[8] = 0;
|
||||||
|
|
||||||
//Send Data to HID
|
//Send Data to HID
|
||||||
sendJoyReport(&joyReport);
|
sendJoyReport(&joyReport);
|
||||||
|
|
||||||
delay(35);
|
delay(35);
|
||||||
fulloff = 0;
|
fulloff = 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,137 +1,137 @@
|
||||||
|
|
||||||
#undef DEBUG
|
#undef DEBUG
|
||||||
|
|
||||||
#define NUM_BUTTONS 40 // you don't need to change this value
|
#define NUM_BUTTONS 40 // you don't need to change this value
|
||||||
#define NUM_AXES 8 // 6 axes to UNO, and 8 to MEGA. If you are using UNO, don't need to change this value.
|
#define NUM_AXES 8 // 6 axes to UNO, and 8 to MEGA. If you are using UNO, don't need to change this value.
|
||||||
|
|
||||||
typedef struct joyReport_t {
|
typedef struct joyReport_t {
|
||||||
int16_t axis[NUM_AXES];
|
int16_t axis[NUM_AXES];
|
||||||
uint8_t button[(NUM_BUTTONS + 7) / 8]; // 8 buttons per byte
|
uint8_t button[(NUM_BUTTONS + 7) / 8]; // 8 buttons per byte
|
||||||
} joyReport_t;
|
} joyReport_t;
|
||||||
|
|
||||||
joyReport_t joyReport;
|
joyReport_t joyReport;
|
||||||
|
|
||||||
uint8_t btn[12];
|
uint8_t btn[12];
|
||||||
int fulloff = 0;
|
int fulloff = 0;
|
||||||
void setup(void);
|
void setup(void);
|
||||||
void loop(void);
|
void loop(void);
|
||||||
void setButton(joyReport_t *joy, uint8_t button);
|
void setButton(joyReport_t *joy, uint8_t button);
|
||||||
void clearButton(joyReport_t *joy, uint8_t button);
|
void clearButton(joyReport_t *joy, uint8_t button);
|
||||||
void sendJoyReport(joyReport_t *report);
|
void sendJoyReport(joyReport_t *report);
|
||||||
|
|
||||||
|
|
||||||
void setup()
|
void setup()
|
||||||
{
|
{
|
||||||
//set pin to input Button
|
//set pin to input Button
|
||||||
for ( int portId = 02; portId < 13; portId ++ )
|
for ( int portId = 02; portId < 13; portId ++ )
|
||||||
{
|
{
|
||||||
pinMode( portId, INPUT_PULLUP);
|
pinMode( portId, INPUT_PULLUP);
|
||||||
}
|
}
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
delay(200);
|
delay(200);
|
||||||
|
|
||||||
|
|
||||||
for (uint8_t ind = 0; ind < 8; ind++) {
|
for (uint8_t ind = 0; ind < 8; ind++) {
|
||||||
joyReport.axis[ind] = ind * 1000;
|
joyReport.axis[ind] = ind * 1000;
|
||||||
}
|
}
|
||||||
for (uint8_t ind = 0; ind < sizeof(joyReport.button); ind++) {
|
for (uint8_t ind = 0; ind < sizeof(joyReport.button); ind++) {
|
||||||
joyReport.button[ind] = 0;
|
joyReport.button[ind] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send an HID report to the USB interface
|
// Send an HID report to the USB interface
|
||||||
void sendJoyReport(struct joyReport_t *report)
|
void sendJoyReport(struct joyReport_t *report)
|
||||||
{
|
{
|
||||||
#ifndef DEBUG
|
#ifndef DEBUG
|
||||||
Serial.write((uint8_t *)report, sizeof(joyReport_t));
|
Serial.write((uint8_t *)report, sizeof(joyReport_t));
|
||||||
#else
|
#else
|
||||||
// dump human readable output for debugging
|
// dump human readable output for debugging
|
||||||
for (uint8_t ind = 0; ind < NUM_AXES; ind++) {
|
for (uint8_t ind = 0; ind < NUM_AXES; ind++) {
|
||||||
Serial.print("axis[");
|
Serial.print("axis[");
|
||||||
Serial.print(ind);
|
Serial.print(ind);
|
||||||
Serial.print("]= ");
|
Serial.print("]= ");
|
||||||
Serial.print(report->axis[ind]);
|
Serial.print(report->axis[ind]);
|
||||||
Serial.print(" ");
|
Serial.print(" ");
|
||||||
}
|
}
|
||||||
Serial.println();
|
Serial.println();
|
||||||
for (uint8_t ind = 0; ind < NUM_BUTTONS / 8; ind++) {
|
for (uint8_t ind = 0; ind < NUM_BUTTONS / 8; ind++) {
|
||||||
Serial.print("button[");
|
Serial.print("button[");
|
||||||
Serial.print(ind);
|
Serial.print(ind);
|
||||||
Serial.print("]= ");
|
Serial.print("]= ");
|
||||||
Serial.print(report->button[ind], HEX);
|
Serial.print(report->button[ind], HEX);
|
||||||
Serial.print(" ");
|
Serial.print(" ");
|
||||||
}
|
}
|
||||||
Serial.println();
|
Serial.println();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// turn a button on
|
// turn a button on
|
||||||
void setButton(joyReport_t *joy, uint8_t button)
|
void setButton(joyReport_t *joy, uint8_t button)
|
||||||
{
|
{
|
||||||
uint8_t index = button / 8;
|
uint8_t index = button / 8;
|
||||||
uint8_t bit = button - 8 * index;
|
uint8_t bit = button - 8 * index;
|
||||||
|
|
||||||
joy->button[index] |= 1 << bit;
|
joy->button[index] |= 1 << bit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// turn a button off
|
// turn a button off
|
||||||
void clearButton(joyReport_t *joy, uint8_t button)
|
void clearButton(joyReport_t *joy, uint8_t button)
|
||||||
{
|
{
|
||||||
uint8_t index = button / 8;
|
uint8_t index = button / 8;
|
||||||
uint8_t bit = button - 8 * index;
|
uint8_t bit = button - 8 * index;
|
||||||
|
|
||||||
joy->button[index] &= ~(1 << bit);
|
joy->button[index] &= ~(1 << bit);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Read Digital port for Button
|
Read Digital port for Button
|
||||||
Read Analog port for axis
|
Read Analog port for axis
|
||||||
*/
|
*/
|
||||||
void loop()
|
void loop()
|
||||||
{
|
{
|
||||||
|
|
||||||
for (int bt = 1; bt < 13; bt ++)
|
for (int bt = 1; bt < 13; bt ++)
|
||||||
{
|
{
|
||||||
// btn[bt] = digitalRead(bt + 1);
|
// btn[bt] = digitalRead(bt + 1);
|
||||||
btn[bt] = LOW;
|
btn[bt] = LOW;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int on = 01; on < 13; on++)
|
for (int on = 01; on < 13; on++)
|
||||||
{
|
{
|
||||||
if (btn[on] == LOW)
|
if (btn[on] == LOW)
|
||||||
{
|
{
|
||||||
setButton(&joyReport, on + 16);
|
setButton(&joyReport, on + 16);
|
||||||
|
|
||||||
delay(1);
|
delay(1);
|
||||||
}
|
}
|
||||||
for (int on = 01; on < 13; on++)
|
for (int on = 01; on < 13; on++)
|
||||||
{
|
{
|
||||||
if (btn[on] == HIGH)
|
if (btn[on] == HIGH)
|
||||||
{
|
{
|
||||||
clearButton(&joyReport, on + 16);
|
clearButton(&joyReport, on + 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//for (uint8_t axis = 0; axis < 1; axis++) {
|
//for (uint8_t axis = 0; axis < 1; axis++) {
|
||||||
// joyReport.axis[axis] = map(analogRead(axis), 0, 1023, -32768, 32767 );
|
// joyReport.axis[axis] = map(analogRead(axis), 0, 1023, -32768, 32767 );
|
||||||
//}
|
//}
|
||||||
|
|
||||||
joyReport.axis[0] = 0;
|
joyReport.axis[0] = 0;
|
||||||
joyReport.axis[1] = 0;
|
joyReport.axis[1] = 0;
|
||||||
joyReport.axis[2] = map(analogRead(2), 0, 1023, -32768, 32767 );
|
joyReport.axis[2] = map(analogRead(2), 0, 1023, -32768, 32767 );
|
||||||
joyReport.axis[3] = map(analogRead(3), 0, 1023, -32768, 32767 );
|
joyReport.axis[3] = map(analogRead(3), 0, 1023, -32768, 32767 );
|
||||||
joyReport.axis[4] = map(analogRead(4), 0, 1023, -32768, 32767 );
|
joyReport.axis[4] = map(analogRead(4), 0, 1023, -32768, 32767 );
|
||||||
joyReport.axis[5] = 0;
|
joyReport.axis[5] = 0;
|
||||||
joyReport.axis[6] = 0;
|
joyReport.axis[6] = 0;
|
||||||
joyReport.axis[7] = 0;
|
joyReport.axis[7] = 0;
|
||||||
joyReport.axis[8] = 0;
|
joyReport.axis[8] = 0;
|
||||||
|
|
||||||
//Send Data to HID
|
//Send Data to HID
|
||||||
sendJoyReport(&joyReport);
|
sendJoyReport(&joyReport);
|
||||||
|
|
||||||
delay(35);
|
delay(35);
|
||||||
fulloff = 0;
|
fulloff = 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
BIN
Power convertor block.FCStd
Normal file
BIN
Power convertor block.FCStd
Normal file
Binary file not shown.
BIN
Power convertor block.FCStd1
Normal file
BIN
Power convertor block.FCStd1
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
345404
Wantai_Stepper_Motor_-_Nema_17_-_42BYGHM809.step
Executable file → Normal file
345404
Wantai_Stepper_Motor_-_Nema_17_-_42BYGHM809.step
Executable file → Normal file
File diff suppressed because one or more lines are too long
427954
fanmount/Mk8_HeatSink.STL
427954
fanmount/Mk8_HeatSink.STL
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
Binary file not shown.
BIN
joystick.FCStd1
Normal file
BIN
joystick.FCStd1
Normal file
Binary file not shown.
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
0
motion_sim/Flyer/Winwingholder.20230907-120958.FCBak
Executable file → Normal file
0
motion_sim/Flyer/Winwingholder.20230907-120958.FCBak
Executable file → Normal file
0
motion_sim/Flyer/Winwingholder_stick.FCStd
Executable file → Normal file
0
motion_sim/Flyer/Winwingholder_stick.FCStd
Executable file → Normal file
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue