Skip to content

Commit 1ffcd0e

Browse files
committed
R&E Arduino basic code
Signed-off-by: vessel <[email protected]>
0 parents  commit 1ffcd0e

File tree

21 files changed

+325
-0
lines changed

21 files changed

+325
-0
lines changed

ap/29.txt

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
�Ӻ����,filter,pwm
2+
3+
�Ӻ����
4+
����-Ưȭ�� ���-�Ӻ����
5+
����(��Ʈ)
6+
���0~255
7+
�Է�0~1023
8+
9+
pwm(�޽� �� ����)
10+
�Ƴ��α� ->������
11+
12+
filter

ap/HI/HI.ino

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
void setup() {
2+
Serial.begin(9600);
3+
int a=500;
4+
int b=600;
5+
int c= a+b;
6+
Serial.print(c);
7+
8+
}
9+
10+
void loop() {
11+
12+
13+
}

ap/Makedecision/Makedecision.ino

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
void setup() {
2+
// put your setup code here, to run once:
3+
int a=777;
4+
int b = 666;
5+
6+
if(a > b)
7+
{
8+
Serial.print("a is greater than b");
9+
}
10+
else
11+
{
12+
Serial.print("a is not greater than b");
13+
}
14+
}
15+
16+
void loop() {
17+
// put your main code here, to run repeatedly:
18+
19+
}

ap/_1105_1/_1105_1.ino

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
int p=5;
2+
3+
void setup() {
4+
// put your setup code here, to run once:
5+
for(int i=255; i>=0;i--)
6+
{
7+
analogWrite(p,i*51);
8+
delay(500);
9+
}
10+
}
11+
12+
void loop() {
13+
}

ap/_1105last/_1105last.ino

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
void setup() {
2+
pinMode(10,OUTPUT);
3+
}
4+
5+
void loop() {
6+
int a;
7+
a= analogRead(A1);
8+
analogWrite(10,a/4);
9+
10+
}

ap/a/a.ino

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
void setup() {
2+
// put your setup code here, to run once:
3+
Serial.begin(9600);
4+
}
5+
6+
void loop() {
7+
// put your main code here, to run repeatedly:
8+
if(Serial.available()){
9+
char a = Serial.read();
10+
Serial.print("a=");
11+
Serial.println(a);
12+
}
13+
}

ap/a/b

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit d343c034d19cd11309943f44227b07f07d4e8e5f

ap/a/const_int/const_int.ino

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const int startVal =1;
2+
const int endVal = 10;
3+
const int baudRate = 9600;
4+
5+
void setup() {
6+
Serial.begin(baudRate);
7+
for(int i = startVal; i<= endVal;i++)
8+
{
9+
Serial.println(i);
10+
delay(500);
11+
}
12+
Serial.println("All done!");
13+
}
14+
15+
void loop() {
16+
// put your main code here, to run repeatedly:
17+
18+
}

ap/a/first9/first9.ino

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
void setup() {
2+
Serial.begin(9600);
3+
int a,b;
4+
a=1;
5+
while(a<=9)
6+
{
7+
b=2;
8+
while(b<=9)
9+
{
10+
Serial.print("%d x %d = %-3d",b, a, a*b);
11+
b++
12+
}
13+
print("\n");
14+
a++
15+
}
16+
}
17+
18+
void loop() {
19+
// put your main code here, to run repeatedly:
20+
21+
}

ap/a/while/while.ino

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
void setup() {
2+
Serial.begin(9600);
3+
int i = 1;
4+
while (true)
5+
{
6+
Serial.println(++i);
7+
delay(500);
8+
}
9+
10+
}
11+
12+
void loop() {
13+
// put your main code here, to run repeatedly:
14+
15+
}

ap/ar_math/ar_math.ino

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
void setup()
2+
{
3+
Serial.begin(9600);
4+
5+
}
6+
7+
void loop()
8+
{
9+
10+
int a = 89;
11+
int b = 42;
12+
int c = a + b;
13+
14+
Serial.print("a + b = ");
15+
Serial.println(c);
16+
}

