Added constant for RGB LEd Pins

This commit is contained in:
AlexanderHD27
2024-10-12 18:54:14 +02:00
parent a755a954f6
commit 46f3514c6a
2 changed files with 17 additions and 4 deletions

BIN
motor-control/firmware/README.md (Stored with Git LFS)

Binary file not shown.

View File

@@ -18,11 +18,23 @@
#define LED_PIN 25 #define LED_PIN 25
#define RGB1_R_PIN 21
#define RGB1_G_PIN 22
#define RGB2_R_PIN 26
#define RGB2_G_PIN 27
#define RGB2_B_PIN 28
#define BOARD_LED1_PIN 14
#define BOARD_LED2_PIN 15
#define ENABLE0_PIN 2 #define ENABLE0_PIN 2
#define ENABLE1_PIN 3 #define ENABLE1_PIN 3
#define LIMIT0_PIN 10 #define LIMIT0_PIN 10
#define LIMIT1_PIN 11 #define LIMIT1_PIN 11
#define LIMIT2_PIN 12
#define LIMIT3_PIN 13
#define STEP0_PIN 6 #define STEP0_PIN 6
#define STEP1_PIN 7 #define STEP1_PIN 7
@@ -61,10 +73,8 @@ int main() {
sleep_ms(5); sleep_ms(5);
step_driver.set_conf1(10000, 0); step_driver.set_conf1(10000, 0);
gpio_init(LIMIT0_PIN); gpio_init(LIMIT0_PIN);
gpio_set_dir(LIMIT0_PIN, GPIO_IN); gpio_set_dir(LIMIT0_PIN, GPIO_IN);
gpio_pull_up(LIMIT0_PIN); gpio_pull_up(LIMIT0_PIN);
@@ -100,6 +110,9 @@ int main() {
gpio_init(LED_PIN); gpio_init(LED_PIN);
gpio_set_dir(LED_PIN, GPIO_OUT); gpio_set_dir(LED_PIN, GPIO_OUT);
step_driver.set_conf0(10000, 0);
step_driver.pulse0(1000000);
while (true) { while (true) {
sleep_ms(50); sleep_ms(50);
gpio_put(LED_PIN, 0); gpio_put(LED_PIN, 0);