You are reading a single comment by @Alex and its replies. Click here to read the full conversation.
  • Hi Tom,

    You can use the AT commands to configure them as you like I believe. I was lucky enough that the manufacturers site was online yesterday and I got the latest datasheet. Since that site is offline now, I've reposted it on one of my websites http://avalondesigns.nl/dropbox/files/bl­uetooth40_en.pdf

    You can have them as central or advertiser and you can set the advertising interval. Is that helpful?

    Here is some code I used to set it up:

    function switchToMaster() {
      setTimeout(function() {Serial1.print("AT+IMME1");},200);
      setTimeout(function() {Serial1.print("AT+NOTI1");},400);
      setTimeout(function() {Serial1.print("AT+ROLE1");},600);
    }
    
    function onInit() {
      Serial1.setup(9600,{rx:A10,tx:A9});
      console.log("Booting...");
      Serial1.on('data', function (data) {console.log(data);});
      setTimeout(function() {Serial1.print("AT+RENEW");},200);
      setTimeout(function() {Serial1.print("AT");},500);
      setTimeout(function() {console.log("Ready!");},600);
    }
    

    I have pin 23 on constant 3.3v with the 470k resistor and pin 24 rewired to A14 to use the LED2 of the espruino.

    Regards,

    Alex

About

Avatar for Alex @Alex started