Main siteMain site  ForumForum  ForumSearch  Private messageEmail contact  RegisterRegister  Log inLog in 
Topic: Bluetooth
Reply to topic
Author Message
GMartin



Joined: Feb 5, 2010
Posts: 206

PostPosted: Apr 19, 2018 11:55 AM    Post subject: Bluetooth

The student group I M working with has made good progress. One sticking point is in the Bluetooth connection to external device. The serial port sends out the proper date for a very brief time period They would like it to send the value until a new value arrives just sending 1 or zero how might they accomplish this. I have tried multiple things with no luck
jarek



Joined: Oct 22, 2007
Posts: 605

PostPosted: Apr 19, 2018 1:00 PM    Post subject:

I am not sure if I fully understand, but I think you want (?):
1. Send some values periodically
2. Stop sending those values when you receive a value from serial port

The #1 could be done with Timer.
The #2 with ActivityDetector. The ActivityDetector could then deactivate the Timer.
GMartin



Joined: Feb 5, 2010
Posts: 206

PostPosted: Apr 19, 2018 1:12 PM    Post subject:

Thanks

Let me clarify some.

BioEra connects via bluetooth to a pair of glasses which dim and brighten

When the value one "1" is sent the glassed do darken as wanted, but stay dark very briefly. So it seems that value is sent once and briefly when the threshold is met. but then stops. They would like the value to continue being sent until a different value "0" arrives is sent.


Stated another way

When I have used arduino, the srduino code code can be used to prolong the signal for a specified amount of time.

Is it possible for BioEra do to this.



This the last step in their project


Thanks
jarek



Joined: Oct 22, 2007
Posts: 605

PostPosted: Apr 19, 2018 1:17 PM    Post subject:

Could you use Timer element (instead of directly sending the value after threshold)?

Simply activate/deactivate it with your threshold value (or that special value you receive).
GMartin



Joined: Feb 5, 2010
Posts: 206

PostPosted: Apr 19, 2018 1:20 PM    Post subject:

Thanks I will try that

One more thing. The data is being sent to the serial port element via a scalar set I do not know if that woiuld make a difference
jarek



Joined: Oct 22, 2007
Posts: 605

PostPosted: Apr 19, 2018 1:28 PM    Post subject:

It is actually better. Serial port can only send/receive integers values per one single byte, so scalars are more compatible with that. Just make sure that there is no value scaling (you can connect Debugger to the same element which sends data to serial port to watch the values printed on console).
GMartin



Joined: Feb 5, 2010
Posts: 206

PostPosted: Apr 19, 2018 1:32 PM    Post subject:

Jarek,

Thanks so much

I have connected the timer to activity dector and that seems to send date the way I want. I will now connect to the scalar set to see what happens

Thanks so much for the quick response.
GMartin



Joined: Feb 5, 2010
Posts: 206

PostPosted: Apr 24, 2018 12:17 PM    Post subject:

Jarek,

I brought the snipped out to the students yesterday but it isstill not doing what I want.

The data from the scalar set is sent only one time. the Bluetooth device reacts to that bit of data but then reverts to its default state. I am looking for a way to send the data to the serial port in a loop so the vlaue is constantly being sent out in a stream, not just a single instance. I am working on a new idea to skip the scalar set to see if that works.
Is there a way to set the expression evaluator to send data in a loop?



Thanks


George
jarek



Joined: Oct 22, 2007
Posts: 605

PostPosted: Apr 24, 2018 12:28 PM    Post subject:

No, ExpressionEvaluator alone will not send data in a loop. You need something to trigger it.

I would probably try to use Timer. You could use it to send data directly to serial port, or as a trigger for another element (like ScalarSet or ExpressionEvaluator).
GMartin



Joined: Feb 5, 2010
Posts: 206

PostPosted: Apr 24, 2018 6:42 PM    Post subject:

Jarek

Thanks once again for the speedy reply.

I created a couple snippets, one using the scalar buffer the other an expression evaluator. I sent it off to the students. They are tasked with looking at the design to understand it then testing it with the bluetooth device.
They have to only device available so there is always a lag between development and feedback on results.

Hopefully this one will work.

George
GMartin



Joined: Feb 5, 2010
Posts: 206

PostPosted: May 4, 2018 11:09 AM    Post subject:

Jarek,


FYI

The students went a different direction with the connection issues. I suggested using an Arduino as the controller and connecting from BIoEra to the Arduino via Bluetooth. I had done a similar project several years ago could give them a little guidance.

One of the students did a lot of work digging into BioEra and modifying some of the routines I had suggested. The school group is excited about now about having access to BioSignal processing

Thanks for all the help

George
Reply to topic