Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - tolson

Pages: [1] 2
1
Simblee For Mobile / Accessing Smart Phone sensors with SFM needed.
« on: March 13, 2017, 05:06:15 PM »
Any brainiacs out there that can figure a way to write a library that can access smart device sensors from Simblee For Mobile (SFM).

I have several Simblee For Mobile applications that require the location of the smart phone connected to the Simblee via SFM. It's a shame that we would have to attach a GPS chip to the Simblee chip so that our smart phone knows where it is, when smart phones already have these services.




2
Bugs / required SimbleeForMobile configuration
« on: October 26, 2016, 12:30:05 AM »
Has anybody gotten this ALERT popup when using SimbleeForMobile?
If so, under what conditions?


3
Interesting Uses & Applications / Simblee to NFC Adaptor
« on: September 26, 2016, 05:01:00 PM »
I needed a NFC (ISO 15693) to BLE converter. I started out using a ST Micro NFC chip CR95HF. But I didn't have appropriate lab equipment to match an NFC antenna adaquately. So, I found that Solutions Cube had a reasonably priced and very small NFC module (BM019) that used the same chip. So as typical with my projects, I adapted to it.
My board incude the Simblee SOC, USB LiPO charger(100mA), and CP2102N USB to Serial for programming/debugging the Simblee. When connected to USB, the Battery is isolated from the load so as not to confuse the charger circuitry.

This makes for a fun combination to experiment with Simble For Mobile and Simble For Cloud applications.







http://thomasolson.com/PROJECTS/BLE/Simblee/SFMnfc/

4
Videos/Guides/Tutorials / Documentation - Simblee Concepts
« on: September 20, 2016, 10:01:22 AM »
Sparkfun has a pretty good description of Simblee Concepts...

https://learn.sparkfun.com/tutorials/simblee-concepts/all

5
Here is my test socket I use to program the Simblee RFD77101 LGA module.
I just hold the part down into the cavity with my finger for the few seconds it takes to upload the sketches.
I'm looking for miniature clothespin for clamping.

http://thomasolson.com/PROJECTS/BLE/Simblee/SFMsocket/



For RFduino RFD22301 Test Socket see...
http://forum.rfduino.com/index.php?topic=418.0

6
Videos/Guides/Tutorials / Simblee For Mobile - BLE MIDI (SFMmidi)
« on: April 20, 2016, 06:43:19 PM »
Using the Simblee LGA package (RFD77101) I am able to build a MIDI OUT to BLE in a DIN plug.  Using Simblee For Mobile I can receive standard MIDI note with velocity packets from the DIN MIDI OUT jack, process the packets, and display their activity on a Smart Device.

<a href="http://www.youtube.com/v/SyyrlX4Rgmc" target="_blank" class="new_win">http://www.youtube.com/v/SyyrlX4Rgmc</a>


More information as it the project develops at http://thomasolson.com/PROJECTS/MIDI/BLE_MIDI/

7
If you don't mind including an all encompassing complicated pixel library in your memory map just to drive a neopixel string or ring, give FastLED 3.1 a go. For me it works pretty good on Simblee and RFduino with the latest Arduino IDEs...1.6.7, 1.6.8.

It even seems to work pretty good while the Simblee or RFduino Radio is turned on. That's nice!

Here is a sketch I modified to compile with the Radio turned on. You can compile for RFduino or Simblee.

Code: [Select]
// Fire2012Simblee using FastLED 3.1 and Fire2012
// Modified by Thomas Olson
// teo20151222.01 Testing if conflicts with Simblee Radio on
// Modified for compiling on Simblee and RFduino - IDE 1.6.7
// teo20160328.01 verified works with Arduino IDE 1.6.8


#if defined(RFDUINO)
 #include <RFduinoBLE.h>
 #define RFD RFduinoBLE
#elif defined(SIMBLEE)
 #include <SimbleeBLE.h>
 #define RFD SimbleeBLE
#endif

#include <FastLED.h>

#define LED_PIN     6
#define COLOR_ORDER GRB
#define CHIPSET     WS2811
#define NUM_LEDS    24

#define BRIGHTNESS  200
#define FRAMES_PER_SECOND 60

bool gReverseDirection = false;

CRGB leds[NUM_LEDS];

void setup() {
  delay(3000); // sanity delay
  FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );
  FastLED.setBrightness( BRIGHTNESS );

  RFD.begin();
}

void loop()
{
  // Add entropy to random number generator; we use a lot of it.
  // random16_add_entropy( random());

  Fire2012(); // run simulation frame
 
  FastLED.show(); // display this frame
  FastLED.delay(1000 / FRAMES_PER_SECOND);
}


