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.

Problem with counter in swordfish

be80be

Well-Known Member
Code:
Dim count As Word         'symbol not expected
count = 0




While True
   ' Initialize or reset counter (optional)
   ' You can skip this if you're doing it conditionally inside the loop
   ' count = 0 

   ' Convert count to individual digits
   Number(0) = count Mod 10
   Number(1) = (count \ 10) Mod 10
   Number(2) = (count \ 100) Mod 10
   Number(3) = (count \ 1000) Mod 10

   ScanDisplay()

   DelayMS(5)
   Inc(count)

   If count = 10000 Then
      count = 0
   End If
Wend

I get error symbol not expected when i declare count as word
 
I played with swordfish and see what i do is write the code and then AI reads it makes it look good and changes stuff back you done had fixed but its really working my brain
 

Latest threads

New Articles From Microcontroller Tips

Back
Top