Navigation

    M5Stack Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. JimW
    J
    • Continue chat with JimW
    • Start new chat with JimW
    • Flag Profile
    • Profile
    • Following
    • Followers
    • Blocks
    • Topics
    • Posts
    • Best
    • Groups
    Save
    Saving

    JimW

    @JimW

    0
    Reputation
    5
    Posts
    1121
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    JimW Follow

    Posts made by JimW

    • RE: [Solved]Driving a single servo

      I'm using an M5stack Core with the accelerometer built in, and arduino 1.8.9

      This problem occurs when using M5.begin(); which I apparently need to print to lcd inside the loop.

      So for instance, inside the loop,

      M5.Lcd.setCursor(0, 200);
      M5.lcd.setTextColor(WHITE,BLACK);
      M5.Lcd.print (i);

      The Servo will not work, but instead chatter.
      // M5.begin(); servo works but the display does not (this statement is inside the setup, for example,

      void setup() {

      M5.begin();

      //myservo.attach(servoPin);

      }

      posted in Arduino
      J
      JimW
    • RE: [Solved]Driving a single servo

      I was hoping that it would be that simple, however, that wasn't the solution.

      I cannot use M5.Lcd.print and the servo at the same time.

      posted in Arduino
      J
      JimW
    • [Solved]Driving a single servo

      using the M5 with firmware 1.2.3en and arduino 1.8.9

      I know you can't use servo.h, so I came up with a work around, or at least I thought I did.

      I cannot have M5.begin(); in the code or the servo doesn't work, without that the servo works but I cannot write to display.
      Is there a solution? here's the example code;

      #include <M5Stack.h>

      #define servoPin 5
      int i = 0;
      int servoPulse(int angle) {
      int pulseWidth = map(angle, 0, 180, 544, 2400);
      return pulseWidth;
      }

      void setup() {

      m5.begin();
      Serial.begin(9600);
      pinMode(servoPin, OUTPUT);
      

      }

      void loop() {

      for (int i=0; i<=180; i++) { // drive servo from 0 to 180 at max response
      int pulseWidth = servoPulse(i);
      //digitalWrite(servoPin, HIGH);
      delayMicroseconds(pulseWidth);
      //digitalWrite(servoPin, LOW);
      delayMicroseconds(20000 - pulseWidth);
      Serial.print(i);
      }

      for (int i=180; i>=0; i--) { // return to 0 at half speed
      int pulseWidth = servoPulse(i);
      //digitalWrite(servoPin, HIGH);
      delayMicroseconds(pulseWidth);
      //digitalWrite(servoPin, LOW);
      // delayMicroseconds(20000 - pulseWidth);
      delay(50);
      Serial.print(i);
      }

      }

      posted in Arduino
      J
      JimW
    • RE: m5 burner and firmware

      nevermind. I found it

      posted in General
      J
      JimW
    • m5 burner and firmware

      I'm extremely new to this..

      download the m5burner and it tells me I have to download the firmware.

      Uhm, sure. Where exactly would I find that?

      posted in General
      J
      JimW