// Fire2012 by Mark Kriegsman, July 2012
// as part of "Five Elements" shown here: http://youtu.be/knWiGsmgycY
////
// This basic one-dimensional 'fire' simulation works roughly as follows:
// There's a underlying array of 'heat' cells, that model the temperature
// at each point along the line.  Every cycle through the simulation,
// four steps are performed:
//  1) All cells cool down a little bit, losing heat to the air
//  2) The heat from each cell drifts 'up' and diffuses a little
//  3) Sometimes randomly new 'sparks' of heat are added at the bottom
//  4) The heat from each cell is rendered as a color into the leds array
//     The heat-to-color mapping uses a black-body radiation approximation.
//
// Temperature is in arbitrary units from 0 (cold black) to 255 (white hot).
//
// This simulation scales it self a bit depending on NUM_LEDS; it should look
// "OK" on anywhere from 20 to 100 LEDs without too much tweaking.
//
// I recommend running this simulation at anywhere from 30-100 frames per second,
// meaning an interframe delay of about 10-35 milliseconds.
//
// Looks best on a high-density LED setup (60+ pixels/meter).
//
//
// There are two main parameters you can play with to control the look and
// feel of your fire: COOLING (used in step 1 above), and SPARKING (used
// in step 3 above).
//
// COOLING: How much does the air cool as it rises?
// Less cooling = taller flames.  More cooling = shorter flames.
// Default 50, suggested range 20-100
#define COOLING  55

// SPARKING: What chance (out of 255) is there that a new spark will be lit?
// Higher chance = more roaring fire.  Lower chance = more flickery fire.
// Default 120, suggested range 50-200.
#define SPARKING 120


void Fire2012()
{
// Array of temperature readings at each simulation cell
  static byte heat[NUM_LEDS];

  // Step 1.  Cool down every cell a little
    for( int i = 0; i < NUM_LEDS; i++) {
      heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / NUM_LEDS) + 2));
    }
 
    // Step 2.  Heat from each cell drifts 'up' and diffuses a little
    for( int k= NUM_LEDS - 1; k >= 2; k--) {
      heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;
    }
   
    // Step 3.  Randomly ignite new 'sparks' of heat near the bottom
    if( random8() < SPARKING ) {
      int y = random8(7);
      heat[y] = qadd8( heat[y], random8(160,255) );
    }

    // Step 4.  Map from heat cells to LED colors
    for( int j = 0; j < NUM_LEDS; j++) {
      CRGB color = HeatColor( heat[j]);
      int pixelnumber;
      if( gReverseDirection ) {
        pixelnumber = (NUM_LEDS-1) - j;
      } else {
        pixelnumber = j;
      }
      leds[pixelnumber] = color;
    }
}


8
Simblee For Mobile / Simblee For Mobile - KeyPAD example
« on: March 22, 2016, 07:25:52 PM »
Here is code example using Simblee for Mobile to generate a KeyPAD App.



http://thomasolson.com/PROJECTS/BLE/Simblee/SFM_KeyPAD/

9
This demo of the Simblee for Mobile feature sends the UI and graphics to the mobile device via BLE. Then the Simblee sends the CPU temperature via BLE to the mobile device to be displayed on the dial gage. When the switch is toggled the Simblee is instructed to cycle through fake temperatures to see how the gage responds.


<a href="http://www.youtube.com/v/XhaK3MwH904" target="_blank" class="new_win">http://www.youtube.com/v/XhaK3MwH904</a>

Example Code to do this is at http://thomasolson.com/PROJECTS/BLE/Simblee/DialSFM/

10
iOS / iOS & Android ColorWheel Demo using Evothings
« on: December 10, 2015, 09:42:44 PM »
This is an example of using Evothings / Cordova to make a generic App that runs on both iOS and Android.
This demo uses the standard RFduino Colorwheel sketch from the examples folder. It should work with any sketch based on the RGB intensities on the first three bytes of the payload.

The first half of the video is using a iPod Touch. The second half is using a Android Nexus 7 (2013).

<a href="http://www.youtube.com/v/P9Dle6k4ato" target="_blank" class="new_win">http://www.youtube.com/v/P9Dle6k4ato</a>



11
Finally figured out how to get Invensense MPU TeaPot Quaternion packet displayed on Android and iOS using EVOthings, HTML5, and javascript libraries.  No need for Processing over Serial port anymore. Hope to do similar with Simblee. The javascript library phoria.js, a 3D graphics engine, by Kevin Roast was helpful .

<a href="http://www.youtube.com/v/y4X1dBk_VMU" target="_blank" class="new_win">http://www.youtube.com/v/y4X1dBk_VMU</a>

http://forum.rfduino.com/index.php?topic=734.0
http://forum.rfduino.com/index.php?topic=373.0

