Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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:
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.

Latest threads

Back
Top