1 | #define LED_PIN 13
|
---|
2 |
|
---|
3 | const int cldcount = 38;
|
---|
4 | void setup() {
|
---|
5 | int ledcount;
|
---|
6 | int bluec = 10;
|
---|
7 | int i = 100;
|
---|
8 | DDRF = 0xF3;
|
---|
9 | PORTF = 0xF3;
|
---|
10 | digitalWrite(A0, HIGH);
|
---|
11 | Keyboard.print("Hello Arduino");
|
---|
12 | ledcount = cldcount;
|
---|
13 | while (ledcount)
|
---|
14 | pinMode(--ledcount, OUTPUT);
|
---|
15 | while (bluec--){
|
---|
16 | ledcount = cldcount;
|
---|
17 | while (ledcount)
|
---|
18 | digitalWrite(--ledcount, HIGH);
|
---|
19 | delay(7);
|
---|
20 | ledcount = cldcount;
|
---|
21 | while (ledcount)
|
---|
22 | digitalWrite(--ledcount, LOW);
|
---|
23 | delay(3);
|
---|
24 | }
|
---|
25 | }
|
---|
26 |
|
---|
27 | void loop() {
|
---|
28 | static int kc = 0;
|
---|
29 | static int ledcount = 0;
|
---|
30 | static int togflag = 0;
|
---|
31 | if (ledcount == cldcount){
|
---|
32 | togflag ^= 1;
|
---|
33 | ledcount = 0;
|
---|
34 | }
|
---|
35 | if (kc++>50){
|
---|
36 | kc = 1;
|
---|
37 | Keyboard.print("Hello Arduino");
|
---|
38 | }
|
---|
39 | digitalWrite(ledcount++, togflag?LOW:HIGH);
|
---|
40 | delay(10);
|
---|
41 | }
|
---|
42 |
|
---|