uv1316t control

Posted on
  • 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

  • So this is a TV tuner (for UHF/VHF, which one might note are no longer broadcast in much of the developed world), with I2C control to choose the channel?

    You're using an 8-bit address, while the Espruino uses the 7-bit address and handles the last bit for you. You need to shift that address one bit to the right, ie, 0x61.

    Also, there are 3 other addresses it could use - try em all if that one doesn't work.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

uv1316t control

Posted by Avatar for alexrlopez86 @alexrlopez86

Actions