0

I have arithmetic issues with micropython.

from microbit import *

counter = 0

while True:
    display.show('8')
    if accelerometer.was_gesture('shake'):
        display.clear()
        sleep(1000)
        counter =  counter + 1
        display.scroll(counter)
    sleep(10)

Error displayed on the LEDs: TypeError: can't convert to int

What am I missing here?

Cody Raspien
  • 1,753
  • 5
  • 26
  • 51

1 Answers1

1

Do you have access to the REPL? I would test every line on its own in REPL, this way you will now where the error is.

Alternatively delete most of the code until you have something that works, and add one line at a time. Once you have the line with the error it will be much easier to solve.

Start with this:

from microbit import *

counter = 0

while True:
    display.show('8')
    sleep(10)
Flindt
  • 196
  • 1
  • 5