Embedded Programming

i followed again the tutorial from AS220 , and with the Mic board, tried to play with the interface a bit …

after running the make file on the Mic board, i ran it first through the command line:

cd Python27

hello.mic.45.py COM8 (the port connected)

after a nice tryout, once the original files worked fine, video simple, i tried to change the display.

instead of a wave, i tried to create a sphere in changing size and color, according to the sound.

i used the reference for TKinter (the GUI for python code, used in the original code), using the Oval widget and the colors

working in notepad++ , i changed the following

1/ added variables (color, average)

Capturevariables

 

2/ the value i am registering is an average (summing the values and dividing by number of loops)

CaptureAverage3. changing the display to the oval object as follows:
Capture_notepad code

i had a lot of problems with indentation and the proper syntax of things , for example:

CaptureIndentonce finally arranged, with a lot of trial and error i :

A. installed eclipse , as IDE

B. i managed to get some result:

Capture_46_problem

i got circles in varying sizes and colors!! but- the size was not normalised to the  size of canvas, and the rate of sampling was too dense for the computer, it kept crashing.

i tried dividing the Average variable by 2

Capture_average_halfand then by 10

Capture_average_tenthit obviously responds to changes in the code, but not yet fully controlled…

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>