Skip to content

Commit

Permalink
Fixed a few small pin issues in custom code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan de Bruijn committed Nov 1, 2020
1 parent 25d2426 commit 5a1daa3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ Grbl_Esp32.vcxproj.filters
*.suo
Grbl_Esp32.ino.cpp
packages/
pio_machine.h
1 change: 1 addition & 0 deletions Grbl_Esp32/Custom/atari_1020.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ uint8_t current_tool;
void machine_init() {
solenoid_pull_count = 0; // initialize
grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "Atari 1020 Solenoid");

// setup PWM channel
solenoid_pwm_chan_num = sys_get_next_PWM_chan_num();
ledcSetup(solenoid_pwm_chan_num, SOLENOID_PWM_FREQ, SOLENOID_PWM_RES_BITS);
Expand Down
6 changes: 4 additions & 2 deletions Grbl_Esp32/Custom/mpcnc_laser_module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ machine_init() is called when Grbl_ESP32 first starts. You can use it to do any
special things your machine needs at startup.
*/
void machine_init() {
Pin levelShift = Pin::create(LVL_SHIFT_ENABLE);

// force this on all the time
grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "Custom machine_init() Level Shift Enabled");
pinMode(LVL_SHIFT_ENABLE, OUTPUT);
digitalWrite(LVL_SHIFT_ENABLE, HIGH);
levelShift.setAttr(Pin::Attr::Output);
levelShift.on();
}
#endif
6 changes: 3 additions & 3 deletions Grbl_Esp32/src/Machines/atari_1020.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@
#define Y_PIN_PHASE_2 "gpio.26"
#define Y_PIN_PHASE_3 "gpio.32"

#define SOLENOID_DIRECTION_PIN "gpio.4"
#define SOLENOID_PEN_PIN "gpio.2"
#define SOLENOID_DIRECTION_PIN GPIO_NUM_4
#define SOLENOID_PEN_PIN GPIO_NUM_2

// this 'bot only homes the X axis
// Set $Homing/Cycle0=0

#define REED_SW_PIN "gpio.17"
#define REED_SW_PIN GPIO_NUM_17

#ifndef ENABLE_CONTROL_SW_DEBOUNCE
#define ENABLE_CONTROL_SW_DEBOUNCE
Expand Down

0 comments on commit 5a1daa3

Please sign in to comment.