5.4. API - Deprecated¶
In earlier versions of this library, all classes of the easysensors
module belonged to easygopigo3
module.
This can potentially make scripts written on a older version of this not work anymore. In order to prevent this problem, we have created dummy functions
of each class of the easysensors
module and placed them in easygopigo3
. Since these functions take the same arguments as the classes that were in previously
and because they return an object, the scripts that were built on that long-gone API still work.
We intent to support these “dummy” functions for a while before we retire them.
In summary, the classes that are now being instantiated from the easysensors
can still be instantiated from easygopigo3
for a while. These classes are:
easygopigo3.LightSensor ([port, gpg, use_mutex]) |
Use easysensors.LightSensor instead |
easygopigo3.SoundSensor ([port, gpg, use_mutex]) |
Use easysensors.SoundSensor instead |
easygopigo3.LoudnessSensor ([port, gpg, …]) |
Use easysensors.LoudnessSensor instead |
easygopigo3.UltraSonicSensor ([port, gpg, …]) |
Use easysensors.UltraSonicSensor instead |
easygopigo3.Buzzer ([port, gpg, use_mutex]) |
Use easysensors.Buzzer instead |
easygopigo3.Led ([port, gpg, use_mutex]) |
Use easysensors.Led instead |
easygopigo3.MotionSensor ([port, gpg, use_mutex]) |
Use easysensors.MotionSensor instead |
easygopigo3.ButtonSensor ([port, gpg, use_mutex]) |
Use easysensors.ButtonSensor instead |
easygopigo3.Remote ([port, gpg, use_mutex]) |
Use easysensors.Remote instead |
easygopigo3.LineFollower ([port, gpg, use_mutex]) |
Use di_sensors.easy_line_follower.EasyLineFollower instead |
easygopigo3.Servo ([port, gpg, use_mutex]) |
Use easysensors.Servo instead |
easygopigo3.DHTSensor ([gpg, sensor_type, …]) |
Use easysensors.DHTSensor instead |
The only exception is the easygopigo3.DistanceSensor()
which class no longer exists in either module.
This surrogate function has the same arguments as the other classes and the only port available to use is the "I2C"
.
If you wish to initialize an object for the Distance Sensor, a better way is just to use the DistanceSensor
class of DI-Sensors library on which this library is based upon.