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.


Messages - tolson

Pages: [1] 2 3 ... 56
1
Simblee For Mobile / Re: updateRect() causes Android App to Crash
« on: July 19, 2017, 10:40:12 AM »
Since you really just wanted to change the width of the bargraph use...

SimbleeForMobile.updateW(ss, width);
I know this works.

Also, just thought, you are updating in the loop and would seem to be at a too high rate for
the SimbleeForMobile.process();

So need to scheme how to update the bargraph at a slower rate.
Could put delay(200) after the updateW, but being in the loop that slows down response to/from phone.

So best to use a update routine using millis and millisLast examples.

Don't know why SimbleForMobile.updateRect is not working so well. Perhaps way too many things to update in the loop too often.
Don't really need it since you can update just what needs to be updated. Other than that, I suggest calling RFdigital to get their attention on the matter.


2
Simblee For Mobile / Re: updateRect() causes Android App to Crash
« on: July 18, 2017, 07:58:51 PM »
I don't know. This works for me. If it works for you, perhaps you can do a diff.

Code: [Select]
#include <SimbleeForMobile.h>

uint8_t toScreen2ButtonID;

uint8_t toScreen1ButtonID;

uint8_t currentScreen;


uint8_t ss;                                                    //AK

/*
 * 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 = "2Screens";                  //AK
  SimbleeForMobile.advertisementData = "Sample";

  //SimbleeForMobile.domain = "twoscreensak.simblee.com";         //AK // You should use your own domain
 
  SimbleeForMobile.begin();
 
  Serial.println("Setup completed");
}

void loop() {
  // put your main code here, to run repeatedly:
  // process must be called in the loop for Simblee UI
  if (SimbleeForMobile.updatable && currentScreen == 1){                                   //AK
    //SimbleeForMobile.updateRect(ss, 80, 300, 150, 50);              //AK
  };                                                                 //AK
  SimbleeForMobile.process();
}

void SimbleeForMobile_onConnect()
{
  currentScreen = -1;
}

void SimbleeForMobile_onDisconnect()
{
}

void ui()
{
  if(SimbleeForMobile.screen == currentScreen) return;
 
  currentScreen = SimbleeForMobile.screen;
  switch(currentScreen)
  {
    case 1:
      createScreen1();
      break;
       
    case 2:
      createScreen2();
      break;
           
   default:
      Serial.print("ui: Unknown screen requested: ");
      Serial.println(SimbleeForMobile.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);
  }
}

void createScreen1()
{
  //
  // 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);

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

  ss = SimbleeForMobile.drawRect(80, 300, 100, 50, RED);                          //AK

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

void createScreen2()
{
  //
  // Default to Portrait orientation
  //
  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();
}

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);
}

3
Simblee For Mobile / Re: updateRect() causes Android App to Crash
« on: July 18, 2017, 02:19:58 PM »
Some minor things first...
1). The spec defines IDs as 'uint8_t'. Don't know why many examples are still using 'int' and have not been corrected, yet.
2). SimbleeForMobile.domain should use your own domain or other than Simblee.com's.

But your problem is you are trying to update/draw your bargraph when you are not in the screen it is in. Thus the crash.
So be sure to test that you are in the screen of the rectangle you are wanting to change.
  if (SimbleeForMobile.updatable && currentScreen == 1){
Also, be sure your coordinates don't overwrite other objects or go off screen. I moved yours bargraph down below the button.

Code: [Select]
void loop() {

  if (SimbleeForMobile.updatable && currentScreen == 1){
    SimbleeForMobile.updateRect(ss, 80, 300, 150, 50);
  }
  SimbleeForMobile.process();
}

4
Simblee For Mobile / Re: updateRect() causes Android App to Crash
« on: July 17, 2017, 07:57:02 PM »
I would appreciate code that I can just grab and put into the IDE. As is I have to generate a bunch that I don't know if you'd do it that way.

6
Just downloaded the OneWire library from the Github link you provided to compare just in case I had mods in my copy of the library. Looks like they are exactly identical. So here is output using the Github fresh install.

Only modification was to change
OneWire ds(10);
to
OneWire ds(2);

Here is the output to the Serial Monitor. Notice the temperature going up as I apply my finger to the ds18b20.

Code: [Select]

ROM = 10 C1 D1 6 0 0 0 C9
  Chip = DS18S20
  Data = 1 33 0 0 0 FF FF 1F 48 70  CRC=70
  Temperature = 25.50 Celsius, 77.90 Fahrenheit
No more addresses.

ROM = 10 C1 D1 6 0 0 0 C9
  Chip = DS18S20
  Data = 1 33 0 0 0 FF FF 20 48 45  CRC=45
  Temperature = 25.50 Celsius, 77.90 Fahrenheit
No more addresses.

ROM = 10 C1 D1 6 0 0 0 C9
  Chip = DS18S20
  Data = 1 33 0 0 0 FF FF 4 48 BF  CRC=BF
  Temperature = 25.50 Celsius, 77.90 Fahrenheit
No more addresses.

ROM = 10 C1 D1 6 0 0 0 C9
  Chip = DS18S20
  Data = 1 35 0 0 0 FF FF 6 48 BD  CRC=BD
  Temperature = 26.50 Celsius, 79.70 Fahrenheit
No more addresses.

ROM = 10 C1 D1 6 0 0 0 C9
  Chip = DS18S20
  Data = 1 37 0 0 0 FF FF 1F 49 3B  CRC=3B
  Temperature = 27.50 Celsius, 81.50 Fahrenheit
No more addresses.

ROM = 10 C1 D1 6 0 0 0 C9
  Chip = DS18S20
  Data = 1 38 0 0 0 FF FF 45 49 51  CRC=51
  Temperature = 28.00 Celsius, 82.40 Fahrenheit
No more addresses.

ROM = 10 C1 D1 6 0 0 0 C9
  Chip = DS18S20
  Data = 1 38 0 0 0 FF FF 28 49 82  CRC=82
  Temperature = 28.00 Celsius, 82.40 Fahrenheit
No more addresses.


ROM = 10 C1 D1 6 0 0 0 C9
  Chip = DS18S20
  Data = 1 33 0 0 0 FF FF 1F 48 70  CRC=70
  Temperature = 25.50 Celsius, 77.90 Fahrenheit
No more addresses.

ROM = 10 C1 D1 6 0 0 0 C9
  Chip = DS18S20
  Data = 1 33 0 0 0 FF FF 20 48 45  CRC=45
  Temperature = 25.50 Celsius, 77.90 Fahrenheit
No more addresses.

ROM = 10 C1 D1 6 0 0 0 C9
  Chip = DS18S20
  Data = 1 33 0 0 0 FF FF 4 48 BF  CRC=BF
  Temperature = 25.50 Celsius, 77.90 Fahrenheit
No more addresses.

ROM = 10 C1 D1 6 0 0 0 C9
  Chip = DS18S20
  Data = 1 35 0 0 0 FF FF 6 48 BD  CRC=BD
  Temperature = 26.50 Celsius, 79.70 Fahrenheit
No more addresses.

ROM = 10 C1 D1 6 0 0 0 C9
  Chip = DS18S20
  Data = 1 37 0 0 0 FF FF 1F 49 3B  CRC=3B
  Temperature = 27.50 Celsius, 81.50 Fahrenheit
No more addresses.

ROM = 10 C1 D1 6 0 0 0 C9
  Chip = DS18S20
  Data = 1 38 0 0 0 FF FF 45 49 51  CRC=51
  Temperature = 28.00 Celsius, 82.40 Fahrenheit
No more addresses.

ROM = 10 C1 D1 6 0 0 0 C9
  Chip = DS18S20
  Data = 1 38 0 0 0 FF FF 28 49 82  CRC=82
  Temperature = 28.00 Celsius, 82.40 Fahrenheit
No more addresses.



7
Don't know of any special one-wire library. But this script I used to test the 18B20 uses the 2.3.3 onewire library and it is still working with Arduino 1.8.1 and RFduino library 2.3.3.

I am using RFduino Pin2. The VCC for the 18B20 is the RFduino 3V pin. There is a 4.7K ohm from pin2 to the RFduino 3V pin. Do not use 5V  with RFduino.

Code: [Select]
#include <OneWire.h>
#include <RFduinoBLE.h>

// OneWire DS18S20, DS18B20, DS1822 Temperature Example
//
// http://www.pjrc.com/teensy/td_libs_OneWire.html
//
// The DallasTemperature library can do all this work for you!
// http://milesburton.com/Dallas_Temperature_Control_Library
// Thomas Olson Modified to send data via RFduino BLE.

OneWire  ds(2);  // on pin 10 (a 4.7K resistor is necessary)

void setup(void) {
 // Serial.begin(9600);
    RFduinoBLE.advertisementData = "temp";
    RFduinoBLE.deviceName = "DS18B20";
  // start the BLE stack
  RFduinoBLE.begin();
}

void loop(void) {
  byte i;
  byte present = 0;
  byte type_s;
  byte data[12];
  byte addr[8];
  float celsius, fahrenheit;
 
  if ( !ds.search(addr)) {
  //  Serial.println("No more addresses.");
   // Serial.println();
    ds.reset_search();
    delay(250);
    return;
  }
 
  Serial.print("ROM =");
  for( i = 0; i < 8; i++) {
    Serial.write(' ');
    Serial.print(addr[i], HEX);
  }

  if (OneWire::crc8(addr, 7) != addr[7]) {
      Serial.println("CRC is not valid!");
      return;
  }
  Serial.println();
 
  // the first ROM byte indicates which chip
  switch (addr[0]) {
    case 0x10:
      Serial.println("  Chip = DS18S20");  // or old DS1820
      type_s = 1;
      break;
    case 0x28:
      Serial.println("  Chip = DS18B20");
      type_s = 0;
      break;
    case 0x22:
      Serial.println("  Chip = DS1822");
      type_s = 0;
      break;
    default:
      Serial.println("Device is not a DS18x20 family device.");
      return;
  }

  ds.reset();
  ds.select(addr);
  ds.write(0x44, 1);        // start conversion, with parasite power on at the end
 
  delay(1000);     // maybe 750ms is enough, maybe not
  // we might do a ds.depower() here, but the reset will take care of it.
 
  present = ds.reset();
  ds.select(addr);   
  ds.write(0xBE);         // Read Scratchpad

 // Serial.print("  Data = ");
 // Serial.print(present, HEX);
 // Serial.print(" ");
  for ( i = 0; i < 9; i++) {           // we need 9 bytes
    data[i] = ds.read();
  //  Serial.print(data[i], HEX);
   // Serial.print(" ");
  }
//  Serial.print(" CRC=");
 // Serial.print(OneWire::crc8(data, 8), HEX);
 // Serial.println();

  // Convert the data to actual temperature
  // because the result is a 16 bit signed integer, it should
  // be stored to an "int16_t" type, which is always 16 bits
  // even when compiled on a 32 bit processor.
  int16_t raw = (data[1] << 8) | data[0];
  if (type_s) {
    raw = raw << 3; // 9 bit resolution default
    if (data[7] == 0x10) {
      // "count remain" gives full 12 bit resolution
      raw = (raw & 0xFFF0) + 12 - data[6];
    }
  } else {
    byte cfg = (data[4] & 0x60);
    // at lower res, the low bits are undefined, so let's zero them
    if (cfg == 0x00) raw = raw & ~7;  // 9 bit resolution, 93.75 ms
    else if (cfg == 0x20) raw = raw & ~3; // 10 bit res, 187.5 ms
    else if (cfg == 0x40) raw = raw & ~1; // 11 bit res, 375 ms
    //// default is 12 bit resolution, 750 ms conversion time
  }
  celsius = (float)raw / 16.0;
  fahrenheit = celsius * 1.8 + 32.0;
  /*Serial.print("  Temperature = ");
  Serial.print(celsius);
  Serial.print(" Celsius, ");
  Serial.print(fahrenheit);
  Serial.println(" Fahrenheit");
  */
    RFduinoBLE.sendFloat(celsius);
}

