Difference between code in REPL and in main.py

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
smssms
Posts: 12
Joined: Tue Feb 14, 2017 8:37 am

Difference between code in REPL and in main.py

Post by smssms » Mon Apr 03, 2017 8:44 pm

I am using a WiPy to read a TCS34725 colour sensor.

When I run the code as snippets from the REPL, the readings are rock solid. But when the same code is running within main.py the sensor readings are drifting (significantly and predictably).

It is a long shot, but is there any fundamental reason there might be a difference?

https://forums.adafruit.com/viewtopic.p ... 68#p573868

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: Difference between code in REPL and in main.py

Post by deshipu » Mon Apr 03, 2017 8:56 pm

I would say that timing can make a difference -- perhaps waiting longer between readings makes the sensor work better?

Post Reply