Recent Posts

Pages: [1] 2 3 ... 10
1
Support / Re: Simblee getting input voltage
« Last post by Wayne on Today at 12:43:45 PM »
Hi Tolson,

Yup exactly what I'm getting..  Depends on what the simblee is doing.. My case, I read the values and lite an led if the voltage is around 2.1 volts or less (1.8 is the min for simblee) and I
send this date divided by 4 to the receiver and multiply it by 4.. So a little difference here.

I'm using Simblee Off routine.. So the current draw is 4na (confirmed when asleep) and wakes up pretty fast.
2
Support / Re: Simblee getting input voltage
« Last post by tolson on Today at 09:37:24 AM »
Has anyone fix the wide range of differences?

Hi Wayne,

Are you getting these variations. Of so, then not. If not, then so. I guess.

On a project I am using the above on, I am getting 4mV differences. All depends on battery load at moment of test.
3
Support / Reading Battery with out DC-DC converter.. (Battery use only)
« Last post by Wayne on Today at 08:08:41 AM »
Figured I asked after looking over the forum.
I have decided to drop the DC-DC converter that is used to supply the Simblee with 3.3v while on batteries...  Used it for powering LEDs etc.
But the trade off of being in ULP and the device proved that it would draw around 10ma or more in idle and goes up as the batteries sour.

So I'm now using just using batteries (2 AA's) to power the Simblee and knowing that the Simble stops around 1.8volts, I need to do a warning (LED) to have batteries replaced (2.2v or so).
The warning will be a red led on the sender (Footswitch) and on the receiver.  The receiver will store the  last condition to display if power off and on again and will update when fresh batteries are installed.

The one option I'm using is the one posted long ago.. by mkay

Quote
analogReference(VBG); // Sets the Reference to 1.2V band gap           
analogSelection(VDD_1_3_PS);  //Selects VDD with 1/3 prescaling as the analog source
int sensorValue = analogRead(1); // the pin has no meaning, it uses VDD pin
float batteryVoltage = sensorValue * (3.6 / 1023.0); // convert value to voltage
Serial.println(batteryVoltage);

But the data differs as it is reporting.

If not, I will stay with this and just trigger the LED using it.

I do like the 400na draw in Simblee OFF .. And the fast response when active.

And I see that if you have the serial connected, it causes resets..
4
Support / Re: Simblee getting input voltage
« Last post by Wayne on Today at 07:46:52 AM »
Has anyone fix the wide range of differences?

5
Simblee For Mobile / Re: SimbleeForMobile two screens
« Last post by Stanley on August 16, 2017, 10:56:13 PM »
Thank you Anderson. That worked.

Now I have another problem. When I tried to put two images and two random number on Screen 1 only, by the time I switch to Screen 2, the Simblee will crash itself. Could anyone help me?  Thanks in advance.



The following is my codes.

#include <SimbleeForMobile.h>

#include "heart6_png.h"
#include "ss_jpg.h"


int toScreen2ButtonID;
int toScreen1ButtonID;
int currentScreen;

/*
 * Traditional Arduino setup routine
 *
 * Initialize the SimbleeForMobile environment.
 */
void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  Serial.println("Setup beginning");
 
  SimbleeForMobile.deviceName = "2 Screens";
  SimbleeForMobile.advertisementData = "Sample";

  // use a shared cache
  SimbleeForMobile.domain = "twoscreens.simblee.com";
 
  // Begin Simble UI
  SimbleeForMobile.begin();
 
  randomSeed(analogRead(0));
 
  Serial.println("Setup completed");
}
uint8_t text1;
uint8_t text2;
/*
 * The traditional Arduino loop method
 *
 * Enable SimbleeForMobile functionality by calling the process method
 * each time through the loop. This method must be called regularly for
 * functionality to work.
 */

unsigned long lastUpdated = 0;
unsigned long updateRate = 500; // half a second
void loop() {
 unsigned long loopTime = millis();

   if (SimbleeForMobile.updatable && updateRate < (loopTime - lastUpdated))
  {
    lastUpdated = loopTime;
     
     int hr = random(50,80);
     char buf1[16];
     sprintf(buf1, "%d", hr);
     SimbleeForMobile.updateText(text1, buf1);

     int spo2 = random(95,100);
     char buf2[16];
     sprintf(buf2, "%d", spo2);
     SimbleeForMobile.updateText(text2, buf2);
  }
 
  SimbleeForMobile.process(); 
 
}

/*
 * Callback when a Central connects to this device
 *
 * Reset the current screen to non being displayed
 */
void SimbleeForMobile_onConnect()
{
  currentScreen = -1;
}

/*
 * Callback when a Central disconnects from this device
 *
 * Not used in this sketch. Could clean up any resources
 * no longer required.
 */
