It is a serial communicator(controller, receiver...), communicate with sensor LP20 which is a laser ranger.

Overview

Intro

It is a serial communicator(controller, receiver...), communicate with sensor LP20 which is a laser ranger.

Its datasheet is contained in this repo.

dir Tree

sensors
 ├── drivers
 │   ├── Crc.py
 │   ├── Laser.py
 │   ├── Serial.py
 │   └── __init__.py
 ├── LPxx-DataSheet_V0.5.pdf
 ├── main.py
 ├── readme.md
 └── stable_test.py

Usage

code

shown in both below and main.py

from drivers.Laser import *

if __name__ == '__main__':
    mylaser = MyLaserLowSpeed('COM13')
    mylaser.first_start()   # 初次启动(包含了初始化)

    '''
    读取`key`和`value`的原始数据
    '''
    print('='*20, 'focus on the raw datas')
    try:
        '''
        ·异常捕获·,也可不要. It is save to do so. Or just drop it.
        '''
        i = 0  # 计数
        for k, v in mylaser.reader():
            i += 1
            print(k, v)

            if i == 10:
                # 只测10次
                mylaser.stop()
                break
    except Exception as e:
        print(traceback.format_exc())
        raise
    except:
        mylaser.stop()  # 停止激光设备



    '''
    读取`测量状态`和`距离`数据
    '''
    print('='*20, 'focus on the distance datas')
    mylaser.start()
    try:
        '''
        ·异常捕获·,也可不要.It is save to do so. Or just drop it.
        '''
        i = 0   # 计数
        for sta, dis in mylaser.get_distance():
            i += 1
            print(f'status:{sta}', f'distance:{dis}mm')

            if i == 50:
                # 只测50次
                mylaser.stop()
                break
    except Exception as e:
        print(traceback.format_exc())
        raise
    except:
        mylaser.stop()  # 停止激光设备


    mylaser.close_port()    # 关闭串口

output

==================== focus on the raw datas
b'\x01' b'\x0e\x02\x01\t'
b'\x01' b'\x01\x02\x00\x1e'
b'\x07' b'\x00\x00\x00\xe8'
b'\x07' b'\x00\x00\x00\xf1'
b'\x07' b'\x00\x00\x00\xf1'
b'\x07' b'\x00\x00\x00\xf1'
b'\x07' b'\x00\x00\x00\xe8'
b'\x07' b'\x00\x00\x00\xe8'
b'\x07' b'\x00\x00\x00\xf8'
b'\x07' b'\x00\x00\x00\xf8'
==================== focus on the distance datas
status:0 distance:190mm
status:0 distance:174mm
status:0 distance:162mm
status:0 distance:159mm
status:0 distance:160mm
status:0 distance:160mm
status:0 distance:175mm
status:0 distance:156mm
status:0 distance:153mm
status:0 distance:153mm
status:0 distance:155mm
Fener ROS2 package version 2

Fener's ROS2 codes that runs on the vehicle. This node contains basic sensing and actuation nodes for vehicle control. Also example applications will be added.

Muhammed Sezer 1 Jan 18, 2022
ESP32 recording button presses, and serving webpage that graphs the numbers over time.

ESP32-IoT-button-graph-test ESP32 recording button presses, and serving webpage via webSockets in order to graph the responses. The objective was to t

f-caro 1 Nov 30, 2021
Code and build instructions for Snap, a simple Raspberry Pi and LED machine to show you how expensive the electricyty is at the moment

Code and build instructions for Snap, a simple Raspberry Pi and LED machine to show you how expensive the electricyty is at the moment. On row of LEDs shows the cost of the hour, the other row the co

Johan Jonk Stenström 3 Sep 08, 2022
This tool emulates an EMV-CAP device, to illustrate the article "Banque en ligne : à la decouverte d'EMV-CAP" published in MISC

About This tool emulates an EMV-CAP device, to illustrate the article "Banque en ligne : à la decouverte d'EMV-CAP" published in MISC, issue #56 and f

Philippe Teuwen 28 Nov 21, 2022
It is a serial communicator(controller, receiver...), communicate with sensor LP20 which is a laser ranger.

