Go back to Product Documents Navigation
Go back to Future Board Documents Navigation
Import FutureBoard Library
Import the Library to make use of its functions.
from future import * |
02: Onboard Sensors
1. Buttons
sensor.btnValue(btn) |
Parameter btn represents A or B button, accepted values are a, b.
2. Light Sensor
sensor.getLight() |
Returns a value 0~4095.
3. Temperature Sensor
sensor.getTemp() |
Returns a degree in Celsius, FutureBoard can measure temperatures from -40 to 80 degrees.
Sample Program for 1~3
from future import * |
4. Accelerometer
sensor.accX() |
Returns the accelerometer value of the 3 axis with G as the unit.
5. Tilt Angles
sensor.roll() |
Returns the roll and pitch angle of the FutureBoard.
Sample Program for 4~5
from future import * |
6. Gesture Detection
sensor.gesture(gesture) |
8 kinds of gesture can be detected by the FutureBoard.
- ‘shake’
- ‘freefall’
- ‘tilt_up’
- ‘tilt_down’
- ‘tilt_left’
- ‘tilt_right’
- ‘face_up’
- ‘face_down’
7. Gesture Event Trigger
sensor.gesTrig[ges] = fn |
Sample Program for 6~7
from future import * |
8. Compass Calibration
calibrateCompass() |
Magnetometer and compass requires calibration before using.
9. Magnetic Strength
sensor.magX() |
Returns the magnetic strength detected by the sensor with uT as the unit.
10. Compass Bearing
sensor.heading() |
Returns the compass bearing.
Sample Program for 8~10
from future import * |
If you have any question, please feel free to contact us at Discord, we will always be there to help.
KittenBot Team