1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

8x8をスクロールさせて遊ぶ。(電光表示板)

Last updated at Posted at 2025-05-07

いろいろい、注意

  • UNO での 予定は、未定

目的

電光表示板で8x8漢字を連続的にスクロールさせる為に必要

プログラム

オンラインコンパイラ paiza



#include <iostream>
using namespace std;

long s_buff[8];

void kanji_scroll_clr() {
    for(int i=0;i<8;i++){
        s_buff[i] = 0;
    }//for
}//kanji_scroll_clr

void kanji_scroll_set(unsigned char *font){
    
    for(int i=0;i<8;i++){
        int a;
        a = s_buff[i] & 0xff00;
        a = a | font[i];
        s_buff[i] = a;
    }//for    
}//kanji_scroll_set

void kanji_scroll_1up(unsigned char *font){
    for(int i=0;i<8;i++){
        s_buff[i] = s_buff[i] << 1;
        font[i] = s_buff[i] >> 8;
    }//for  
}//kanji_scroll_1up

void font_data_out(unsigned char *font){
    for(int i=0;i<8;i++){
        printf("[%02x]\n",font[i]);
    }//for 
    printf("\n");
}//font_data_out

int main(void){
    // Your code here!

    unsigned char font[] = {
        0b10000000,
        0b01000000,
        0b00100000,
        0b00010000,
        0b00001000,
        0b00000100,
        0b00000010,
        0b00000001
    };
    
    //font_data_out(font);
    
    kanji_scroll_clr();
    
    kanji_scroll_set(font);
    
    for(int i=0;i<8;i++){
        kanji_scroll_1up(font);
        font_data_out(font);
    }
    
}



[01]
[00]
[00]
[00]
[00]
[00]
[00]
[00]

[02]
[01]
[00]
[00]
[00]
[00]
[00]
[00]

[04]
[02]
[01]
[00]
[00]
[00]
[00]
[00]

[08]
[04]
[02]
[01]
[00]
[00]
[00]
[00]

[10]
[08]
[04]
[02]
[01]
[00]
[00]
[00]

[20]
[10]
[08]
[04]
[02]
[01]
[00]
[00]

[40]
[20]
[10]
[08]
[04]
[02]
[01]
[00]

[80]
[40]
[20]
[10]
[08]
[04]
[02]
[01]




1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?