Navigation

    M5Stack Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. Popular
    • All categories
    • Official Updates
    • Events
    •      Review
    •      Campaign
    • Features Wish List
    • General
    •      Anouncements
    •      Forum Rules (!!!!READ THIS FIRST BEFORE POSTING!!!!)
    •      News and Blog posts
    • PRODUCTS
    •      Modules
    •      Units
    •      FAQS
    •      Cores
    •          Core2 for AWS
    •          M5Stack Fire
    •          M5stack Grey
    •          M5 Stick/StickC
    •          M5GO
    •          FACES Kit
    •          M5Stick V
    •          Core 2
    •      Bases
    •      Atom
    • PROJECTS
    • SOFTWARE
    •      UIFlow
    •          Lessons and Guides
    •          Bug Report
    •          Custom Blocks
    •      Arduino
    •          Lessons and Guides
    •      Micropython
    •          Lessons and Guides
    •      M5EZ
    •      ESP - IDF
    •      UiFlow 2.0
    • Global Communities
    •      Русскоязычный форум
    •      日本語フォーラム
    •      Foro español
    •      Deutsches Forum
    •      简体中文论坛
    •          项目分享
    •          提问专区
    • All Topics
    • New Topics
    • Watched Topics
    • Unreplied Topics
    • All Time
    • Day
    • Week
    • Month

    • N

      Help Creating a Timer
      General • • Nastyone

      5
      0
      Votes
      5
      Posts
      321
      Views

      N

      @csierra67 said in Help Creating a Timer: Hi Adie, Two comments. The accuracy of any timer at the 1/100th second level is difficult to assess. You would need a reference timer and connect the start and stop signal both to this timer and to the M5stack /ESP32 based on timer Absence of a sytem clock. Actually there is one M5 Core 2, its RTC but it reports only seconds, minutes, hours, days.. On the other entry level Core models, there is none but you can add an RTC units that will provide the functionality Csierra67 @csierra67 Thank you again. I believed the RTC is just a link to an outside website for the data so not suitable for system timing references ..but probably wrong. Considering they promote the use of the M5Stack system for light industrial application a reliable link to the processor clock in 'ms' is vital but clearly my expectations are a little high of the Core2 having moved from learning the Arduino platform. Just for reference the below is the code I was trying to port across to the Core2 albeit it uses a relay and electro magnet for ball release where as I am now trying to move to servo release. Thanks again for your comments and sort of confirming the the Core 2 and me is a combination not up to much :). Kind regards Adie // Grove - LCD RGB Backlight - Version: Latest #include <Wire.h> #include "rgb_lcd.h" rgb_lcd lcd; const int colorR = 255; const int colorG = 0; const int colorB = 0; uint32_t btn_tStart, btn_tStartOld, sensor_tStart, tStart_ballRelease; const byte pinBtn = 2, // pin number button connected to. pinSensor = 3, // pin number sensor connected to. pinRelay = 4, // pin number relay connected to. debounceTimeBtn = 5; // debounce time for button. msec bool pinBtnState = true, // instantanious button state (noisy!) pinBtnStateOld = true, // btnStateDb = true, // debounced button state last loop btnStateDbOld = true, // debounced button state this loop btnLatch = false, // btnLatchOld = false, // sensorStateDbOld= true, // debounced sensor state last loop sensorStateDb = true, // debounced sensor state this loop ballDetected = false; void setup() { Serial.begin(9600); pinMode(pinBtn ,INPUT_PULLUP); pinMode(pinSensor ,INPUT_PULLUP); pinMode(pinRelay ,OUTPUT); //set up the LCD's number of columns and rows: lcd.begin(16,2); lcd.setRGB(colorR, colorG, colorB); lcd.print("Press Start"); btn_tStartOld = 0; } void loop() { // read inputs and debounce. debounceBtn(); //debounce button signal sensorStateDb = digitalRead(pinSensor); //debounce not required // make decisions and set outputs doStuff(); //update loop states for next round. btnStateDbOld = btnStateDb; sensorStateDbOld = sensorStateDb; } void debounceBtn() { pinBtnState = digitalRead(pinBtn); // get state of pin 2 if(pinBtnStateOld != pinBtnState) { btn_tStart = millis(); // reset db timer pinBtnStateOld = pinBtnState; // now they are equal, won't enter } // here again unless pin state changes if (millis() - btn_tStart > debounceTimeBtn) // db timer has elapsed { btnStateDb = pinBtnState; // button state is valid } } void doStuff(){ if(btnStateDb != btnStateDbOld && btnStateDb == true) // btn pressed { btnLatch = !btnLatch; // toggle latch digitalWrite(pinRelay,btnLatch); // set relay on/off if(btnLatch) { lcd.clear(); lcd.setCursor(0, 0); lcd.print("Magnet On"); //Serial.println("Magnet Energised"); ballDetected = false; // reset latch } else { tStart_ballRelease = millis(); lcd.setCursor(0, 0); lcd.print("Ball Released "); //Serial.println("ball released"); } } if(sensorStateDb != sensorStateDbOld && !sensorStateDb && !btnLatch && !ballDetected) // sensor sensed. { Serial.println("msecs since ball release: "+ String(millis()-tStart_ballRelease)); lcd.setCursor(0, 0); lcd.print("Ball Detected"); lcd.setCursor(0, 1); lcd.print(millis()-tStart_ballRelease); ballDetected = true; // set latch } }
    • R

      M5StickC connectivity
      M5 Stick/StickC • • rambinator

      4
      0
      Votes
      4
      Posts
      116
      Views

      G

      Hi @rambinator, Yeah, I missed the 2x, very sorry. Let's try again. I've got some kit, so I'm going to try and see where it takes us. Home > Store > Sensors > Hat(s) > ENV III – the picture gives G0 I2C-SDA, G26 I2C-SCL I have the ENV III unit, not hat, so I used a Groove2Dupoint and made the connections to I2C on the unit (plus 5V and GND). In UIFlow, I added the unit on custom pins 0 and 26 and made the simplest temp label 1 sec loop. Run and temp reading appeared, nice. Next I have the PaHUB (I2C-to-I2C), so I added the hub with custom G0 I2C-SDA, G26 I2C-SCL and ENV III to PaHUB|#0 Run and "Pahub unit maybe not connect", not shocked – read my other posts. Switch PaHub from custom GPIO to Port A (bottom), Run and ta-da temp reading ok on screen via the hub. And that's my concern for you with the PbHUB option (my issue might just be because I2C devices/PaHub). Now, the hub is quite cheap, so you could try it, maybe use Port A and put the 8-encoder on the top (custom pins 0 and 26). There are 3 pins at the top (0, 26, 36), which I would have said should suffice for proto hat option. However, I don't think all the PIN ports at the top are the same. I'm speculating here – @felmue help please – but I think the following for I2C. G0 - Fine SDA/SCL G26 - Fine SDA/SCL G36 - Couldn't find the unit because it's ADC, but it might be fine for the limit switch, risk with the angle units. In conclusion, I'd go for the PbHUB try it through the hat connection G0, G26, and connect angle units (GPIO) and limit switch (GPIO) to it. Use the bottom Port A for the 8-encoder. If you get error messages about the hub, swap top to bottom (fingers crossed). PS You might want the proto hat as well. The Dupont to top of StickC next to each other are a little tight. Might also save you the buy of Groove2Duponts because you will get one cable with each device (cut one in two to give bare cable to Groove).
    • P

      Lora868 Module and Cardkb
      Modules • • PK_Pippin

      4
      0
      Votes
      4
      Posts
      174
      Views

      I

      @felmue thank you for the suggestion for Ext Port for Core2.
    • A

      Arduino using GROVE B as I2C
      M5Stack Fire • • alpaka

      4
      0
      Votes
      4
      Posts
      146
      Views

      A

      @felmue BTW i forgot to mention that I also removed those nasty magnets as they disturb the used magnetometer. The metal screws where also replaced with plastic made.
    • K

      Wired communication between MULTIPLE Atom unit?
      General • • kmk68

      3
      1
      Votes
      3
      Posts
      102
      Views

      K

      OK, I think the solution is CAN communication. The question is has anyone tested this protocol directly unit to unit, without any hardware? Pozdr., K.
    • How long M5stack-paper can sleep for?
      PRODUCTS • paper m5stack-paper • • ScheduleDisplay

      2
      0
      Votes
      2
      Posts
      82
      Views

      Hello @ScheduleDisplay M5.shutdown(secs) uses the timer function of the RTC. According to the documentation the timer is 8 bits and it slowest clock source is 1/60 Hz. So you get about 255 x 60 s = 15300 s which is roughly 4 h (= 14400 s). Re 1.) So yes, there is a limitation of the sleep duration when using the timer function of the RTC. If you need longer period than 4 hours you need to look into the alarm functionality of the RTC. E.g. you first need to read the RTC time, add the amount you want to sleep to it and then set the alarm accordingly. M5.shutdown(const rtc_date_t &RTC_DateStruct, const rtc_time_t &RTC_TimeStruct) can be used to set the alarm, but it only works when you first calculate the alarm time in relation the actual time in the RTC. Note: the actual time in the RTC resets when there is no USB and the battery has run out of juice. The actual time is not automatically the time on you wall clock (except when you actually set it in the RTC). But for the alarm function to be used it doesn't have to be synced with the wall clock - it's only important that you know the time the RTC so you can calculate the difference and set the alarm. Re 2.) so no other shutdown function is needed. Thanks Felix
    • M

      How do i get current time in 24 hour time format and no date.
      UiFlow 2.0 • • MrWormy

      2
      0
      Votes
      2
      Posts
      156
      Views

      Have you tried using just the time only or hour and minute only blocks?
    • H

      ATOMS3 Screen Backlight → Want to Switch OFF
      Atom • • hugo.reed

      2
      0
      Votes
      2
      Posts
      109
      Views

      Hello @hugo-reed according to the M5AtomS3 documentation the backlight is connected to GPIO16. So setting that to LOW should turn it off. (Note: not tested) digitalWrite(16, LOW); Note: GPIO16 gets initialized and set to HIGH in function M5Display::begin(). Thanks Felix
    • T

      atoms s3 problems
      Atom • • tomtom22

      2
      0
      Votes
      2
      Posts
      162
      Views

      Hello @tomtom22 to you first question: it doesn't matter whether you press and hold the reset button to get the M5AtomS3 into download mode to burn firmware or let the automatic do it. The press and hold the reset button method is available in case the automatic download mode fails. This can happen if for instance the currently running firmware has an issue causing the device to constantly reset. I personally let the automatic download mode do its thing and only if that fails use the reset button method. Thanks Felix
    • Connecting temp sensor DS18B20 direct to A grove port - 5V supply vs 3.3v logic
      Cores • • arzaman

      2
      0
      Votes
      2
      Posts
      119
      Views

      G

      Hi @arzaman, Sorry to answer with a question, but I just want to check I've understood. You want to accommodate the 5V supply into this sensor and associated 5V? logic output from it down to the 3V3 input of StickC, Core2, etc? A couple of thoughts: #1 StickC has a 3V pin out on the end opposite Groove port, so I guess you could go from the head end of the StickC to sensor (reduce all to 3V3). #2 Copy the voltage divider circuit a lot of the M5Stack sensors use (they are quite cheap, so you could even use one as a donor and solder your sensor on to it). https://docs.m5stack.com/en/unit/dual_button #3 I've a feeling Seeed, DFRobot, Waveshare do a mini board to do such a thing, but probably equivalent to donor M5Stack part. If you used the M5Stack Mini Dual Button Unit as a donor/connection board. I suppose you could have two inputs, pin 32 and pin 33, hide the pull up resistors, etc. Or the Proto units, perhaps an easier solder at home proposition. Q) If it "can be powered from data line. Power supply range is 3.0V to 5.5V", would 5V power issue go away anyway? https://shop.pimoroni.com/products/temperature-probe-ds18b20-arduino-compatible-adapter?variant=39365415829587 (NB Alt schemtic for circuit)
    • C

      Blockey[CatM+GNSS Unit] , HTTP request
      UIFlow • • cowcowtweet

      2
      0
      Votes
      2
      Posts
      159
      Views

      P

      Hi, @cowcowtweet increases header input
    • F

      Re: [RFID2 unit not working with UIFlow 1.12.5 / Core2 Burn 1.9.8]
      Units • • falbriard

      1
      1
      Votes
      1
      Posts
      74
      Views

      No one has replied

    • F

      RFID2 unit not working with UIFlow 1.12.5 / Core2 Burn 1.9,8
      Units • • falbriard

      1
      0
      Votes
      1
      Posts
      82
      Views

      No one has replied

    • T

      atom range optional upgrades
      Features Wish List • • tomtom22

      1
      0
      Votes
      1
      Posts
      108
      Views

      No one has replied

    • T

      Best practices
      General • • tomtom22

      1
      0
      Votes
      1
      Posts
      96
      Views

      No one has replied

    • M5Unit-ENV library for PlatformIO is not up-to-date
      Arduino • • Amedee

      1
      0
      Votes
      1
      Posts
      93
      Views

      No one has replied