8
Simblee For Mobile / Re: updateRect() causes Android App to Crash
« on: July 17, 2017, 03:28:02 PM »
Need more info. Can't tell what you are doing with just those calls. So have to guess. For example if your ssWidth is mean to be the width of you bar indicator(assuming you are using the rectangle as a bar graph. Then perhaps you have it in the wrong location. The fifth field is the height of the rectangle. The forth field is the width of the rectangle. So, I don't, perhaps you are exceeding the range. Just guessing. How about posting a complet sketch that should work if the two lines worked. In other words, don't need the whole project... Just a test script to get just this part your project tested out.

9
Simblee Libraries / Re: Simblee COM Send and Receive
« on: June 12, 2017, 09:30:18 AM »
The _onReceive functions are interrupt callbacks. Get in and get out! You can't have 1 second delays and large print statements. Just set some variable and/or flags in the _onReceive function and then deal with those in the main loop.

10
Hi Patty,

I think what they are asking for is a CHANGELOG of specific changes relating specifically to the Simblee Library and SimbleeForMobile Library.

The libraries you are referring to are external peripheral libraries. That is like referring to adafruit or sparkfun libraries for various devices. But have nothing to do with the Simblee itself library.

Simblee For Mobile library specific changes and enhancements require the mating SFM Smart Device APP to go with it; which is way over due.


