Avatar for barry_b_benson

barry_b_benson

Member since Jan 2017 • Last active Dec 2019
  • 45 conversations
  • 96 comments

Most recent activity

  • in Electronics
    Avatar for barry_b_benson

    Can I power the MDBT42Q module(not the breakout board) with a 3.7v lipo and a voltage regulator? I also edited my original post and added some more info on how the motors will be used, so just a heads-up.

    Thanks!

    EDIT: will I need any passive components for the mosfets?

  • in Electronics
    Avatar for barry_b_benson

    Hi there,
    I want to make a small robot that moves with two vibration motors on each side. I will remove the motors' eccentric weights and replace them with small wheels, so the vibration motors will essentially act like really small DC motors. I'm thinking of using an MDBT42Q. How do I connect the motors to the microcontroller? Should I just connect one wire to a signal and another to ground? Or are there passive components needed?

    Also, how long would my robot last? It will have two mini vibration motors, two green LEDs(on for about 5 minutes I think) and will be recieving commands OTA via bluetooth. It's all powered by a CR2032 battery.

    Thanks!

  • in Electronics
    Avatar for barry_b_benson

    Hi,

    I just thought of this and I just want to see if it will work. I want to see if I can multi-boot a microcontroller, such as an ESP32 or STM32 chip from multiple flash chips. For example, I can have Espruino on one chip, Micropython in the other, Lua on the third, etc. I think it will be awesome but before I make it I want to see if it's possible. If it is, how hard would it be?

    Thanks!

    P.S. Massive congrats to Gordon for getting 658% of his funding goal for Bangle.JS as of November 24 2019! I can't wait for the new device and wish Gordon the best on his embedded endeavors.

  • in Interfacing
    Avatar for barry_b_benson

    Hi, I programmed my MDBT42Q module to make a small beep sound whenever I press or release a button. This is the code for my piezo sound effects:

    function beep(f) { 
      if (f===0) digitalWrite(spk,0);
      else analogWrite(spk, 0.5, { freq: f } );
    }
    
    function buttonBoop(f) {
      beep(f);
      setTimeout(function() {digitalWrite(spk, 0);}, 50);
    }
    

    pretty simple, right?

    So I tried to put them into setWatch functions so that my wristwatch(the PCB that houses the MDBT42Q module) can make a small beep whenever a button is pressed. The two setwatches are for when the button is pressed and released. When the button is pressed, the watch displays the hour on its two 7-seg LEDs for as long as the button is held down. when the button is released, the watch displays the minutes for 300 milliseconds. Here is the code:

    setWatch(function(e) {
      data();  // grabs date & time
      buttonBoop(650); // supposed to beep piezo at 650hz for 50 milliseconds
      while (digitalRead(select) != 1) { // the watch displays the hour
        display(1, hourFirstDigit);
        display(2, hourSecondDigit);
      }
      allClear(); // resets 7-segment displays
    }, select, {repeat: true, debounce: 50, edge: "falling"});
    
    setWatch(function(e) {
      data(); // grabs date & time
      buttonBoop(950); // supposed to beep piezo at 950 hz for 50 milliseconds
      for (i = 0; i < 30; i++) { // watch displays the minutes
        display(1, minFirstDigit);
        display(2, minSecondDigit);
      }
        allClear(); // resets the 7 seg LEDs
    }, select, {repeat: true, debounce: 50, edge: "rising"});
    }
    

    the problem is, whenever I press/release the button, the piezo speaker beeps until the LEDs are cleared. That is, when the button is pressed, the piezo beeps at 650hz until I release it, and when the button is released, the piezo beeps at 950mhz for 300mhz - which is when the LEDs are cleared. Sorry if this sounds confusing for you, I can't find a way to word it well.

    I only want the piezo to beep for 50 milliseconds, what is making it go for the entire setWatch() duration?

    The strange thing is, when do a clearWatch() and run this instead...

    setWatch(function(e) {
      buttonBoop(650);
    }, select, {repeat: true, debounce: 50, edge: "falling"});
    
    setWatch(function(e) {
      buttonBoop(950);
    }, select, {repeat: true, debounce: 50, edge: "rising"});
    

    the piezo behaves just fine. A short beep when the button is pressed, and another short beep when the button is released. It's the same setWatch() code but with all the LED/time related code removed. But I can't find anything with my LED/time code. Thought this would help.

    This is the entire source code for my watch. The buggy part is near the end.

    Thanks.

  • in Puck.js, Pixl.js and MDBT42
    Avatar for barry_b_benson

    my plan was to have different devices that I would plug in one at a time. For example, one day I would plug in an I2C LCD module and another day I would take that off and plug in a USB to serial cable. I guess I would be fine with that

Actions