|
The function of a command like “servo1.attach(pin);” is “Set the pin number of the controller connected to the servo”.
The function of a command like “servo1.write(degrees );” is “Control how many degrees the servo rotates”.
The function of a command like “val1 = map(analogRead(0), 0, 1023, 0, 180); ” is “Map the potentiometer value from 0 to 1023 into 0 to 255.”.
The function of a command like
“ if(dataServo1>val1){dataServo1--; } if(dataServo1<val1){dataServo1++; }
if(dataServo1>180) {dataServo1=180;}
if(dataServo1<0) {dataServo1=0; }” is “Set the steering gear to rotate in units of one degree. Prevent the servo from swinging too fast to damage the servo. At the same time, set the maximum and minimum values of the rotation range of the servo”.
The function of a command like
“ if ( u8g.getMode() == U8G_MODE_R3G3B2 )
u8g.setColorIndex(255); // white
else if ( u8g.getMode() == U8G_MODE_GRAY2BIT )
u8g.setColorIndex(3); // max intensity
else if ( u8g.getMode() == U8G_MODE_BW )
u8g.setColorIndex(1); // pixel on
u8g.setFont(u8g_font_6x10);
u8g.setFontRefHeightExtendedText();
u8g.setDefaultForegroundColor();
u8g.setFontPosTop();” is “Set the initialization procedure of the OLED display”.
The function of a command like
“ EEPROM.write(addr, val1);
value1 = EEPROM.read(address);
” is “Controls reading and writing of EEPROM data in the controller”.
The function of a command like
“ itoa(number,string,10);
” is “Convert numbers to strings”.
The function of a command like
“ u8g.firstPage();
do {
u8g.drawStr(0,0,"Current state: ");
if(number==0){
u8g.drawStr(0,10," Working status ");
u8g.drawStr(0,28,"(1) (2) (3) (4) (5)");
u8g.drawStr(0,41,string1);
u8g.drawStr(27,41,string2);
u8g.drawStr(54,41,string3);
u8g.drawStr(81,41,string4);
u8g.drawStr(109,41,string5);
}else{
u8g.drawStr(0,10," Learning Status ");
u8g.drawStr(0,30,"remaining steps: ");
u8g.drawStr(110,30,string);
}
u8g.drawStr(25,54,"www.adeept.com ");
} while( u8g.nextPage() );” is “Display the data to be displayed on the OLED display”.
The function of a command like
“ moveServoData = Serial.read();
if (moveServoData == 111) {//o” is “Receive the data from the serial port, and determine whether the data is the key value "O" of the computer keyboard we need”.
If you don't understand anything, please leave a message below and I will reply as soon as possible
TOM
|
|