void SimbleeForMobile_onDisconnect()
{
}

/*
 * SimbleeForMobile ui callback requesting the user interface
 *
 * Check which screen is being requested.
 * If that is the current screen, simply return.
 * If it is a different screen, create the requested screen.
 * A screen request which is out of range, is logged and ignored.
 */
void ui()

  if(SimbleeForMobile.screen == currentScreen) return;
 
  currentScreen = SimbleeForMobile.screen;
  switch(SimbleeForMobile.screen)
  {
    case 1:
      createScreen1();
      break;
       
    case 2:
      createScreen2();
      break;
           
   default:
      Serial.print("ui: Uknown screen requested: ");
      Serial.println(SimbleeForMobile.screen);
  }
}

/*
 * SimbleeForMobile event callback method     
 *
 * An event we've registered for has occur. Process the event.
 * The only events of interest are EVENT_RELEASE which signify a button press.
 * If the button to open the screen not being displayed is pressed, request
 * to show that screen.
 */
void ui_event(event_t &event)
{
//  printEvent(event);
  if(event.id == toScreen1ButtonID && event.type == EVENT_RELEASE && currentScreen == 2)
  {
    SimbleeForMobile.showScreen(1);
  } else if(event.id == toScreen2ButtonID && event.type == EVENT_RELEASE && currentScreen == 1)
  {
    SimbleeForMobile.showScreen(2);
  }
}

/*
 * Create the first screen.
 
 */
void createScreen1()
{
    #define  IMAGE2  5
    #define  IMAGE3  6
 
  // Portrait mode is the default, so that isn't required
  // here, but shown for completeness. LANDSCAPE could be
  // used for that orientation.
  SimbleeForMobile.beginScreen(YELLOW, PORTRAIT);
   
  text1 = SimbleeForMobile.drawText(210, 150, "", BLUE, 45);
   
  SimbleeForMobile.imageSource(IMAGE2, PNG,  heart6_png, heart6_png_len); 
  SimbleeForMobile.drawImage(IMAGE2,110,100);
     
    if(SimbleeForMobile.remoteDeviceType == REMOTE_DEVICE_OS_IOS) {
    SimbleeForMobile.drawText(260, 175,  "BPM", BLUE, 20);
    //230,325
  } else if(SimbleeForMobile.remoteDeviceType == REMOTE_DEVICE_OS_ANDROID) {
    SimbleeForMobile.drawText(270, 248, "BPM", BLUE);
  } else if(SimbleeForMobile.remoteDeviceType == REMOTE_DEVICE_OS_UNKNOWN) {
    SimbleeForMobile.drawText(270, 248, "BPM", BLUE);
  }

 
 text2 = SimbleeForMobile.drawText(230, 300, "", BLUE, 45);
  //160 470
 
  SimbleeForMobile.imageSource(IMAGE3, JPG,  ss_jpg, ss_jpg_len); 
  SimbleeForMobile.drawImage(IMAGE3,110,270);
  //30 460

 
    if(SimbleeForMobile.remoteDeviceType == REMOTE_DEVICE_OS_IOS) {
    SimbleeForMobile.drawText(280, 305,  "%", BLUE, 40);
    //230 475
  } else if(SimbleeForMobile.remoteDeviceType == REMOTE_DEVICE_OS_ANDROID) {
    SimbleeForMobile.drawText(280, 305, "%", BLUE);
  } else if(SimbleeForMobile.remoteDeviceType == REMOTE_DEVICE_OS_UNKNOWN) {
    SimbleeForMobile.drawText(280, 305, "%", BLUE);
  }



  int textID = SimbleeForMobile.drawText(80, 60, "Screen 1", BLACK, 40);
  toScreen2ButtonID = SimbleeForMobile.drawButton(100, 200, 100, "Screen 2");

 
  SimbleeForMobile.setEvents(toScreen2ButtonID, EVENT_RELEASE);
  SimbleeForMobile.endScreen();
}

/*
 * Create the second screen.

 */
void createScreen2()
{
   

  SimbleeForMobile.beginScreen(WHITE);
 
 


  int textID = SimbleeForMobile.drawText(80, 60, "Screen 2", BLACK, 40);
  toScreen1ButtonID = SimbleeForMobile.drawButton(100, 200, 100, "Screen 1");
 

 
 

  SimbleeForMobile.setEvents(toScreen1ButtonID, EVENT_RELEASE);
  SimbleeForMobile.endScreen();
}

/*
 * Utility method to print information regarding the given event
 */