13
Now with EVOthings client I am able to get Temperature, Humidity, and Barometric pressure displayed on my Android device AND my neighbors iPhone with little effort with the same APP. Too Cool! Just install EVOthings Client from the respective app store and then fill in the "Connect with Address" box with my URL. Voila. I'm using the Si7021 Humidity Sensor and BMP 180 Barometric Pressure Sensors. The RFDweather Shield plugs into the standard RFduino Shield system. The smaller RFDWeatherWear Station includes the RFD22301 SMD module and  runs off a CR1220 battery. Well, that was the plan. I need to work more on the ultra low power modes of the sensors. CR1220 works pretty well in "beacon only" mode for well over 2 months. But with extra sensors, care must be given to make sure they are turned off deeply. Here is what they look like.





In this demonstration I am packing three floating point numbers into the BLE packet and displaying them with gauges on the Smart Device. That only uses 12 bytes. I am sending a forth empty floating point number and that is why you see the packet length is 16. I am reserving that for the battery voltage. With a maximum payload of 20 bytes this leaves 4 bytes that could be used for sensor status flags and / or feedback buttons, etc.

Here is the video.

<a href="http://www.youtube.com/v/fEHElyJOtF4" target="_blank" class="new_win">http://www.youtube.com/v/fEHElyJOtF4</a>


14
Videos/Guides/Tutorials / Hand Soldering RFD22301 to custom board
« on: March 18, 2015, 07:24:04 PM »
Here is a little video I put together on how to hand solder the RFDuino SMD RFD22301 to your own custom board.

<a href="http://www.youtube.com/v/i_HlTUB00aI" target="_blank" class="new_win">http://www.youtube.com/v/i_HlTUB00aI</a>

15
Interesting Uses and Applications / EVOthings Example RGB code
« on: March 04, 2015, 02:39:07 AM »
The EVOthings project has some support for the RFduino BLE now. Here is a simple example turning the RGB LEDs on and off using the standard RGB shield. The HTML/javascript has 7 HTML buttons. One is used to connect to the RFduino. Seems to take a long time for the connection to take place. The other six buttons labeled button1 through button6 will turn the LEDs on or off.

RFduino Sketch..

Code: [Select]
// Testing EVOthings
// Thomas Olson
// teo20150303.02

#include <RFduinoBLE.h>

#define LED_RED 2
#define LED_GREEN 3
#define LED_BLUE 4
#define ButtonA 5
#define ButtonB 6

char buf[20] = {};

void setup()
{
  Serial.begin(9600);
  Serial.println("EVOthings Testing");

  pinMode(LED_RED, OUTPUT);
  pinMode(LED_GREEN, OUTPUT);
  pinMode(LED_BLUE, OUTPUT);
  pinMode(ButtonA, INPUT);
  pinMode(ButtonB, INPUT);

  digitalWrite(LED_RED, LOW);
  digitalWrite(LED_GREEN, LOW);
  digitalWrite(LED_BLUE, LOW);
 

  RFduinoBLE.begin();
}


void loop()
{
  buf[0] = (unsigned byte)readButtons();

  // Eventhough I send the whole 20 byte packet one is all that
  // is used by this APP.
  RFduinoBLE.send(buf,20); //For this APP really only need sent 1.
  RFduino_ULPDelay(100);
}


void RFduinoBLE_onConnect()
{
  Serial.println("RFduino BLE connected");
}

void RFduinoBLE_onDisconnect()
{
  Serial.println("RFduino BLE disconnected");
  // don't leave the leds on after disconnection
  digitalWrite(LED_RED, LOW);
  digitalWrite(LED_GREEN, LOW);
  digitalWrite(LED_BLUE, LOW);
}

void RFduinoBLE_onReceive(char *data, int len)
{
  // Print the value receieved in first byte of packet. This APP only
  // expecting to see one byte encoded with the LED ON/OFF commands.
  Serial.print("DATA[0]: ");
  Serial.println(data[0],HEX);

  switch(data[0]){
    case 1:
      analogWrite(LED_RED,0x2c); // Brightness of LED
      break;
    case 2:
      analogWrite(LED_RED,0x00); // Brightness to OFF
      break;     
    case 3:
      analogWrite(LED_GREEN,0x2c);
      break;
    case 4:
      analogWrite(LED_GREEN,0x00);
      break;
    case 5:
      analogWrite(LED_BLUE,0x2c);
      break; 
    case 6:
      analogWrite(LED_BLUE,0x00);
      break;
    default:
      break;
  }

}

/*
In this example the RGB Button shield buttons are encoded
into first byte of send packet.
0x01 is button A
0x02 is button B
0x03 is both buttons
*/

int readButtons(){
int btnA, btnB, btnAB;

  btnA = digitalRead(ButtonA); 
  btnB = digitalRead(ButtonB);

  btnAB = 0x00;
  if(btnA) btnAB = 0x01;
  if(btnB) btnAB = btnAB | 0x02;
  return btnAB;
}


