Hi,
I took the liberty of updating the Evothings rfduino ledon-off demo app.
I added the ability to read a characteristic and enable notifications. (It just reports the state of a counter on the rfduino).
I did this as I was figuring out how to use the rfduino and Evothings studio so there are no guarantees I did it correctly.
The code is at https://github.com/MarcGraham/evothings-rfduino .
Any feedback would be welcome as I am in learning mode with this topic.
Marc
I modified the rfduino sample app.
Re: I modified the rfduino sample app.
I've been doing some work with Evothings and RFduino in recent weeks, using it to read a load cell and display the weight on my Nexus 7. I will give your code a look over the weekend and see if you did anything differently/better than I did.
Don
[edited for spelling]
Don
[edited for spelling]
Last edited by DonPancoe on 18:04, 27 Jan 2015, edited 1 time in total.
Re: I modified the rfduino sample app.
Finally got a brief look at your github repository for the RFduino, and it reminded me that I hacked my app out of the original Arduino BLE app, which itself was based on the RedBearLabs BLE Shield, not the RFduino. I will definitely look more into your example in the coming week or so since tighter integration specifically with the RFduino might solve a number of connection quirks I've been facing.
Thanks,
Don
Thanks,
Don
Re: I modified the rfduino sample app.
Thanks for sharing, the setup shown in the photo looks really cool
Re: I modified the rfduino sample app.
Hi Guys,
I've been getting to grips with the Rfduino over the last few weeks and just stumbled upon Evothings (It looks like my saviour!).
I'm trying to get sensor data to display in realtime on an app for monitoring purposes. We'd love to connect two Rfduino's to the app so that data can be easily compared. The image above looks perfect for this but I'm unsure how to replicate something similar.
Having a mechanical engineering background and fairly new to coding could anyone provide any help or further sample code for me to study? I'd really appreciate any advice.
I've been getting to grips with the Rfduino over the last few weeks and just stumbled upon Evothings (It looks like my saviour!).
I'm trying to get sensor data to display in realtime on an app for monitoring purposes. We'd love to connect two Rfduino's to the app so that data can be easily compared. The image above looks perfect for this but I'm unsure how to replicate something similar.
Having a mechanical engineering background and fairly new to coding could anyone provide any help or further sample code for me to study? I'd really appreciate any advice.
Re: I modified the rfduino sample app.
I got pretty much everything I needed to code the RFduino from this blog post.
There are probably some other changes I don't recall but the main difference is, where the example code says...
Replace it with this...
As soon you write your latest sensor value to the BLE radio, it sends a notification to your Evothings app to read the updated value and put it into the display. Here is the code from app.js that does it in my case...
--
Don
There are probably some other changes I don't recall but the main difference is, where the example code says...
Code: Select all
Serial.begin(115200); // Arduino code for starting the serial port
Serial.println ( measure() - tare ); // Arduino code for writing a value to the serial port
Replace it with this...
Code: Select all
RFduinoBLE.begin(); // RFduino code to start the BLE radio
RFduinoBLE.sendInt(measure() - tare); // RFduino code for writing a value to the BLE radio
As soon you write your latest sensor value to the BLE radio, it sends a notification to your Evothings app to read the updated value and put it into the display. Here is the code from app.js that does it in my case...
Code: Select all
startReading: function(deviceHandle)
{
console.log('Enabling notifications');
// Turn notifications on.
app.write(
'writeDescriptor',
deviceHandle,
app.descriptorNotification,
new Uint8Array([1,0]));
// Start reading notifications.
evothings.ble.enableNotification(
deviceHandle,
app.characteristicRead,
function(data)
{
app.appendLoad([new DataView(data).getInt16(0, true)]);
},
function(errorCode)
{
console.log('enableNotification error: ' + errorCode);
});
},
appendLoad: function(load)
{
var weight = load / 14.6;
weight = Math.round( weight * 10 ) / 10;
$("#RFload").val(load);
},
--
Don
Re: I modified the rfduino sample app.
Thanks for this Don, I've been pushed onto another project for the time being but hopefully I'll be able to make some progress when I resume with your advice.
Re: I modified the rfduino sample app.
marc.graham wrote:Hi,
I took the liberty of updating the Evothings rfduino ledon-off demo app.
I added the ability to read a characteristic and enable notifications. (It just reports the state of a counter on the rfduino).
I did this as I was figuring out how to use the rfduino and Evothings studio so there are no guarantees I did it correctly.
The code is at https://github.com/MarcGraham/evothings-rfduino .
Any feedback would be welcome as I am in learning mode with this topic.
Marc
Thanks Marc,
You gave me some ideas to get over a hump I was having. I've modified further to get feedback from the RFduino for status of the LEDs to change the APP buttons accordingly and include the RFduino button status. That version is here..
http://forum.rfduino.com/index.php?topi ... 77#msg3777
-
- Posts: 1
- Joined: 12:59, 30 Jul 2015
Re: I modified the rfduino sample app.
DonPancoe wrote:I've been doing some work with Evothings and RFduino in recent weeks, using it to read a load cell and display the weight on my Nexus 7. I will give your code a look over the weekend and see if you did anything differently/better than I did.
Don
[edited for spelling]
Hi Don,
It is really interesting appication. I need something like that to start my own project. I am developing an air quality monitoring station.
It would be great having a simple app to show ambient parameter and control start and stop measurement.
If it is possible I'd like to take a look to your code
Thank you so much !
Return to “General discussion”
Who is online
Users browsing this forum: No registered users and 1 guest