發表文章

目前顯示的是 5月, 2022的文章

官方板, 3 595 run num , same

//arduino d1 , esp8266 generic   int latchPin = 5;//st_cp pin 12 int clockPin = 16;//sh_cp pin 11 int dataPin = 4; #define uc unsigned char  uc table[]={~0x01,0x0a,~0X68,~0xE0,~0xB4,~0xA2,~0x02,~0x91,~0x00,~0xa0,~0x40,~0x00}; void setup()  {     pinMode(latchPin, OUTPUT);     pinMode(clockPin, OUTPUT);     pinMode(dataPin, OUTPUT);     Serial.begin(9600); }   void loop() {     uc n[8];     long t;     uc q[]={3,2,1,0,7,6,5,4};     fix_tab();       while(1){       for(int j=0;j<9999;j++){ //        n[7]=(j/10000000)%10; //        n[6]=(j/1000000)%10; //        n[5]=(j/100000)%10; //        n[4]=(j/10000)%10;         n[3]=(j/1000)%10;         n[2]=(j/100)%10;         n[1]=(j/10)%10;         ...

官方, 3個595, 第3個是開關

官方, 3個595, 第3個是開關 最遠, 次遠, 最近, 先送次序。 左, 顯示那支腳,  右, 數字  int latchPin = 5;//st_cp pin 12 int clockPin = 16;//sh_cp pin 11 int dataPin = 4; #define uc unsigned char  uc table[10]; void setup()  {     pinMode(latchPin, OUTPUT);     pinMode(clockPin, OUTPUT);     pinMode(dataPin, OUTPUT); }   void loop() {   fix_tab();     while(1){     for(int j=0;j<10;j++){       digitalWrite(latchPin, LOW);// shift out the bits:       shiftOut(dataPin, clockPin, MSBFIRST, 0);//最遠       shiftOut(dataPin, clockPin, MSBFIRST, table[j]);//次遠       shiftOut(dataPin, clockPin, MSBFIRST, ~(1<<(j%8)));//最近       digitalWrite(latchPin, HIGH);// pause before next value:       delay(1000);     }   } } void fix_tab() {   uc i;   for(i=0;i<10;i++){ table[i]=0; }   table[0]=~((1<<2)|(1<<0)|(1...