ap/b/b.ino

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
void setup() {
2+
3+
Serial.begin(9600);
4+
5+
}
6+
7+
void loop()
8+
{
9+
10+
if(Serial.available())
11+
{
12+
long a = Serial.parseInt();
13+
Serial.print("a=");
14+
Serial.println(a);
15+
}
16+
}

ap/boolif/boolif.ino

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
void setup() {
2+
Serial.begin(9600);
3+
float a=5.66;
4+
float b=90.23;
5+
if((a>5) && (b>100))
6+
{
7+
Serial.print("Values is big range");
8+
}
9+
10+
else if((a<5)||(b>100))
11+
{
12+
Serial.print("Value is so fucking");
13+
}
14+
15+
else
16+
{
17+
Serial.print("Value is normal range");
18+
}
19+
20+
}
21+
22+
void loop() {
23+
// put your main code here, to run repeatedly:
24+
25+
}

ap/for/for.ino

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
void setup() {
2+
// put your setup code here, to run once:
3+
Serial.begin(9600);
4+
for(int i =0;i<+5;i++){
5+
Serial.print(i);
6+
delay(1000);
7+
}
8+
}
9+
10+
void loop() {
11+
// put your main code here, to run repeatedly:
12+
13+
}

ap/for_1/for_1.ino

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
void setup() {
2+
// put your setup code here, to run once:
3+
Serial.begin(9600);
4+
for(int i=1; i<=5;i++)
5+
{
6+
Serial.print(i);
7+
delay(1000);
8+
}
9+
}
10+
11+
void loop() {
12+
// put your main code here, to run repeatedly:
13+
14+
}

ap/for_loof_10/for_loof_10.ino

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
void setup() {
2+
Serial.begin(9600);
3+
4+
for(int i=1; i<= 10; i++)
5+
{
6+
Serial.println(i);
7+
delay(1000);
8+
}
9+
Serial.println("All done!");
10+
}
11+
12+
void loop() {
13+
// put your main code here, to run repeatedly:
14+
15+
}

ap/if/if.ino

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
void setup() {
2+
// put your setup code here, to run once:
3+
int a= 5;
4+
int b= 4;
5+
6+
if(a>b)
7+
{
8+
Serial.print("a is bigger than b");
9+
}
10+
else
11+
{
12+
Serial.print("b is bigger than a");
13+
}
14+
}
15+
16+
void loop() {
17+
// put your main code here, to run repeatedly:
18+
19+
}

ap/ifif/ifif.ino

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
void setup() {
2+
Serial.begin(9600);
3+
4+
int a=55;
5+
int b=33;
6+
7+
if(a>b)
8+
{
9+
Serial.print("a is bigger than b");
10+
}
11+
else
12+
{
13+
Serial.print("a is not bigger than a");
14+
}
15+
}
16+
17+
void loop() {
18+
// put your main code here, to run repeatedly:
19+
20+
}

ap/m/m.ino

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
void setup()
2+
{
3+
Serial.begin(9600);
4+
for(int i=0;i<=9;i++)
5+
{
6+
if(i<5)
7+
{
8+
Serial.println("i is small value");
9+
}
10+
else if(5<=i<8)
11+
{
12+
Serial.println("i is not small, but i is not bigger than 8");
13+
}
14+
else
15+
{
16+
Serial.println("i is bigger than 8");
17+
}
18+
delay(500);
19+
}
20+
Serial.print("count is done");
21+
22+
}
23+
24+
void loop()
25+
{
26+
Serial.println("count num first");
27+
}

ap/moter1/moter1.ino

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
void setup() {
2+
pinMode(5,OUTPUT);
3+
pinMode(9,OUTPUT);
4+
analogWrite(5,255);
5+
analogWrite(9,255);
6+
delay(500);
7+
8+
}
9+
10+
void loop() {
11+
// put your main code here, to run repeatedly:
12+
13+
}

ap/r/r.ino

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
void setup() {
2+
Serial.begin(9600);
3+
4+
}
5+
6+
void loop() {
7+
// put your main code here, to run repeatedly:
8+
int a;
9+
a= analogRead(A1);
10+
Serial.println(a);
11+
delay(500);
12+
}

0 commit comments

Comments
 (0)