void printEvent(event_t &event)
{
  Serial.println("Event:");
  Serial.print("  ID: ");
  Serial.println(event.id);
 
  Serial.print("   Type: ");
  Serial.println(event.type); 

  Serial.print("   Value: ");
  Serial.println(event.value);
 
  Serial.print("   Text: ");
  Serial.println(event.text); 
 
  Serial.print("   Coords: ");
  Serial.print(event.x); 
  Serial.print(","); 
  Serial.println(event.y); 
}
6
Support / MIT App Inventor 2 has BLE extension
« Last post by jterry on August 15, 2017, 02:57:37 PM »
I tried using the MIT App Inventor 2, the BLE isn't officially released yet, but they let you download the beta extension to tinker around with.  I couldn't get it to see the Simblee, has anyone else tried it?

Thanks
JT
 
7
Simblee For Mobile / Re: SimbleeForMobile two screens
« Last post by Michael Anderson on August 15, 2017, 08:11:52 AM »
Hi Tolson,

Thank you for the reminding. I made a mistake that I copied wrong codes here. I have deleted the wrong ones. The problem is that, when changing to screen 2 from screen 1, the random number still displays.

Hey Stanley,
Sounds like you are looking for the function call
SimbleeForMobile.setVisible(text1,false);

In this case anytime you call draw for screen 2, you should setVisiblilty for your random number text object ID to false.
Not sure if you need to set it back to true when you draw screen 1 again, I assume the existing draw call for it will make it visible again.

I looked up this function because I did not like to stare at a white blank screen as my Simblee App spent 3-5 seconds downloading my logo image when the app is first opened up, So when screen 1 is created I do this

  int textID = SimbleeForMobile.drawText(1, 1, "Downloading Content, Please wait...", BLACK, 20);
  SimbleeForMobile.imageSource(IMAGE_1, PNG, image4535_png, image4535_png_len);
  SimbleeForMobile.drawImage(IMAGE_1, 10, 7);
  SimbleeForMobile.setVisible(textID,false);

So a downloading message appears on the screen immediately, then after the image is transferred from the Simblee device to the App (depending on size of image could take some time) the message quickly hides itself.
8
Simblee For Mobile / Re: SimbleeForMobile two screens
« Last post by Stanley on August 14, 2017, 07:28:38 PM »
Hi Tolson,

Thank you for the reminding. I made a mistake that I copied wrong codes here. I have deleted the wrong ones. The problem is that, when changing to screen 2 from screen 1, the random number still displays.
9
Simblee For Mobile / Re: SimbleeForMobile two screens
« Last post by tolson on August 14, 2017, 07:07:02 PM »
Hi Stanley,

I edited your post for you so it is better readable.

You can/should wrap your sketch between CODE flags.

As far as your code generating the image on both screens... Looks like that is what your code is saying to do. You define, initialize, and drawImage in both createScreen1 and createScreen2.
10
Simblee For Mobile / Re: SimbleeForMobile two screens
« Last post by Stanley on August 14, 2017, 06:21:59 PM »
Hi Nelson,

The following is my sketch codes. Thank you for the help.


Code: [Select]

#include <SimbleeForMobile.h>

#include "heart6_png.h"

//
// The ID of the button which displays screen 2
//
int toScreen2ButtonID;

//
// The ID of the button which displays screen 1
//
int toScreen1ButtonID;

//
// The ID of the current screen being displayed
//
int currentScreen;

/*
 * Traditional Arduino setup routine
 *
 * Initialize the SimbleeForMobile environment.
 */
void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  Serial.println("Setup beginning");
 
  SimbleeForMobile.deviceName = "2 Screens";
  SimbleeForMobile.advertisementData = "Sample";

  // use a shared cache
  SimbleeForMobile.domain = "twoscreens.simblee.com";
 
  // Begin Simble UI
  SimbleeForMobile.begin();
     randomSeed(analogRead(0));
  Serial.println("Setup completed");
}
uint8_t text1;
/*
 * The traditional Arduino loop method
 *
 * Enable SimbleeForMobile functionality by calling the process method
 * each time through the loop. This method must be called regularly for
 * functionality to work.
 */

unsigned long lastUpdated = 0;
unsigned long updateRate = 500; // half a second
void loop() {
 unsigned long loopTime = millis();

   if (SimbleeForMobile.updatable && updateRate < (loopTime - lastUpdated))
  {
    lastUpdated = loopTime;
     int hr = random(60,80);
          char buf1[16];
    sprintf(buf1, "%d", hr);
           SimbleeForMobile.updateText(text1, buf1);
  // put your main code here, to run repeatedly:
  // process must be called in the loop for Simblee UI
  }
  SimbleeForMobile.process(); 
 
}

/*
 * Callback when a Central connects to this device
 *
 * Reset the current screen to non being displayed
 */
void SimbleeForMobile_onConnect()
{
  currentScreen = -1;
}

/*
 * Callback when a Central disconnects from this device
 *
 * Not used in this sketch. Could clean up any resources
 * no longer required.
 */
void SimbleeForMobile_onDisconnect()
{
}

