Octopus Libraries Explanations
Functions Definition | Name | Methods Name | Parameter | Return Value |
---|---|---|---|---|
Setting the LEDs on and off | LED | set_led(value:1) | value: Parameter type: int Default parameter: 0 Parameter range: 0\1 | No |
Set LED brightness, brightness range (0~100), 0 means completely extinguished 100 means maximum brightness | set_led_bright(brightness:100) | brightness: Parameter type: int Default parameter: 0 Parameter range: 0~100 | No | |
Control the speed of the motor fan | Fan | set_fan(speed:100) | speed: Parameter type: int Default parameter: 100 Parameter range: 0~100 | No |
Set the angel of the 180° servo | Servo | set_servo(angle:90) | angle: parameter type: int default parameter: 90 parameter range: 0~180 | No |
Obtain ultrasonic sensor detection distance in cm | Sonar | get_distance() | No | Distance value from ultrasonic sensor to obstacle |
Get the light intensity value in lux detected by the light sensor | Light | get_lightlevel() | No | Light intensity values |
Get the temperature value detected by the temperature and humidity sensor in (°C) | DHT11 | get_temperature() | No | Return temperature value |
Get the humidity value detected by the temperature and humidity sensor in (RH) | DHT11 | get_humidity() | No | Return humidity value |
Obtain water level sensor detection value in mm | Waterlevel | get_waterlevel() | No | Return water level value |
Get the decibel value of the noise sensor in dB | Noise | get_noise() | No | Return noise value |
Get trimpot sensor values | Trimpot | get_trimpot() | No | Return trimpot sensor value |
Light up the OLED display at the specified coordinate pixel point | OLED | set_pixel(x:63, y:31) | x: Parameter type: int Default parameter: 63 Parameter range: 0~127 y: Parameter type: int Default parameter: 31 Parameter range: 0~63 | No |
Draw a line with specified start and end coordinates on the OLED display | OLED | draw_line(x1:0, y1:0, x2:127, y2:63) | x1: Parameter type: int Default parameter: 0 Parameter range: 0~127 y1: Parameter type: int Default parameter: 0 Parameter range: 0~63 x2: Parameter type: int Default parameter: 127 Parameter range: 0~127 y2: Parameter type: int Default parameter: 63 Parameter range: 0~63 | No |
Draw a circle with a specified centre and radius on the OLED display and decide whether to fill it or not depending on the parameters, 0 for no fill, 1 for fill | OLED | draw_circle(x:10, y:10, r:10, d:0) | x: Parameter type: int Default parameter: 10 Parameter range: 0~127 y: Parameter type: int Default parameter: 10 Parameter range: 0~63 r: Parameter type: int Default parameter: 10 Parameter range: 0~64 d: Parameter type: int Default parameter: :0 Parameter range: 0\1 | |
Draws a rectangle on the OLED display with specified upper left corner coordinates, width and length values and decides whether to fill it or not according to the parameters, 0 for no fill, 1 for fill | OLED | draw_rectangle(x:32, y:16, w:64, h:16, d:0) | x: Parameter type: int Default parameter: 32 Parameter range:0~127 y: Parameter type: int Default parameter: 16 Parameter range: 0~63 w: Parameter type: int Default parameter: 64 Parameter range: 0~127 h: Parameter type: int Default parameter: 16 Parameter range: 0~63 d: Parameter type: int Default parameter: 0 Parameter range: 0\1 | |
Display of input string/number/character on OLED display | OLED | set_show(s:"ELECFREAKS") | s: Parameter type: str Default parameter: "ELECFREAKS" Parameter range: Characters covered by the Unicode encoding table | |
Clear OLED displays | OLED | set_clear() | No |