ログインしてさらにmixiを楽しもう

コメントを投稿して情報交換!
更新通知を受け取って、最新情報をゲット!

ひろ☆みんを崇める会!コミュの制御

  • mixiチェック
  • このエントリーをはてなブックマークに追加

コメント(18)


#include<jeclib.h>
#define TIMER 5000
void main(void)
{
TRISB &= ~0xf0;

PORTB &= ~0xf0;
PORTB |= 0xa0;

delay_ms(TIMER);

PORTB &= ~0xa0;
PORTB |= 0x50;

delay_ms(TIMER);

PORTB &= ~0xf0;

while(1)
{
;/*Do Noting!*/
}
}
/*End Of File*/
#include<jeclib.h>

#define TIMER 300

void main(void)
{
int i;

TRISB &= ~0xf0;
for(i = 0 ; i <= 15 ; i++)
{
PORTB &= ~0xf0;
PORTB |= i<<4;
delay_ms(TIMER);
}
PORTB &= ~0xf0;

while(1)
{
;//Do Nothing!!
}
}
/*End Of File*/
#include<jeclib.h>

#define TIMER 300

void main(void)
{
int i ;

TRISB &= ~0xf0;

while(1)
{
for(i = 0 ; i <= 15 ; i++)
{

PORTB &= ~0xf0;
PORTB |= i<<4;
delay_ms(TIMER);
}
}

}
/*End Of File*/
#include<jeclib.h>

#define TIMER 300

void main(void)
{
int i;

TRISB &= ~0xf0;

while(1)
{
for(i = 0 ; i < 4 ; i++)
{
PORTB &= ~0xf0;
PORTB |= 0x10<<i;

delay_ms(TIMER);

}
}
}
/*End Of File*/
#include<jeclib.h>

#define TIMER 300

void main(void)
{
int i;
int j;

TRISB &= ~0xf0;

PORTB &= ~0xf0;

while(1)
{
for(i = 0 ; i < 4 ; i++)
{

PORTB |= 0x10<<i;

delay_ms(TIMER);

}

for(j = 0 ; j < 4 ; j++)
{
PORTB &= ~0x10<<j;

delay_ms(TIMER);
}
}
}
/*End Of File*/
#include<jeclib.h>

#define PIN0 0x01
#define PIN1 0x02
#define PIN2 0x04
#define PIN3 0x08
#define SW1 PIN0
#define SW2 PIN1
#define SW3 PIN2
#define SW4 PIN3

void main(void)
{
ADCON1 = 0x07;
TRISA |= 0x0f;

TRISB &= ~0xf0;
PORTB &= ~0xf0;

while(1)
{
if((PORTA & SW1) == 0x00)
{
PORTB &= ~0x10;
}
else
{
PORTB |= 0x10;
}
}
}
/*End Of File*/
#include<jeclib.h>

#define PIN0 0x01
#define PIN1 0x02
#define PIN2 0x04
#define PIN3 0x08
#define SW1 PIN0
#define SW2 PIN1
#define SW3 PIN2
#define SW4 PIN3

void main(void)
{
ADCON1 = 0x07;
TRISA |= 0x0f;

TRISB &= ~0xf0;

while(PORTB &= ~0xf0,1)
{

if((PORTA & SW1) == 0x00)
{
PORTB |= 0x10;
}
if((PORTA & SW2) == 0x00)
{
PORTB |= 0x20;
}
if((PORTA & SW3) == 0x00)
{
PORTB |= 0x40;
}
if((PORTA & SW4) == 0x00)
{
PORTB |= 0x80;
}

}
}
/*End Of File*/
#include<jeclib.h>

#define PIN0 0x01
#define PIN1 0x02
#define PIN2 0x04
#define PIN3 0x08
#define SW1 PIN0
#define SW2 PIN1
#define SW3 PIN2
#define SW4 PIN3