/*
 * SimbleeForMobile ui callback requesting the user interface
 *
 * Check which screen is being requested.
 * If that is the current screen, simply return.
 * If it is a different screen, create the requested screen.
 * A screen request which is out of range, is logged and ignored.
 */
void ui()

  if(SimbleeForMobile.screen == currentScreen) return;
 
  currentScreen = SimbleeForMobile.screen;
  switch(SimbleeForMobile.screen)
  {
    case 1:
      createScreen1();
      break;
       
    case 2:
      createScreen2();
      break;
           
   default:
      Serial.print("ui: Uknown screen requested: ");
      Serial.println(SimbleeForMobile.screen);
  }
}

/*
 * SimbleeForMobile event callback method     
 *
 * An event we've registered for has occur. Process the event.
 * The only events of interest are EVENT_RELEASE which signify a button press.
 * If the button to open the screen not being displayed is pressed, request
 * to show that screen.
 */
void ui_event(event_t &event)
{
//  printEvent(event);
  if(event.id == toScreen1ButtonID && event.type == EVENT_RELEASE && currentScreen == 2)
  {
    SimbleeForMobile.showScreen(1);
  } else if(event.id == toScreen2ButtonID && event.type == EVENT_RELEASE && currentScreen == 1)
  {
    SimbleeForMobile.showScreen(2);
  }
}

/*
 * Create the first screen.
 *
 * The screen simply consists of a label displaying the screen number
 * and a button which swaps screens. Register for events on the button
 * such that we receive notifications when it is pressed.
 */
void createScreen1()
{
    #define  IMAGE2  5
  //
  // Portrait mode is the default, so that isn't required
  // here, but shown for completeness. LANDSCAPE could be
  // used for that orientation.
  //
  SimbleeForMobile.beginScreen(YELLOW, PORTRAIT);
     text1 = SimbleeForMobile.drawText(210, 150, "", BLUE, 45);
    SimbleeForMobile.imageSource(IMAGE2, PNG,  heart6_png, heart6_png_len); 
  SimbleeForMobile.drawImage(IMAGE2,110,100);
      if(SimbleeForMobile.remoteDeviceType == REMOTE_DEVICE_OS_IOS) {
    SimbleeForMobile.drawText(260, 175,  "BPM", BLUE, 20);
    //230,325
  } else if(SimbleeForMobile.remoteDeviceType == REMOTE_DEVICE_OS_ANDROID) {
    SimbleeForMobile.drawText(270, 248, "\xc2\xb0" "C", BLUE);
  } else if(SimbleeForMobile.remoteDeviceType == REMOTE_DEVICE_OS_UNKNOWN) {
    SimbleeForMobile.drawText(270, 248, "C", BLUE);
  }

  int textID = SimbleeForMobile.drawText(80, 60, "Screen 1", BLACK, 40);
  toScreen2ButtonID = SimbleeForMobile.drawButton(100, 200, 100, "Screen 2");

  //
  // Receive notifications when a "release" occurs on the button.
  // Other event notifications are supported and can be combined in this call.
  // I.e. to receive press and release events you'd pass:
  //
  // EVENT_PRESS | EVENT_RELEASE
  //
  // into the function:
  //
  // SimbleeForMobile.setEvents(toScreen2ButtonID, EVENT_PRESS | EVENT_RELEASE);
  //
  // However, you don't want to register for events which are not required as
  // that results in extra traffic.
  //
  SimbleeForMobile.setEvents(toScreen2ButtonID, EVENT_RELEASE);
  SimbleeForMobile.endScreen();
}

/*
 * Create the second screen.
 *
 * The screen simply consists of a label displaying the screen number
 * and a button which swaps screens. Register for events on the button
 * such that we receive notifications when it is pressed.
 */
void createScreen2()
{
   
  SimbleeForMobile.beginScreen(WHITE);
 

  int textID = SimbleeForMobile.drawText(80, 60, "Screen 2", BLACK, 40);
  toScreen1ButtonID = SimbleeForMobile.drawButton(100, 200, 100, "Screen 1");

   
  SimbleeForMobile.setEvents(toScreen1ButtonID, EVENT_RELEASE);
  SimbleeForMobile.endScreen();
}

/*
 * Utility method to print information regarding the given event
 */
void printEvent(event_t &event)
{
  Serial.println("Event:");
  Serial.print("  ID: ");
  Serial.println(event.id);
 
  Serial.print("   Type: ");
  Serial.println(event.type); 

  Serial.print("   Value: ");
  Serial.println(event.value);
 
  Serial.print("   Text: ");
  Serial.println(event.text); 
 
  Serial.print("   Coords: ");
  Serial.print(event.x); 
  Serial.print(","); 
  Serial.println(event.y); 
}


Pages: [1] 2 3 ... 10
anything