Hi all Processing.org lovers out there,
I’m working on a project were we would like to dynamically represent physiological data through artistic visual representation, with data being measured and streamed in real-time.
To build the project step-by-step, I here only aim at update the color of background of my window (i.e., simple artistic visual representation). Since this color can by defined using a float value, I thought to update this value by reading a csv file line-by-line with physiological data (i.e., to simulate streaming of data).
I know my for-loop to work, since ‘print(color)’ is updated on each for-loop (I can see it in the console). However, can you tell me why my background color is not updated on each for-loop please ?
Thanks a lot !
Here is my code :
import csv # call for data to read filename = '/Users/yannickdaviaux/Desktop/001ZRON_PROJ_EDA' # define vizualistion window setup def setup(): size(640, 360) noSmooth() fill(126) frameRate(1000) global reader reader = csv.reader(open(filename),quoting=csv.QUOTE_NONNUMERIC) # update setup of my window def draw(): for row in reader: color = row*(-10e7) # basic data transform so I have a float between 100 and 200 --> more advanced data processing will be write later on print(color) # so I can test if loop iteration is effective in console background(color) # don't understand why color background is not update on each loop iteration