void main(void)
{
int cnt;

ADCON1 = 0x07;
TRISA |= 0x0f;

TRISB &= ~0xf0;
PORTB &= ~0xf0;

cnt = 0;
while(1)
{
while((PORTA & SW1) != 0x00)
{
;/*Do Noting*/
}

delay_ms(10);

while((PORTA & SW1) == 0x00)
{
;/*Do Noting*/
}

delay_ms(10);

cnt++; //循環 ここから
cnt &= 0x0f; //

PORTB &= ~0xf0; //
PORTB |= cnt << 4;//ここまで
}
}
/*End Of File*/
#include<jeclib.h>

#define PIN0 0x01
#define PIN1 0x02
#define PIN2 0x04
#define PIN3 0x08
#define SW1 PIN0
#define SW2 PIN1
#define SW3 PIN2
#define SW4 PIN3

void main(void)
{
int cnt;

ADCON1 = 0x07;
TRISA |= 0x0f;

TRISB &= ~0xf0;
PORTB &= ~0xf0;

cnt = 0;
while(1)
{
if((PORTA & SW1) == 0x00)
{
delay_ms(10);

while((PORTA & SW1) == 0x00)
{
;/*Do Noting*/
}

delay_ms(10);

cnt++;
cnt &= 0x0f;

PORTB &= ~0xf0;
PORTB |= cnt << 4;
}

if((PORTA & SW2) == 0x00)
{
delay_ms(10);

while((PORTA & SW2) == 0x00)
{
;/*Do Noting*/
}

delay_ms(10);

cnt--;
cnt &= 0x0f;

PORTB &= ~0xf0;
PORTB |= cnt << 4;
}
}
}
#include<jeclib.h>

void main(void)
{
TRISB &= ~0xf6;
PORTB &= ~0xf6;

TRISD &= ~0xff;

PORTD &= ~0xff;
PORTD |= 0x82;

while(1)
{
;/*Do Noting!*/
}
}
#include<jeclib.h>

#define CNT 300

void led7_puthex1( int data );
void main( void )
{
int i ;

TRISB &= ~0xf6;
PORTB &= ~0xf6;

TRISD &= ~0xff;

i = 0;
while( 1 )
{
PORTD &= ~0xff;
led7_puthex1( i );

i++;
i &= 0x0f;
}
}

void led7_puthex1( int data )
{
const unsigned char tbl[16] =
{
0xc0 , 0xf9 , 0xa4 , 0xb0 ,
0x99 , 0x92 , 0x82 , 0xf8 ,
0x80 , 0x90 , 0x88 , 0x83 ,
0xc6 , 0xa1 , 0x86 , 0x8e ,
};

PORTD |= tbl[data];

delay_ms( CNT );

return ;
}
#include<jeclib.h>

#define TIME 300

void led7_set_column( int column );
void led7_puthex1( int data );
void main( void )
{
int cnt ;
int col ;

TRISD = 0x00;

TRISB &= ~0xf6;
PORTB &= ~0xf0;

cnt = 0;
col = 0;
while( 1 )
{
led7_set_column( col );

led7_puthex1( cnt );

delay_ms( TIME );

col = col + 1 & 0x03;

cnt = cnt + 1 & 0x0f;
}
}

void led7_puthex1( int data )
{
const unsigned char tbl[16] =
{
0xc0 , 0xf9 , 0xa4 , 0xb0 ,
0x99 , 0x92 , 0x82 , 0xf8 ,
0x80 , 0x90 , 0x88 , 0x83 ,
0xc6 , 0xa1 , 0x86 , 0x8e ,
};

PORTD = tbl[data];

return ;
}

void led7_set_column( int column )
{
PORTB &= ~0x06;
PORTB |= column<<1;
return;
}
#include<jeclib.h>

#define TIME 4

void led7_set_column( int column );
void led7_puthex1( int data );
void main( void )
{
unsigned int data = 0x12ab;
int cnt ;
int col ;

TRISD = 0x00;

TRISB &= ~0xf6;
PORTB &= ~0xf0;

col = 0;
while( 1 )
{
led7_set_column( col );
cnt = data>>(col<<2)&0x0f;
led7_puthex1( cnt );

col = col + 1 & 0x03;

delay_ms( TIME );
}
}

