Navigation

    M5Stack Community

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

    Posts made by amn

    • RE: I would like to send a PPM with M5 stack Fire

      @amn
      HI found this code: (how to adapt with potentiometre for the lenght of pulse , ?)

      //////////////////////CONFIGURATION///////////////////////////////
      #define chanel_number 1 //set the number of chanels
      #define default_servo_value 1500 //set the default servo value
      #define PPM_FrLen 22500 //set the PPM frame length in microseconds (1ms = 1000µs)
      #define PPM_PulseLen 300 //set the pulse length
      #define onState 1 //set polarity: 1 is positive, 0 is negative
      #define sigPin 36 //set 10 PPM signal pin on the arduino

      /this array holds the servo values for the ppm signal
      change theese values in your code (usually servo values are between 1000 and 2000)
      /
      int ppm[chanel_number];

      void setup(){
      // Initialize the M5Stack object
      M5.begin();
      /*
      Power chip connected to gpio21, gpio22, I2C device
      Set battery charging voltage and current
      If used battery, please call this function in your project
      */
      M5.Power.begin();

      M5.Lcd.fillScreen(BLACK);
      M5.Lcd.setTextColor(GREEN , BLACK);
      M5.Lcd.setTextSize(2);

      //initiallize default ppm values
      for(int i=0; i<chanel_number; i++){
      ppm[i]= default_servo_value;
      }

      pinMode(sigPin, OUTPUT);
      digitalWrite(sigPin, !onState); //set the PPM signal pin to the default state (off)
      }

      void loop(){
      //put main code here
      ppmWrite();

      }

      void ppmWrite(){ //generate PPM signal
      static unsigned long lastFrLen;
      static unsigned long lastServo;
      static unsigned long lastPulse;
      static boolean PPM_run;
      static boolean pulse;
      static boolean pulseStart = true;
      static byte counter;
      static byte part = true;

      if(micros() - lastFrLen >= PPM_FrLen){ //start PPM signal after PPM_FrLen has passed
      lastFrLen = micros();
      PPM_run = true;
      }

      if(counter >= chanel_number){
      PPM_run = false;
      counter = 0;
      pulse = true; //put out the last pulse
      }

      if(PPM_run){
      if (part){ //put out the pulse
      pulse = true;
      part = false;
      lastServo = micros();
      }
      else{ //wait till servo signal time (values from the ppm array) has passed
      if(micros() - lastServo >= ppm[counter]){
      counter++; //do the next channel
      part = true;
      }
      }
      }

      if(pulse){
      if(pulseStart == true){ //start the pulse
      digitalWrite(sigPin, onState);
      pulseStart = false;
      lastPulse = micros();
      }
      else{ //will wait till PPM_PulseLen has passed and finish the pulse
      if(micros() - lastPulse >= PPM_PulseLen){
      digitalWrite(sigPin, !onState);
      pulse = false;
      pulseStart = true;
      }
      }
      }
      }

      posted in PROJECTS
      A
      amn
    • RE: I would like to send a PPM with M5 stack Fire

      @m5stack said in I would like to send a PPM with M5 stack Fire:
      read on the web the timer is different between Arduino and ESP32
      could be nice to find sample of code.
      other this I'll continue my investigation
      thx

      posted in PROJECTS
      A
      amn
    • RE: I would like to send a PPM with M5 stack Fire

      Hi
      already test these program, no compatble with ESP32 or M5 stack seem a problem of timer.
      turn on the loop.

      type of error:
      error: 'TCCR1A' was not declared in this scope

      posted in PROJECTS
      A
      amn
    • RE: platformio error with M5.IMU.INIT

      Solved

      comment M5stack.h:

      //#include <M5Stack.h>
      #define M5STACK_MPU6886

      thx

      posted in M5Stack Fire
      A
      amn
    • RE: I would like to send a PPM with M5 stack Fire

      Hi
      no find yet a correct solution
      somebody have exemple ?
      other this need for me to return to my arduino board.
      Thx

      posted in PROJECTS
      A
      amn
    • platformio error with M5.IMU.INIT

      hi report
      src\main.cpp: In function 'void setup()':
      src\main.cpp:71:6: error: 'class M5Stack' has no member named 'IMU'
      M5.IMU.Init();

      define PlatformIO:
      [env:m5stack-fire]
      platform = espressif32
      board = m5stack-fire
      framework = arduino
      lib_deps = M5Stack, Wire, SPI

      program work with arduino ide
      any idea ?
      thx

      posted in M5Stack Fire
      A
      amn
    • RE: M5 stack bluetooth with HM10

      thx I'll try later to see

      posted in PROJECTS
      A
      amn
    • RE: I would like to send a PPM with M5 stack Fire

      thx, found this https://github.com/schinken/PPMEncoder
      try later

      posted in PROJECTS
      A
      amn
    • RE: http request to netatmo fails with error (solved!)

      Hi
      is it possible to share you code ? interest by this code.
      for me the UIFlow not work with my M5 stack so I use only arduino ide interface.
      Thx

      posted in UIFlow
      A
      amn
    • RE: M5Stack MultiApp Advanced Firmware

      Hi
      somebody make a test with Netatmo ?
      I would like to be sure before start this install to see if there are possibility to connect via API key to netatmo server.
      interest by this
      Thx

      posted in PROJECTS
      A
      amn
    • RE: Generate PPM

      Hi
      do you find a solution ? also interest by this.
      Thx

      posted in Arduino
      A
      amn
    • RE: [Solved] GPS Unit (AT6558)

      Hi
      work with M5 stack Fire,
      the problem is the sensibility, this interface without external antenna is frequent to have disconnection or louse signal inside my home.
      corresponding of the price.

      posted in General
      A
      amn
    • M5 stack bluetooth with HM10

      Hi
      somebody have example how to do a communication beetween M5 stack bluetooth and HM10 ?
      thx
      Alain

      posted in PROJECTS
      A
      amn
    • RE: Atom lite driver/ULFlow problems windows 10

      @alien
      HI same issue for me with Fire
      seem not stable interface
      Alain

      posted in Atom
      A
      amn
    • I would like to send a PPM with M5 stack Fire

      HI,
      after to consult many web page I don't find a solution
      I would like to dialog with VESC to control the speed motor via PPN signal (NO PWM)
      Somebody have an idea ? or know how to do this ?
      thx
      Alain

      posted in PROJECTS
      A
      amn