Follow along with the video below to see how to install our site as a web app on your home screen.
Nota: This feature currently requires accessing the site using the built-in Safari browser.
#include <avr/io.h>
#include <util/delay.h>
#define DI PB0
#define CLK PB1
#define RST PB2
#define WTV20_PORT PORTB
int main(void)
{
DDRB=0B00000111;
PORTB=0B00000111;
WTV20_PORT&=~(1<<RST);
_delay_ms(5);
WTV20_PORT|=(1<<RST);
_delay_ms(300);
WTV20_PORT&=~(1<<CLK);
_delay_ms(2);
int i;
for ( i=15; i>=0; i--)
{
_delay_us(50);
if(([B]0xFFFE[/B]>>i)&0x0001 >0) //El dato 0xFFFE es el que se sustituye
{ //para enviar diferentes comandos de 16 bits
//el 0xFFFE es el comando play
WTV20_PORT|=(1<<DI);
}
else
{
WTV20_PORT&=~(1<<DI);
}
_delay_us(50);
WTV20_PORT|=(1<<CLK);
_delay_us(50);
if(i>0)
WTV20_PORT&=~(1<<DI);
else
WTV20_PORT|=(1<<DI);
_delay_us(50);
if(i>0)
WTV20_PORT&=~(1<<CLK);
else
WTV20_PORT|=(1<<CLK);
}
_delay_ms(20);
while(1)
{
}
}
#include <P18F458.h>
#include <delays.h>
#pragma config OSC=XT, OSCS=OFF //Cristal como reloj, apaga reloj interno
#pragma config WDT=OFF //Apaga WDT
#pragma config PWRT=ON, BOR=ON //Activa Power On Reset
#pragma config DEBUG=OFF //Desactiva debug
#pragma config LVP=OFF, STVR=OFF //No reset overflow stack y patita PB5=I/O
#define DI PORTBbits.RB0
#define CLK PORTBbits.RB1
#define RST PORTBbits.RB2
#define WTV20_PORT PORTB
void main(void)
{
int i;
PORTB=0;
TRISB=0b11111000;
PORTB=0b00000111;
WTV20_PORT&=~(1<<RST);
Delay100TCYx(50); // 5 ms
WTV20_PORT|=(1<<RST);
Delay1KTCYx(300); // 300 ms
WTV20_PORT&=~(1<<CLK);
Delay100TCYx(20); //2 ms
for( i=15;i>=0;i--)
{
Delay10TCYx(5); //50 us
if((0xFFFE>>i)&0x0001>0) //0xFFFE comando a enviar
{
WTV20_PORT|=(1<<DI);
}
else
{
WTV20_PORT&=~(1<<DI);
}
Delay10TCYx(5); //50 us
WTV20_PORT|=(1<<CLK);
Delay10TCYx(5); //50 us
if(i>0)
WTV20_PORT&=~(1<<DI);
else
WTV20_PORT|=(1<<DI);
Delay10TCYx(5); //50 us
if(i>0)
WTV20_PORT&=~(1<<CLK);
else
WTV20_PORT|=(1<<CLK);
}
Delay100TCYx(200); //20 ms
while(1)
{
}
}