void led7_puthex1( int data )
{
const unsigned char tbl[16] =
{
0xc0 , 0xf9 , 0xa4 , 0xb0 ,
0x99 , 0x92 , 0x82 , 0xf8 ,
0x80 , 0x90 , 0x88 , 0x83 ,
0xc6 , 0xa1 , 0x86 , 0x8e ,
};

PORTD = tbl[data];

return ;
}

void led7_set_column( int column )
{
PORTB &= ~0x06;
PORTB |= column<<1;
return;
}

#include<jeclib.h>

#define TIME 2000

void init_port( void );
void init_interrupt( void );
void main( void )
{
init_port();
init_interrupt();

/* Idol Roop */
while( 1 )
{

delay_ms( TIME );
}
}

void init_port( void )
{

ADCON1 = 0x07;
TRISA |= 0x0f;

TRISB &= ~0xf0;
TRISB |= 0x01;
PORTB &= ~0xf0;

return;
}

void init_interrupt( void )
{
INTCON &= ~GIE;
INTCON |= INTE;
INTCON |= GIE;

return;
}

void interrupt isr(void)
{
if((INTCON & INTF) != 0x00)
{
static int cnt = 0;

PORTB &= ~0xf0;
PORTB |= cnt << 4;

cnt++;
cnt &= 0x0f;

INTCON &= ~INTF;
}

return;
}
#include<jeclib.h>

#define TIME 300

void init_port( void );
void init_interrupt( void );
void led7_set_column( int column );
void led7_puthex1( int data );
volatile int gr_cnt;
void main( void )
{
gr_cnt = 0;

init_port();
init_interrupt();

/* Idol Roop */
while( 1 )
{
led7_set_column( 0 );

led7_puthex1( gr_cnt );

gr_cnt = gr_cnt + 1 & 0x0f;

delay_ms( TIME );
}
}

void init_port( void )
{

ADCON1 = 0x07;
TRISA |= 0x0f;

TRISB &= ~0xf6;
TRISB |= 0x01;
PORTB &= ~0xf0;

TRISD = 0x00;


return;
}

void init_interrupt( void )
{
INTCON &= ~GIE;
INTCON |= INTE;
INTCON |= GIE;

return;
}

void interrupt isr(void)
{
if((INTCON & INTF) != 0x00)
{
gr_cnt = 0;

INTCON &= ~INTF;
}

return;
}

void led7_puthex1( int data )
{
const unsigned char tbl[16] =
{
0xc0 , 0xf9 , 0xa4 , 0xb0 ,
0x99 , 0x92 , 0x82 , 0xf8 ,
0x80 , 0x90 , 0x88 , 0x83 ,
0xc6 , 0xa1 , 0x86 , 0x8e ,
};

PORTD = tbl[data];

return ;
}

void led7_set_column( int column )
{
PORTB &= ~0x06;
PORTB |= column<<1;

return;
}
#include<jeclib.h>

#define TIME 300

void init_port( void );
void init_interrupt( void );
void led7_set_column( int column );
void led7_puthex1( int data );
volatile unsigned int gl_cnt;
void main( void )
{
gl_cnt = 0x0000;
init_port();
init_interrupt();

while( 1 )
{
delay_ms(TIME);
gl_cnt = gl_cnt + 1 & 0xffff;
}
return;
}

void init_port( void )
{
TRISB &= ~0xf6;
PORTB &= ~0xf0;
TRISD = 0x00;

return;
}

void init_interrupt( void )
{
INTCON &= ~GIE;
OPTION = 0xd2;
INTCON |= TOIE;
INTCON |= GIE;

return;
}

void interrupt isr(void)
{
if((INTCON & TOIF) != 0x00)
{
static int col = 0;
static int cnt = 0;

led7_set_column(col);
cnt = gl_cnt>>(col<<2)&0x0f;
led7_puthex(cnt);

col = col + 1 & 0x03;

INTCON &= ~TOIF;
}

return;
}

void led7_puthex1( int data )
{
const unsigned char tbl[16] =
{
0xc0 , 0xf9 , 0xa4 , 0xb0 ,
0x99 , 0x92 , 0x82 , 0xf8 ,
0x80 , 0x90 , 0x88 , 0x83 ,
0xc6 , 0xa1 , 0x86 , 0x8e ,
};

PORTD = tbl[data];

return ;
}

