Avatar for DarKMooN

DarKMooN

Member since Aug 2015 • Last active Oct 2016
  • 2 conversations
  • 4 comments

Most recent activity

    • 3 comments
    • 334 views
  • in Porting to new Devices
    Avatar for DarKMooN

    Heureka, I did not know that it can be somewhere in jspin.c. Thank you very much :)

  • in Porting to new Devices
    Avatar for DarKMooN

    Hello,
    I'm building Espruino on custom board (based on STM32F4) which have five buttons and I would like to add the definition of the fifth button to binary. I added definitions of buttons to STM32F4DISCOVERY.py file and also I added BTN5 to simpleDevices array in build_platform_config.py but when I flash the board and try to call BTN5 I get Uncaught ReferenceError: "BTN5" is not defined. Do I need to define this button somewhere else or it's not possible to define more buttons or other devices? I found note about this mentioning that I can you LED1-LED8, BTN1-BTN4, etc., but I need one more button for convenience. Thanks for any advice

  • in Interfacing
    Avatar for DarKMooN

    Awesome, it fixed the problem. Thanks a lot.

  • in Interfacing
    Avatar for DarKMooN

    Hi, I'm trying to create server on ESP8266 and when I run code locally with USB cable connected it works fine, but when I save code to flash I get "Not connected to the internet" error.
    I'm not sure what I do wrong or why is the internet connection required, because I'm not communicating with it. Can someone please help me?
    I use STM32F4Discovery with 1.80.1 Espruino and MOD-WIFI-ESP8266 with 0.25 firmware version.
    Code is below

    Serial3.setup(115200, { rx: D9, tx : D8 });
    var soc;
    var wifi = require("ESP8266WiFi_0v25").connect(Seri­al3, function(err) {
      if (err) {digitalWrite(LED4,1);throw err;}
      //wifi.at.debug();
        console.log("Connecting to WiFi");
          wifi.connect("Espruino",'freeWifi', function(err) {
            if (err) throw err;
            console.log("Connected");
            require("net").createServer(function(c){­
              console.log("incomming connection");
              c.on('data', onDataCallback);
              c.on('close', function(){
                console.log("bye");
              });
              soc = c;
            }).listen(8080);
            wifi.getIP(function(err,ip){
              if(err === null){
                console.log(ip);
                serverIP = ip;
                digitalWrite(LED2, 1);
              }
            });
      });
    });
    
    function onDataCallback(data){
      digitalWrite(LED1, !digitalRead(LED1));
      console.log("Server received: " + data);
      if(data !== undefined){
        if(data.length >= 6 && data.substr(0, 3).toLowerCase() == "led"){
          switch(data.charAt(3)){
            case '1':digitalWrite(LED1, data.charAt(5));break;
            case '2':digitalWrite(LED2, data.charAt(5));break;
            case '3':digitalWrite(LED3, data.charAt(5));break;
            case '4':digitalWrite(LED4, data.charAt(5));break;
          }
        }
        soc.write("Response: " + data);
        if(data.substr(0,4) == "exit")
          soc.end();
      }
    }
    save();
    
Actions