rtc.irq : can't convert function to int
Posted: Mon Dec 19, 2016 7:19 am
By playing around, I try to understand more about time-interrupts.
This is my code:
==> which gives me the error message: TypeError: can't convert function to int
I am using Micropython for ESP8266 board.
This is my code:
Code: Select all
import machine
def alarm_handler(rtc_o):
print("Hello from alarm_handler")
rtc = machine.RTC()
rtc.alarm(machine.RTC.ALARM0, 10000)
rtc_i = rtc.irq(trigger=machine.RTC.ALARM0, handler=alarm_handler, wake=machine.idle)
while True:
machine.idle()
print("Hello from while-loop")
I am using Micropython for ESP8266 board.