void led7_set_column( int column )
{
PORTB &= ~0x06;
PORTB |= column<<1;
return;
}
#include<jeclib.h>

#define PIN0 0x01
#define PIN1 0x02
#define PIN2 0x04
#define PIN3 0x08
#define PIN4 0x10
#define PIN5 0x20
#define PIN6 0x40
#define PIN7 0x80

#define E PIN2
#define RW PIN1
#define RS PIN0

#define E_PORT PORTE
#define RW_PORT PORTE
#define RS_PORT PORTE
#define DATA_PORT PORTB
void init_lcd_example(void);
void init_port(void);
void write_byte_dr(unsigned char data);
void main(void)
{
int c;

init_port();
init_lcd_example();

while(1)
{
for(c = 0x20 ; c <= 0x7e ; c++)
{
write_byte_dr(c);
delay_ms(300);
}
}
}
void init_port(void)
{
ADCON1 = 0x07;

TRISB &= ~0xf0;
PORTB &= ~0xf0;

TRISE &= ~0x07;
E_PORT &= ~E;

return;
}
void write_byte_dr(unsigned char data)
{
RW_PORT &= ~RW;
RS_PORT |= RS;
E_PORT |= E;
DATA_PORT = data & 0xf0;
E_PORT &= ~E;


RW_PORT &= ~RW;
RS_PORT |= RS;
E_PORT |= E;
DATA_PORT = data << 4 & 0xf0;
E_PORT &= ~E;

delay_us(47);

return;
}
/*End Of File*/
#include<jeclib.h>

#define PIN0 0x01
#define PIN1 0x02
#define PIN2 0x04
#define PIN3 0x08
#define PIN4 0x10
#define PIN5 0x20
#define PIN6 0x40
#define PIN7 0x80

#define E PIN2
#define RW PIN1
#define RS PIN0

#define E_PORT PORTE
#define RW_PORT PORTE
#define RS_PORT PORTE
#define DATA_PORT PORTB
void init_lcd_example(void);
void init_port(void);
void write_byte_dr(unsigned char data);
void gotorc(int row , int column);
void write_byte_ir(unsigned char data);
void main(void)
{
init_port();
init_lcd_example();

gotorc(0 , 3);
write_byte_dr('A');
delay_ms(600);

gotorc(0 , 10);
write_byte_dr('B');
delay_ms(600);

gotorc(1 , 6);
write_byte_dr('C');
delay_ms(600);

gotorc(1 , 15);
write_byte_dr('Z');
delay_ms(600);

while(1)
{
;/*Do Noting!!*/
}
}
void init_port(void)
{
ADCON1 = 0x07;

TRISB &= ~0xf0;
PORTB &= ~0xf0;

TRISE &= ~0x07;
PORTE &= ~0x07;
E_PORT &= ~E;

return;
}
void write_byte_dr(unsigned char data)
{
RW_PORT &= ~RW;
RS_PORT |= RS;
E_PORT |= E;
DATA_PORT = data & 0xf0;
E_PORT &= ~E;


RW_PORT &= ~RW;
RS_PORT |= RS;
E_PORT |= E;
DATA_PORT = data << 4 & 0xf0;
E_PORT &= ~E;

delay_us(47);

return;
}
void gotorc(int row , int column)
{
write_byte_ir( 0x80 | row << 6 | column );
}
void write_byte_ir(unsigned char data)
{
RW_PORT &= ~RW;
RS_PORT &= ~RS;
E_PORT |= E;
DATA_PORT = data & 0xf0;
E_PORT &= ~E;

RW_PORT &= ~RW;
RS_PORT &= ~RS;
E_PORT |= E;
DATA_PORT = data << 4 & 0xf0;
E_PORT &= ~E;

delay_us(47);

}
/*End Of File*/

ログインすると、みんなのコメントがもっと見れるよ

mixiユーザー
ログインしてコメントしよう!

ひろ☆みんを崇める会! 更新情報

ひろ☆みんを崇める会!のメンバーはこんなコミュニティにも参加しています

星印の数は、共通して参加しているメンバーが多いほど増えます。