-
این خط کد یعنی چی؟
سلام این خط چی داره میگه؟ ممنون میشم مفهومی توضیح بدین...
این علامت & چیه ؟
(radio.available(&pipeNum)
کد:
byte pipeNum = 0; //variable to hold which reading pipe sent data
byte gotByte = 0; //used to store payload from transmit module
while(radio.available(&pipeNum)){ //Check if recieved data
radio.read( &gotByte, 1 ); //read one byte of data and store it in gotByte variable
Serial.print("Recieved guess from transmitter: ");
Serial.println(pipeNum); //print which pipe or transmitter this is from
Serial.print("They guess number: ");
Serial.println(gotByte); //print payload or the number the transmitter guessed
if(gotByte != daNumber) { //if true they guessed wrong
Serial.println("Fail!! Try again.");
}
else { //if this is true they guessed right
if(sendCorrectNumber(pipeNum)) Serial.println("Correct! You're done."); //if true we successfully responded
else Serial.println("Write failed"); //if true we failed responding
}
Serial.println();
}
-
سلام
وقتی شما یک متغیر ایجاد میکنید ، این متغیر در قسمتی از رم (حافظه موقت) ذخیره میشه و وقتی متغیر رو فراخوانی میکنید ، میکرو از اون قسمت حافظه ، مقدار متغیر رو فراخوانی و به شما تحویل میده .
در زبان برنامه نویسی c و ++c شما میتونید آدرس اون قسمت از حافظه که متغیر شما در اون ذخیره شده رو ببینید و اگه اول متغیر از علامت & استفاده کنید ، به جای مقدار ذخیره شده در متغیر ، ادرس حافظه ای که متغیر در اون ذخیره شده برای شما نمایش داده میشه .
SEO by vBSEO