11
Yes, a list of changes and new features is what is desired.
I am still waiting on line drawing in Simblee For Mobile.
And access to the smart device sensors so I don't have to duplicate that hardware on my Simblee For Mobile products.

12
Simblee For Mobile / Re: SimbleeForMobile and its mobile application
« on: June 01, 2017, 12:45:35 AM »
I wish! I had aspirations of doing various EMG products. But Simblee for Mobile library does not supply any line drawing graphics, nor access to smart phone sensors.

SO, you will have to write native iOS and Android apps that can do that stuff and then just use Simblee BLE like RFduino BLE or any other BLE.


13
Support / Re: hand soldering Simblee module?
« on: May 23, 2017, 11:43:02 AM »
I know this is an old topic however I just wanted to share my own experience with other users.

Actually, I for one appreciate when new info is added to old topics as long as it is related to the topic at hand.

14
Patty,

They want the SFM APPS to work first. Asking what more sensors is futile as the ones people responded to the same question for the RFduino several years ago still haven't seen the light of day for the most part.

15
Check out the new shields and kits -

Time of Flight (ToF)
Indoor Air Quality (IAQ VoC)
Color, Proximity
Temperature & Humidity

https://www.youtube.com/playlist?list=PLJKNqIEHkJebPFseRFDwgZ6Nju2rKVGFW

This kits come programmed out of the box, just insert batteries, stack the Simblee breakout board and sensor shield and you can start visualizing sensor data on your mobile device through the Simblee app.    From here, follow our Cloud videos, and program your Simblee to transmit to the Cloud.

https://www.youtube.com/playlist?list=PLJKNqIEHkJebMpso_196RneEfcLKPNrZm

New library update should drop in 1-2 weeks and products are on their way to distributors next week.

Hi Patty,

People want the libraries and SFM APP fixed before wanting more hardware peripherals. The documentation, website, and APPs all need updated.

Pages: [1] 2 3 ... 56