nodesign / weio

weio
http://we-io.net
128 stars 35 forks source link

rm useless potar function #275

Closed DervanM closed 8 years ago

DervanM commented 8 years ago

Potar() function does nothing in particular and calls the function sleeps, this makes the application slower, without it the color changes with more synchrony

drasko commented 8 years ago

@DervanM what do you mean by this "does nothing in particular"? From what I see this function reads a potentiometer attached to pin 25 (you have to attach it manually to your board) and based on it's analog value sets the color value, then pushes this data towards browser client (https://github.com/DervanM/weio/blob/next/examples/webApps/bgColorLEDWEB/main.py#L51).

Btw, sleeping of a potar() process does not make the program slower - every WeIO process is launched as a separate Python thread, and they work all in parallel. So, while one thread is sleeping, other things in the program are happening as usual.

DervanM commented 8 years ago

you are right, its reads a potentiometer attached on pin 25, but why do you want pushes the values of potentiometer if you also changes the values with the gyroscope of the smartphone. because this example for me shows us, how can we use the gyro for change the color of background of the http page.

when i tested this, with the potar function, the local page, are green default color, i use the gyro and that change the color to another one, good, but then green is back cause the potar function.

2016-03-21 17:35 GMT+01:00 Drasko DRASKOVIC notifications@github.com:

@DervanM https://github.com/DervanM what do you mean by this "does nothing in particular"? From what I see this function reads a potentiometer attached to pin 25 (you have to attach it manually to your board) and based on it's analog value sets the color value, then pushes this data towards browser client ( https://github.com/DervanM/weio/blob/next/examples/webApps/bgColorLEDWEB/main.py#L51 ).

Btw, sleeping of a potar() process does not make the program slower - every WeIO process is launched as a separate Python thread, and they work all in parallel. So, while one thread is sleeping, other things in the program are happening as usual.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/nodesign/weio/pull/275#issuecomment-199369424

drasko commented 8 years ago

I think that this example was made to demonstrate both client-to-server (data from phone gyro, in the form of event) and server-to-client communication (data from analog input).

I agree that this can be confusing and one can affect other in unpredictable manner.

@ukicar @ks156 @manuIO - any opinions on this?

manuio commented 8 years ago

I'm also agree that this example can be confusing. Maybe it could be better if it's divided into two different ones.

BTW the name of the example is not really understandable and it's a pity because this example is really cool! Maybe something like: gyroControlWebColor and potarControlWebColor ?

drasko commented 8 years ago

+1 for 2 separated examples.

@DervanM would you like to do the separation of the example in 2 different examples with logical names (I agree with @manuIO that name of the example is confusing)?

If yes, I would gladly accept PR

DervanM commented 8 years ago

yes i would like to do the separation,

drasko commented 8 years ago

@DervanM great! This idea looks good to me.

I will the close this PR, and will be waiting to next two PRs from you that replace this PR.