Avatar for Shane.au.wade

Shane.au.wade

Member since Feb 2019 • Last active Apr 2019
  • 1 conversations
  • 7 comments

CS Major in the SF area

Most recent activity

  • in Puck.js, Pixl.js and MDBT42
    Avatar for Shane.au.wade

    I do have full control over the receiver as well. The receiver is another MDBT42Q with a female servo header soldered to it. Attaches is a photo.

    It is fairly easy to open up the remote and press the reset button so I might consider locking it down fully once I have tested it extensively.

    receiver.js :

    global.LED2=D2;
    
    var on = false;
    
    function onInit()
    {
    
    }
    
    NRF.setServices({
      "3e440001-f5bb-357d-719d-179272e4d4d9": {
        "3e440002-f5bb-357d-719d-179272e4d4d9": {
          value : [0],
          maxLen : 1,
          writable : true,
          //description: "PWM Throttle Input",
          onWrite : function(evt) {
            // Data comes in as a byte, make it 0..1 range
            var n = evt.data[0] / 255;
            // Send data directly to servo as PWM
            analogWrite(D7, ((1.2 + n*0.8)/10)*0.5, {freq:50});
          }
        }
      }
    }, { uart : true });
    
    
    NRF.setAdvertising({}, {name:"RxFlag"});
    
    
    
     // analogWrite(D7, pwmValue);
    
    //on disconnect return to a neutral state
    NRF.on('disconnect', function() {
      digitalWrite(D7,0.5);
      digitalWrite(LED, false);
    });
    
    NRF.on('connect', function() {
      digitalWrite(LED, true);
    });
    
    
     digitalWrite(LED2, true);
    

    Is there an event that occurs when the board detects a "powering off" state? I would like to send a neutral state of 0.5 to the receiver as soon as the remote disconnects form the board.

    Is it preferable to use the startBonding method of connection or is just using bluetoothdevice.connect() is fine/similar/the same?

    So far, at max tx power and lowest connection internal the performance has been very good. I am hoping that the connection is stable even in less than ideal connections (I.E. downtown SF where there is a lot of random RF everywhere.)

  • in Puck.js, Pixl.js and MDBT42
    Avatar for Shane.au.wade

    @Gordon

    I am working on increasing the security and efficiency of my remote. If you have sometime, I'd really like your feedback on what I have written so far. The next step is implementing the pair with passkey method.

  • in Puck.js, Pixl.js and MDBT42
    Avatar for Shane.au.wade

    I will update my two boards this week then.

    @Gordon I uploaded your code and made a few modifications and EUREKA! It works. I took my first test ride today and it seemed to perform well. Of course there is still a ton of testing and programming left to do but this is an excellent milestone.

    Here is a forum post!

    https://www.electric-skateboard.builders/t/no-name-yet-diy-esk8-remote/84639

  • in Puck.js, Pixl.js and MDBT42
    Avatar for Shane.au.wade

    https://www.adafruit.com/product/2124

    Here is the charging board that I am using. It is very small, and charges at 500ma. That isn't very fast, but you shouldn't need to charge it very often due to lower power consumption paired with a large battery. (2800mah samsung cell)
    If you need a small lipo/lion charger, that breakout board seems to be a good option.

    The MDBT42q has built in power management. it can be powered using 2.5 -> 16v. With the charge board and power management circuity it should be fine. The bare nrf52832 soc can only be powered with <=3.6v.

    I am right handed, yes.

    I worked hard on the remotes design. I wanted it to look slick.

  • in Puck.js, Pixl.js and MDBT42
    Avatar for Shane.au.wade

    Wow, thank you gordon! I really appreciate your help. I will look over this code tonight and then get back to you with a few more questions.

    My end goal is to create a repo in Github, release the STl for the remote body (on thingiverse), and then create a build video on YouTube. You will also find a build post on the electric skateboard builders forum.

    Would you reccomend that flash the new v2.0 firmware before I continue? I'm currently using v1.99 I believe

  • in Puck.js, Pixl.js and MDBT42
    Avatar for Shane.au.wade

    I am in the final stages of the creation of my Esk8 remote. I've built the hardware, created a simple UI, and now I need to write the bluetooth communication.

    I need some advice on how to create a bonded connection. I understand how promises work and the basic syntax of using nrf.connect().then.... to get the gatt and services/characteristics.

    Is there an easy way to read/write a value of characteristic without using that long syntax? Can I go through the pairing/bonding process, save the characteristic object to a variable (i.e. char = characteristic returned) and just call char.writeValue(data) to update the characteristic?

    Additionally, what is the reccomened transmitter/reciever setup? Should the reciever read a changing characteristic on the remote or should the remote(transmitter) write a value to a characteristic/service on the reciever?

    To give more detail, the remote uses a hall effect sensor to detect the throttle position and I need to send a value to the reciever and then send a pwm signal to the ESC based on the throttles position.

    Any help with this project would be appreciated.

Actions