Skip to content

Instantly share code, notes, and snippets.

@shrddr
Created June 14, 2020 13:57
Show Gist options
  • Save shrddr/c0fad81d7a94ec0177883d40cb5c4c27 to your computer and use it in GitHub Desktop.
Save shrddr/c0fad81d7a94ec0177883d40cb5c4c27 to your computer and use it in GitHub Desktop.
# plot voltages captured by arduino ADC (AnalogReadSerial example)
# capture data with RealTerm 3.0
# use custom timestamp format: yyyy-mm-dd hh:nn:ss.zzz
import pandas as pd
df = pd.read_csv('capture.txt', names=['t','v'], parse_dates=['t'])
df['v'] = df['v'] / 1023 * 5
df['ms'] = (df['t'] - df['t'][0]).astype('timedelta64[ms]')
df.plot('ms','v')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment