This is the graphics portion of a larger program I'm working on. This routine just isn't working properly. I tried to simplify it so what I have left is:
;---------------------------[ Initial setup ]--------------------------------------------------------
OpenWindow(0, 1000, 190, 320, 320, "PING plot", #PB_Window_SystemMenu)
CreateImage(0, 320, 320)
StartDrawing(WindowOutput(0))
ImageGadget(0, 0, 0, 320, 320, ImageID(0))
OpenConsole() ; Open a window to display the program status
EnableGraphicalConsole(1) ; Open graphics mode for the ConsoleLocate command below
ConsoleTitle ("Matt's - COM test program") ; Set the window title
;---------------------------[ Main program loop ]----------------------------------------------------
MAIN:
Box(0,0,320,320,RGB(0,0,0)) ;clear the screen
;---------------------------[ Input servo position ]-------------------------------------------------
If OpenConsole()
Print("Start angle? ")
SVA = Val(Input())
EndIf
x=0
buff=100
For x=SVA To SVA+100
buff=100
StartDrawing(WindowOutput(0))
Plot(160+buff*Cos(x*3.14159/180), 160+buff*Sin(x*3.14159/180), RGB(255, 255, 255))
PrintN(Str(x)+" ")
Next x
If WaitWindowEvent() = #PB_Event_CloseWindow ; If the user has pressed on the window close button
Goto endit
EndIf
Delay(2000)
ClearConsole()
Goto MAIN
;---------------------------[ Exit To system ]-------------------------------------------------------
endit:
StopDrawing()
CloseConsole()
End
What I hoped to accomplish is open a text window to print data and accept inputs. I also want a graphics window purely for plotting data real-time. I DON'T want to draw the whole screen then flip pages to view it like all the examples I'm seeing.
This stupid little program inputs a starting angle from the user on the text screen. Then it plots an arc from the starting point, plus 100 degrees, then waits.....clears the screen by drawing a black box over everything and returns to accept another input.
It sort of works. It'll plot the first arc then it flakes out. Sometimes it clears the screen, sometimes not, sometimes it will plot the second arc you enter, sometimes not..... and NEVER the third time
Help?? Please?? I'm very frustrated.