Intro It is a serial communicator(controller, receiver...), communicate with sensor LP20 which is a laser ranger. Its datasheet is contained in this r

3 Sep 19, 2022
Brogrammer-keyboard - FIrmware for the Brogrammer Keyboard v1.0

Brogrammer Keyboard Firmware The package contains the firmware that runs on the Brogrammer Keyboard v1.0 See https://imgur.com/a/oY5QZ14 This keyboard

Devin Hartleben 1 Apr 21, 2022
Examples to accompany the

Examples to accompany the "Raspberry Pi Pico Python SDK" book published by Raspberry Pi Trading, which forms part of the technical documentation in support of Raspberry Pi Pico and the MicroPython po

Raspberry Pi 589 Jan 08, 2023
Raspberry Pi Pico development platform for PlatformIO

Raspberry Pi Pico development platform for PlatformIO A few words in the beginning Before experimental please Reinstall the platform Version: 1.0.0 Th

Georgi Angelov 160 Dec 23, 2022
A battery pack simulation tool that uses the PyBaMM framework

Overview of liionpack liionpack takes a 1D PyBaMM model and makes it into a pack. You can either specify the configuration e.g. 16 cells in parallel a

PyBaMM Team 40 Jan 05, 2023
A LiteX project which builds a SoC with DRAM / HDIM output via the GPDI SYZYGY addon.

ButterStick GPDI LiteX demo A LiteX project which builds a SoC with DRAM / HDIM output via the GPDI SYZYGY addon. Getting started Connect GPDI board t

4 Nov 21, 2021
A custom mechanical keyboard inspired by the CFTKB Mysterium

Env-KB A custom mechanical keyboard inspired by the CFTKB Mysterium Build Guide and Parts List What is to do? Right now for the first 5 PCBs I have, i

EnviousData 203 Jan 04, 2023
Simple Weather Check base on Hefeng api, Work on raspberry Pi

Simple Weather Check base on Hefeng api, Work on raspberry Pi

Retr0mous 28 Sep 17, 2022
Example Python code for building RPi-controlled robotic systems

RPi Example Code Example Python code for building RPi-controlled robotic systems These python files have been compiled / developed by the Neurobionics

Elliott Rouse 2 Feb 04, 2022
SALUS THERMOSTAT Custom component for Home-Assistant

Home-Assistant Custom Components Custom Components for Home-Assistant (http://www.home-assistant.io) Salus Thermostat Climate Component My device is R

21 Dec 18, 2022
Terkin is a flexible data logger application for MicroPython and CPython environments.

Terkin Data logging for humans, written in MicroPython. Documentation: https://terkin.org/ Source Code: https://github.com/hiveeyes/terkin-datalogger

hiveeyes 45 Dec 15, 2022
A Python script to monitor the latest block on an LCD.

PiHole-Monitoring A Python script to monitor the latest block on a lcd display. The first number represents the dns queries from the last 24h, the sec

Maxi 4 Dec 05, 2022
🐱🖨Cat printer is a portable thermal printer sold on AliExpress for around $20.

Cat printer is a portable thermal printer sold on AliExpress for around $20. This repository contains Python code for talking to the cat printer over

671 Jan 05, 2023
ROS2 nodes for Waveshare Alphabot2-Pi mobile robot.

ROS2 for Waveshare Alphabot2-Pi This repo contains ROS2 packages for the Waveshare Alphabot2-Pi mobile robot: alphabot2: it contains the nodes used to

Michele Rizzo 2 Oct 11, 2022
Hotplugger: Real USB Port Passthrough for VFIO/QEMU!

Hotplugger: Real USB Port Passthrough for VFIO/QEMU! Welcome to Hotplugger! This app, as the name might tell you, is a combination of some scripts (py

DARKGuy (Alemar) 66 Nov 24, 2022
A simple Picobot project implemented in Python

Python-Picobot A simple Picobot project implemented in Python About Explanation This is my first programming project. Picobot use rules.txt file which

Shayan Shiravani 0 Apr 03, 2022