void Setup () {} void Loop () {} small light flashing void Setup () {Pinmode (2,output);} void Loop () {Digitalwrite (2,lo
W);//light delay (1000);
Digitalwrite (2,high);//Control PIN level delay (1000); /////////////////////////////////////////////////////////////////////Serial communication Void Setup () {serial.begin (9600);// Select channeling wave rate} void loop () {Serial.print ("Hello word\n");//display content delay (1000);}///////////////////////////////////////////// #define LED #define KEY 2 void Setup () {Pinmode (led,output);//define IO port as output port Pinmode (KE Y,input)//define 2 IO port for input} void loop () {} anlogread ()//Read value///////////////////////////////////////////////////////////
PWM dimming breathing lamp analog amount of discrete int ledpin = 9; int a=0,b=0; Define numeric void Setup () {} void Loop () {for (A; a<=; a++) {Analogwrite (Ledpin, a);
PWM Wave Analogwrite (Control of the pin, duty ratio (the higher the number-the greater the Energy)) delay (30);
for (int b =; b >= 0; b--) {analogwrite (ledpin,b); DeLay (30); }//////////////////////////////////////////////////////////////////////////rudder yellow signal line red Power brown ground #include <serv O.h>//Includes rudder hangar servo MYSERVO; Create a steering Gear control class int pos = 0;
Define a variable to store the steering gear rotation angle int A; void Setup () {Myservo.attach (9);///Connecting steering gear to number 9th digit port} void loop () {int value=0; while (1) {value=value+150;//reading analog value PO input from A0 port S=map (value,0,1023,0,180); The analog value 0~1023 is mapped to 0°~180°myservo.write (POS);
The steering gear rotates to the corresponding angle serial.println (value); Delay (500);
Delay the steering gear to rotate to the corresponding position if (value>=1000) {break;
}}///////////////////////////////////////////////////////Trolley 1 high 2 low 3 low 4 high forward/////////////////////////
#define Adpin A0 #difinr buzzer 2 int adbuffer=0;
void Setup () {Pinmode (buzzer,output);
Serial.begin (9600);
} void Loop () {Adbuffer=analogread (Adpin) serial.print (Adpin); }