python


Converting Serial data format using python


I am new to python,currently working on the project reading serial port from micro controller to capture sensor data. The serial data i received looks like this:
[5;17H 0.029[5;40H 0.736[5;63H 9.557[7;17H 0.038[7;40H 0.001 [7;63H 0.008[9;17H-34.199[9;40H 25.800[9;63H 13.799[14;17H -4.623[14;40H 0.597[14;63H218.920[19;14H
this serial data actually have escape sequence 'x1b' before open bracket. How do i get rid of them, escape sequence and text format(5;17H..) and just print sensor data x,y,z format line by line. Can somebody help me.. Thank you..
I'm using python serial code:
import serial
ser = serial.Serial('COM9', 115200, bytesize=8, timeout=0)
while True:
data = ser.read(size=8).decode("utf-8")
s = str(data)
print(data)
ser.close()
Sensor data record starts with \033, so split at this for instance:
data_list = data.split('\033')
for v in data:
print (v)

Related Links

How does exec(“dir /w”); function work in imageJ?
Scipy minimize erroring for large array of variables
can any algorithm be implemeted into hadoop streaming mapreduce work?
How to swich theano.tensor to numpy.array?
Trouble with adding pip's system environment variable
PIL fill background image repeatedly
Transform dataframe rows with lists of items into rows with pairs of items
correct way to setup teardown login logout in django
How would I get this function to display a variable?
What accounts for this huge PyMongo/sqlite3 performance disparity for a simple read query?
How do I make a deep clone of a model object in Django?
Trying to create read-only slots using metaclasses
Add Permission to Django Admin
Running Python exe from command line [closed]
nosetests unable to find requests package
How to redirect with request context to another url in Django

Categories

HOME
sass
textwatcher
ipython
paramiko
cpu-architecture
chaiscript
phaser-framework
dataframe
pca
facebook-javascript-sdk
pjsip
game-maker-studio-1.4
game-physics
automata
symfony2-easyadmin
ejs
android-toolbar
ada
internet-explorer-8
jogl
cython
tortoisegit
countif
pdfsharp
activepython
scalajs-react
hanami
chrome-native-messaging
thinking-sphinx
gzip
cortex-m3
configure
websauna
protobuf-net
strophe
idl
getline
npm-shrinkwrap
modulo
honeysql
google-guava-cache
vsts-package-management
parse-android-sdk
strstr
s3cmd
dart-pub
nsexception
homekit
3scale
automator
lirc
nsjsonserialization
tuleap
number-theory
ruby-on-rails-2
modelattribute
fedora20
ingres
objloader
nsfetchedresultscontrolle
android-navigationview
typhoon
alter
inotifypropertychanged
kendo-combobox
inet
mfc-feature-pack
yoothemes
approval-tests
anythingslider
mirrorlink
vine
ytplayerview
criteria-api
hiera
custom-url
utf-32
errorprovider
log4cplus
proxies
kraken.js
openkinect
json-patch
operations
circos
logentries
ng-hide
manage.py
shiva3d
htmltextwriter
sametime
windows-phone-7-emulator
text-services-framework
clause
inline-if

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App