Navigation

    M5Stack Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. fameuhly
    3. Topics
    F
    • Continue chat with fameuhly
    • Start new chat with fameuhly
    • Flag Profile
    • Profile
    • Following
    • Followers
    • Blocks
    • Topics
    • Posts
    • Best
    • Groups

    Topics created by fameuhly

    • F

      PIN number and shields
      PROJECTS • • fameuhly

      12
      0
      Votes
      12
      Posts
      25448
      Views

      @farmeuhly said in PIN number and shields: Hello, happy new year ! I'm back on my tests... I have a lot of problems. 1 : problem for uploading sketch on the board, i should remove the "bottom" of the m5stack and bush the boot button for it to work ! And sometimes it fails anyway... 2 : I tried to stop the pins on the "bottom" with the sketch "blink" and those that work are : 0, 2, 3, 5, 12, 13, 15, 16, 17, 19, 21, 22, 26 The others (1, 18, 23, 25, 34, 35, 36) doesn't work. 3 : I don't understand why the same simple sketch work fine on arduino uno board and don't work on the m5stack. I put the #include <M5Stack.h>, m5.begin(), m5.update... But i have the impression that the selected pins don't work. What i'm doing wrong ? Because the esp32 and the mega328p do not have the same pins. The AtMegas have defined pins but the esp32 uses a matrix of functions that can be assigned to each i/o pin. Check out the esp32 data sheet for these functions.
    • F

      pneumatic seeder
      PROJECTS • • fameuhly

      4
      0
      Votes
      4
      Posts
      6928
      Views

      F

      Hello again, i've made a sketch on arduino ide to control a nema 17 stepper motor with the shield L298N here is the sketch : /* Controle de moteur pas à pas avec un L298N Le moteur est connecté sur les broches 2,3,4 et 5 de l'Arduino Le fil de masse (GND) est commun aux 2 platines. */ #include <Stepper.h> const int NbPasParTour = 200; // Nombre de pas pour 360 degres Stepper Moteur1(NbPasParTour, 2, 3, 4, 5); // Initialise le moteur sur les broches 2 à 5 void setup() { Moteur1.setSpeed(60); //Vitesse de rotation du moteur Serial.begin(9600); //Initialise le moniteur série } void loop() { Serial.println("Sens horaire"); //On fait 1 tour en sens horaire Moteur1.step(NbPasParTour); delay(1000); //Pause 1 seconde Serial.println("Sens anti-horaire"); //On fait 1 tour en sens anti-horaire Moteur1.step(-NbPasParTour); delay(1000); //Pause 1 seconde } It's work fine ! But when i try on the m5, on the PIN 3, 1, 16, 17 with this sketch, the motor only vibrate : /* Controle de moteur pas à pas avec un L298N Le moteur est connecté sur les broches 3, 1, 16, 17 du m5 Le fil de masse (GND) est commun aux 2 platines. */ #include <M5Stack.h> #include <Stepper.h> const int NbPasParTour = 200; // Nombre de pas pour 360 degres Stepper Moteur1(NbPasParTour, 3, 1, 16, 17); // Initialise le moteur sur les broches void setup() { Moteur1.setSpeed(100); //Vitesse de rotation du moteur m5.begin(); M5.Lcd.setBrightness(200); M5.Lcd.setTextColor(0xffff); M5.Lcd.setTextSize(3); M5.Lcd.setCursor(50, 20); M5.Lcd.print("M5 Seeder"); } void loop() { M5.Lcd.setTextColor(0x7bef); M5.Lcd.setTextSize(2); M5.Lcd.setCursor(55, 60); M5.Lcd.print("Sens horaire"); Moteur1.step(NbPasParTour*2); delay(1000); //Pause 1 seconde M5.Lcd.setTextColor(0x7bef); M5.Lcd.setTextSize(2); M5.Lcd.setCursor(55, 60); M5.Lcd.print("Sens anti-horaire"); Moteur1.step(-NbPasParTour); delay(1000); //Pause 1 seconde m5.update(); } Any idea ? thank you