Avatar for alexrlopez86

alexrlopez86

Member since Apr 2014 • Last active Nov 2014
  • 4 conversations
  • 9 comments

Most recent activity

  • in General
    Avatar for alexrlopez86

    tested the code and the function "SetWatch" does not work in stm32f3discovery

  • in General
    Avatar for alexrlopez86

    does not fail simply does not work ,does not display output

  • in General
    Avatar for alexrlopez86

    Hello everyone
    sorry if I do not extend (the English is not my forte)
    not know the cause but the "HC-SR04" does not work with 1.70 or 1.71 espruino 27th Sep in stm32f3discovery. espruino 1.71 significantly improves the fault persists, tested the code and it works in ministm32_32

    Test code

    var sensor = require("HC-SR04").connect(A0,A1,functio­n(dist) {
    console.log(dist+" cm away");
    });
    setInterval(function() {
    sensor.trigger(); // send pulse
    }, 500);

    • 2 comments
    • 2,739 views
  • in General
    Avatar for alexrlopez86

    I'm trying to do this

    http://qlfecv.wordpress.com/2012/11/14/r­eceptor-45-850-mhz-con-sintonizador-tv-a­nalogica-y-arduino/

    is arduino code

    I have as follows

    function get_freq(div){
     return div*50-38900;
    }
    function get_band(fr){
     var bb;
     if (fr<110000)//fvhf
     bb=0x01;
     else if (fr<407000)
     bb=0x02;//VHF_H
     else
     bb=0x04;//UHF
     return bb;
    }
    
    function get_low(fr){
     var lo;
     var div;
     lo=fr+38900; // add FI
     div=lo/50;
     return (div & 0x00ff);
    }
    
    function get_high(fr){
     var lo;
     var div;
     lo=fr+38900; // add FI
     div=lo/50;
     return (div & 0xff00)>>8;
    }
    
    function mostrar(pos){
     var fr;
     var i;
     
      fr=get_freq(pos)*1000;
     i=fr/1000000;
     fr=fr%1000000;
     if (i<100)
     print(" ");
     print(i);
     print(".");
     i=fr/1000;
     fr=fr%1000;
     if(i==0)
     print("000");
     else if (i<10){
     print("00");
     }else if (i<100)
     print("0");
     if (i)
     print(i);
     print(".000 Hz");
     }
    
    function tuner(fr)
    {
      I2C1.writeTo(0xC2,[get_high(fr),get_low(­fr),0xCC,get_band(fr)]);
    }
    I2C1.setup({scl:B6, sda:B7}); // Setup I2C
    I2C1.writeTo(0xC2,[0xFF]);
    

    The function "tuner" does the major work but it does not seem to work since the tuner does not alter his tencion.
    This one is a project that I would like to complete. If someone can check my code he would be grateful for it very much

  • in General
    Avatar for alexrlopez86

    Hello again here I put the changes in detail

    usb_conf.h
    before
    
    [#define](http://forum.espruino.com/sear­ch/?q=%23define) IMR_MSK (CNTR_CTRM  | CNTR_WKUPM |/* CNTR_SUSPM | CNTR_ERRM  | */CNTR_SOFM | /*CNTR_ESOFM |*/ CNTR_RESETM )
    After
    [#define](http://forum.espruino.com/sear­ch/?q=%23define) IMR_MSK (CNTR_CTRM  | CNTR_WKUPM | CNTR_SUSPM | CNTR_ERRM  | CNTR_SOFM | CNTR_ESOFM | CNTR_RESETM )
    
    jswrap_object.c
    before
    
    /*JSON{ "type":"method", "class": "Object", "name" : "hasOwnProperty",
             "description" : ["Return true if the object (not its prototype) has the given property.","NOTE: This currently returns false-positives for built-in functions in prototypes"],
             "generate" : "jswrap_object_hasOwnProperty",
             "params" : [ [ "name", "JsVar", "The name of the property to search for"] ],
             "return" : ["bool", "True if it exists, false if it doesn't"]
    }*/
    bool jswrap_object_hasOwnProperty(JsVar *parent, JsVar *name) {
    
      JsVar *propName = jsvAsArrayIndex(name);
    
      bool contains = false;
      if (jsvHasChildren(parent)) {
        JsVar *foundVar =  jsvFindChildFromVar(parent, propName, false);
        if (foundVar) {
          contains = true;
          jsvUnLock(foundVar);
        }
      }
    
      if (!contains) { // search builtins
        char str[32];
        jsvGetString(propName, str, sizeof(str));
    
        JsVar *foundVar = jswFindBuiltInFunction(parent, str);
        if (foundVar) {
          contains = true;
          jsvUnLock(foundVar);
        }
      }
    
      jsvUnLock(propName);
      return contains;
    }
    
    After
    
    /*JSON{ "type":"method", "class": "Object", "name" : "hasOwnProperty",
             "description" : ["Return true if the object (not its prototype) has the given property.","NOTE: This currently returns false-positives for built-in functions in prototypes"],
             "generate" : "jswrap_object_hasOwnProperty",
             "params" : [ [ "name", "JsVar", "The name of the property to search for"] ],
             "return" : ["bool", "True if it exists, false if it doesn't"]
    }*/
    bool jswrap_object_hasOwnProperty(JsVar *parent, JsVar *name) {
      char str[32];
      jsvGetString(name, str, sizeof(str));
      //JsVar *propName = jsvAsArrayIndex(name);
    
      bool contains = false;
      if (jsvHasChildren(parent)) {
        JsVar *foundVar =  jsvFindChildFromVar(parent, str, false);
        if (foundVar) {
          contains = true;
          jsvUnLock(foundVar);
        }
      }
    
      if (!contains) { // search builtins
        
        //jsvGetString(propName, str, sizeof(str));
    
        JsVar *foundVar = jswFindBuiltInFunction(parent, str);
        if (foundVar) {
          contains = true;
          jsvUnLock(foundVar);
        }
      }
    
      //jsvUnLock(propName);
      return contains;
    }
    

    functional today
    a greeting

  • in General
    Avatar for alexrlopez86

    Hello Gordon and changed the source of code and it works. and changed the following files: line 76 usb_conf.h and changed jswrap_json.c/h vesion 22.4.2014 .
    works, but the failure of screen(display shows rain)

    a greeting
    modified attached code
    http://picfacil.net46.net/Espruino-maste­r_23_4_2014.7z

  • in General
    Avatar for alexrlopez86

    connection problems with HY-MINISTM32V 3.2" only works in Windows 7 and Linux with the HY - MINISTM32V firmware 2.4". Windows with the HY - MINISTM32V firmware 3.2 "detects the plate but not connected and Linux mint does not detect it

    tested 22.4.2014
    Greetings I hope to be of help

Actions