'zeit2=DateTime.Now
zeit1=DateTime.Now
Sub Process_Globals
Dim zeit1,zeit2 As Long
End Sub
Sub Globals
Dim volts As Double
Dim Timer1 As Timer
Dim Canvas1 As Canvas
Dim x,y,hx(),hy() As Int
Dim btnLED As ToggleButton
Dim Label1 As Label
Dim i As Int
Dim d As Int
Dim lastvalue As Double
Dim SeekBar1 As SeekBar
Dim Label2 As Label
Dim Panel1 As Panel
Dim Rect1 As Rect
Dim factor as Int
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Main")
Canvas1.Initialize(Panel1)
d=1000
Timer1.Initialize("Timer1", d)
lastvalue=240
Timer1.Enabled=True
i=0
Rect1.Initialize(0dip, 0dip, 800dip, 480dip)'clear display
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Timer1_Tick
label1.Text=DateTime.Now - zeit1
zeit1=DateTime.Now
draw_Oscillator
End Sub
Sub draw_Oscillator
Canvas1.DrawRect(Rect1, Colors.Black, True, 5dip)
For x=0 To 800 Step 5
volts=Sin(x/800*3*2*3.14159)
y = 180-(volts*factor)'scale for scope display scale factor=variable
canvas1.DrawLine(x-5,lastvalue,x,y,Colors.Yellow,5dip)
lastvalue=y
Next
factor=factor+1
if factor>150 then factor=1 ' limit scale factor to 150 .... and restart with 1
canvas1.DrawLine(0,180,800,180,Colors.green,5dip)
panel1.Invalidate
End Sub
Sub SeekBar1_ValueChanged (Value As Int, UserChanged As Boolean)
d=Value
Timer1.Interval=d
Label2.Text=d
End Sub
Hi Gigatron,
thanks a lot for your work. I would like to test it but I get some Java Exceptions when running on the device. Could you please export the project as zip and upload that?
Many thanks,
Jon
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?