[問題] 關於定義資料

看板AndroidDev作者 (儒儒)時間11年前 (2013/06/21 11:40), 編輯推噓0(002)
留言2則, 2人參與, 最新討論串1/1
void loop() { int readingLone,readingLtwo,readingLthree,readingRone,readingRtwo,readingRthree; int Lr1,Lr2,Lr3,Rr1,Rr2,Rr3; float B1,BL,A1,AL,AL1; readingLone = analogRead(sensorLone); readingLtwo = analogRead(sensorLtwo); readingLthree = analogRead(sensorLthree); readingRone = analogRead(sensorRone); readingRtwo = analogRead(sensorRtwo); readingRthree = analogRead(sensorRthree); int compare = readingLthree-readingRthree; if (compare>100) { Lr1 = (readingLone - 1013.3 )/-3.3154; Lr2 = (readingLtwo - 1022.2 )/-3.3275; Lr3 = (readingLthree - 1032.1 )/-3.4005; Rr1 = (readingRone - 1042.4 )/-3.0247; Rr2 = (readingRtwo - 1059.2 )/-3.2335; Rr3 = (readingRthree - 1070.4 )/-3.1745; B1 = (Lr1*Lr1+Lr3*Lr3-64)/(2*Lr1*Lr3); BL = acos(B1); A1 = (64+Lr1*Lr1-Lr3*Lr3)/(2*8*Lr3); AL = acos(A1); AL1 = pi*-1+AL; theta = (BL+AL1)*180/pi; myservo.write(theta); } } 想問int 或float資料定義上出了什麼問題 出現了 error: 'BL' was not declared in this scope 類似的錯誤 還有出現 error: expected constructor, destructor, or type conversion before '.' token 想問大大們哪裡寫錯了呢 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 218.164.4.94

06/21 13:07, , 1F
連行數都不給,又要隔空抓藥了嗎
06/21 13:07, 1F

06/21 15:33, , 2F
code 不照 java naming convention 寫根本不想看
06/21 15:33, 2F
文章代碼(AID): #1HmyiLOG (AndroidDev)