HTML code...

Code: [Select]
<!DOCTYPE html>
<html>
<!--
This is an example app that demonstrates how to control an
RFduino RFD22102 board using BLE (Bluetooth Low Energy).

Please note that this example requires an RFduino RFD22102 plus
and RFduino RGB LED Button shield (RFD22122). In addition, an
RFduino USB shield (RFD22121) is needed for programming the
RFduino from a PC or Mac.
-->
<head>

        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, user-scalable=no
                initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />

        <title>RFduino LED On/Off</title>

        <style>
                @import 'ui/css/evothings-app.css';
        </style>

        <style>
        div {
                margin: 10px 0px;
        }
        button {
                margin: 5px 0px;                                                               
        }                                                                                       
        .lead {                                                                                 
                font-weight: bold;                                                             
        }                                                                                       
        </style>                                                                               
                                                                                               
        <script>                                                                               
        // Redirect console.log to Evothings Workbench.                                         
        if (window.hyper && window.hyper.log) { console.log = hyper.log }                       
        </script>                                                                               
                                                                                               
        <script src="cordova.js"></script>                                                     
        <script src="libs/jquery/jquery.js"></script>                                           
        <script src="libs/evothings/evothings.js"></script>                                     
        <script src="libs/evothings/rfduinoble/rfduinoble.js"></script>                         

</head>

<body>

        <header>
                <button class="back" onclick="history.back()">
                        <img src="ui/images/arrow-left.svg" />
                </button>

                <img class="logotype" src="ui/images/logo.svg" alt="Evothings" />

                <!--<button class="menu" onclick=""><img src="ui/images/menu.svg" /></button>-->
        </header>

        <h1>RFduino LED On/Off</h1>

        <p id="info" class="lead">Initializing...</p>

        <button type="button" class="yellow" onclick="app.connect()">
                Connect
        </button>

        <br />

        <button type="button" class="red" onclick="app.button1()">
                Button 1
        </button>

        <button type="button" class="charcoal" onclick="app.button2()">
                Button 2
        </button>

        <button type="button" class="green" onclick="app.button3()">
                Button 3
        </button>

        <button type="button" class="charcoal" onclick="app.button4()">
                Button 4
        </button>

        <button type="button" class="blue" onclick="app.button5()">
                Button 5
        </button>

        <button type="button" class="charcoal" onclick="app.button6()">
                Button 6
        </button>

        <h2>Instructions</h2>
        <p>This example requires a RFduino RFD22102 and an RFduino RGB
        LED Button shield (RFD22122). You also need an RFduino USB shield
        for programming the RFduino from a PC/Mac.</p>

        <!-- TODO: Image is missing.
        <p><img src="RFduino_Image.png" style="max-height:30%;" /></p>
        -->

        <!-- JavaScript code for the app -->

        <script>
        // Short name for RFduino BLE library.
        var rfduinoble = evothings.rfduinoble;

        // Application object.
        var app = {};

        // Connected device.
        app.device = null;

        app.button1 = function()
        {
                app.device && app.device.writeDataArray(new Uint8Array([1]));
        };

        app.button2 = function()
        {
                app.device && app.device.writeDataArray(new Uint8Array([2]));
        };

        app.button3 = function()
        {
                app.device && app.device.writeDataArray(new Uint8Array([3]));
        }

        app.button4 = function()
        {
                app.device && app.device.writeDataArray(new Uint8Array([4]));
        };

        app.button5 = function()
        {
                app.device && app.device.writeDataArray(new Uint8Array([5]));
        };

        app.button6 = function()
        {
                app.device && app.device.writeDataArray(new Uint8Array([6]));
        }


        app.showMessage = function(info)
        {
                document.getElementById("info").innerHTML = info;
        };

        // Called when BLE and other native functions are available.
        app.onDeviceReady = function()
        {
                app.showMessage('Press the yellow button to connect');
        };

        app.connect = function()
        {
                console.log("close");
                rfduinoble.close();

                // Wait 500 ms for close to complete before connecting.
                setTimeout(function()
                {
                        console.log("connecting");
                        app.showMessage("Connecting...");
                        rfduinoble.connect(
                                "RFduino",
                                function(device)
                                {
                                        console.log("connected");
                                        app.showMessage("Connected");
                                        app.device = device;
                                },
                                function(errorCode)
                                {
                                        app.showMessage("Connect error: " + errorCode);
                                });
                        },
                        500);
        };

        // When the app is fully loaded the "deviceready" event is triggered.
        document.addEventListener("deviceready", app.onDeviceReady, false);
        </script>
</body>
</html>


Pages: [1] 2