Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
- Committer:
- osw
- Date:
- 2022-04-17
- Revision:
- 0:ceca6d8ee47a
File content as of revision 0:ceca6d8ee47a:
#include "mbed.h"
DigitalOut ser(p21);
DigitalOut rclk(p22);
DigitalOut srclk(p23);
DigitalOut srclr(p24);
void a()
{
rclk=1; wait_us(10); rclk=0; wait_us(10);
}
void b()
{
srclk=1; wait_us(10); srclk=0; wait_us(10);
}
void c()
{
srclr=1; wait_us(10); srclr=0; wait_us(10);
}
int main()
{
ser=0; rclk=0; srclk=0; srclr=0;
a(); ser=1; srclr=1;
a(); ser=0; srclr=1;
while(1)
{
a(); wait_us(5);//Qa
b(); a(); wait_us(5);//Qb
b(); a(); wait_us(5);//Qc
b(); a(); wait_us(5);//Qd
b(); a(); wait_us(5);//Qe
b(); a(); wait_us(5);//Qf
b(); a(); wait_us(5);//Qg
b(); a(); wait_us(5);//Qh
b();
srclr=1;
b(); ser=1; srclr=1;
b(); ser=0; srclr=1;
}
}