girish946 / plot-cat

plot-cat is the python library for plotting live (real time) serial input.
GNU General Public License v3.0
9 stars 3 forks source link

Do we need arduino to run this code. #3

Closed singh1114 closed 8 years ago

singh1114 commented 8 years ago

I was trying to run this code on ubuntu 16.04. But wasn't able to get any output and faced some error which made me to think that we need real input from an arduino to get the required result. If no I will post the error here.

girish946 commented 8 years ago

the main intention of this project was to plot the realtime data from sensors (which is coming over serial port). but to run this code you don't need the serial port. you just have to provide the data to plotcat for plotting. this can be even random data.

for example:

#!/usr/bin/env python 
# -*- coding: utf-8 -*-
import sys
from plotcat import *
import random

p = plotter()

data = []

@p.plot_self
def setval():
  data = [random.randint(0,100) for i in range(100)]
  p.lines[0][0].set_data(p.currentAxis, data)

p.set_call_back(setval)