Welcome to بیسیک فور ایکس

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

Ho3ien

سورس تشخیص نور در فضا

1 ارسال در این موضوع قرار دارد

با سلام با این کد میشه فهمید که تو فضا نور کم یا زیاد یا متوسط هست خودتون می تونید تنظیم کنید 



#Region Project Attributes
#ApplicationLabel: تشخیص نور
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region

#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region

Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.

End Sub

Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.

Dim acc As PhoneSensors


End Sub

Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("lmain")
acc.Initialize(acc.TYPE_LIGHT)



End Sub
Sub acc_SensorChanged (Values() As Float)
Select Case Values(0)
Case 50
ToastMessageShow("نور کم است",False)
Case 500
ToastMessageShow("کم",False)
Case 800
ToastMessageShow("متوسط",False)
Case 1000
ToastMessageShow("زیاد",False)
End Select

End Sub

Sub Activity_Resume
acc.StartListening("acc")

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

پسند شده توسط ali.1020، Sina و طاها الیاس زاده

به اشتراک گذاری این ارسال


لینک به ارسال
به اشتراک گذاری در سایت های دیگر