Proton basic compiler PWM

Status
Not open for further replies.
Hello all

I am try to studying Proton Basic compiler..... Now am Stuck...

This is my code

Code:
Device = 12F675
Config INTRC_OSC_NOCLKOUT, MCLRE_OFF, WDT_OFF, PWRTE_ON,
CMCON=7
ANSEL=0
XTAL = 4
Symbol buton=GPIO.0
Symbol LED=GPIO.1

cal_1:
Low LED
If buton=0 Then GoSub abc: GoTo cal_1
GoTo cal_1:

abc:
high led
DelayMS 10000


Return

End

I need a loop when I press again when the delay time end....


Thank you
 
Last edited by a moderator:
Please don't Hijack other threads... I moved it here as It was nothing like the thread you posted it in!!!!
 
you only need a if arrangement

If switch = ON
count = 1000
while count
count = count -1
if switch = OFF count = 0​
wend​
End If
 
The code will only run once top down while wend is the main loop
Code:
Example
Var1 = 1
While Var1 <= 10
      Hrsout Dec Var1, 13
      Var1 = Var1 + 1
Wend
Code:
Example 3
If X = 10 Then
      High LED1
ElseIf X = 20 Then
      High LED2
Else
      High LED3
EndIf
Code:
Display in decimal, all the values of WordVar within an upward loop
Dim WordVar as Word
For WordVar = 0 to 2000 Step 2 ' Perform an upward loop
         HRsout Dec WordVar, 13 ' Display the value of WordVar
Next
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…