با عرض سلام و خسته نباشید
من میخوام با استفاده از ماژول بلوتوث HC05 یه عدد چند رقمی رو دریافت کنم و بریزم توی یک متغیر
این کد رو برای سریال مانیتور استفاده میکنم
ولی مثل اینکه برای بلوتوث فرق دارهکد:while(1) { // force into a loop until 'n' is received int incomingByte = Serial.read(); if (incomingByte == '\n') break; // exit the while(1), we're done receiving if (incomingByte == -1) continue; // if no characters are in the buffer read() returns -1 redvalue *= 10; // shift left 1 decimal place // convert ASCII to integer, add, and shift left 1 decimal place redvalue = ((incomingByte - 48) + redvalue); }
پیشاپیش از جوابتون ممنونم


 LinkBack URL
 LinkBack URL About LinkBacks
 About LinkBacks 
			
			 سوال ریختن ورودی در یک متغیر
 سوال ریختن ورودی در یک متغیر
				



 
					
					
					
						 پاسخ با نقل قول
  پاسخ با نقل قول