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 ... 57
1
Support / Re: Cant get SimbleeCloud Service to work
« on: September 18, 2017, 11:45:57 AM »
Yes, Inquiring minds would like to know !! I would like to see complete written theory API instructions on this subject. Step by step instructions to follow don't sink in for me either. I need the layout.

2
Support / Re: Simblee supply issues?
« on: September 14, 2017, 07:21:16 AM »
Dang! I do not know what is going on. None of the four main suppliers have any stock. Nor does SparkFun which has been the best source for information on using the Simblee.

Could be some big company finally went into production on something really cool and sucked up all the inventory, although I would have expected that big of a deal would be done factory direct. But I am not privy to what is going on behind the scenes.

Hopefully Mouser will get resupplied first as they have the best price for small quantities.


3
Simblee For Mobile / Re: SimbleeForMobile.drawSegment does not always work
« on: September 05, 2017, 08:45:33 AM »
Hopefully, the Pros from RFdigital will address their example.

4
Simblee For Mobile / Re: Update Segments on Connection
« on: September 04, 2017, 02:53:43 PM »
When using SimbleeForMobile, and you need responsiveness to the phone you can't really use ULPDelay or even long regular Delays as it will definitely interfere with it. You need to set up a series of pseudo state machines based on millis().

You can do something like this to get your strobe feature. I'm controlling it through the PWM instead of each LED enable.

Code: [Select]
bool strobe = true;

* * *

void loop()
{
  SimbleeForMobile.process();

  ledTime(); // deal with LED strobes, etc

  if(SimbleeForMobile.connected && SimbleeForMobile.updatable)
  {
    SimbleeForMobile.updateValue(ui_segment_front, frontValue);
    SimbleeForMobile.updateValue(ui_segment, brightnessValue);
  } 
}


* * *

int ledState = HIGH;
unsigned long previousMillis = 0;
unsigned long interval = 1000; // No const cause I want to change this dynamically.
unsigned long currentMillis;

void ledTime()
{
  if(strobe){
   
    currentMillis = millis();
    if (currentMillis - previousMillis >= interval) {
      previousMillis = currentMillis;
      if (ledState == LOW) {
        ledState = HIGH;
        interval = 100;
        analogWrite(pwm_LED, brightness); // Turn ON LED
      } else {
        ledState = LOW;
        interval = 900;
        digitalWrite(pwm_LED, 0); // Turn OFF LED
      }
    }
   
  } else {
      analogWrite(pwm_LED, brightness); // no strobing
  }
}








5
Simblee For Mobile / Re: SimbleeForMobile.drawSegment does not always work
« on: September 04, 2017, 12:38:38 PM »
Sorry, I am not following your description about some other sketch. Can you provide a minimum sketch showing exactly what you are describing.

The provided minimal sketch works and does not show what you are describing. The only problem I have with your sketch is the bright red on light grey is hard on the eyes to focus.

6
Simblee For Mobile / Re: Update Segments on Connection
« on: September 04, 2017, 12:21:21 PM »
Hi hoser,

You are almost there actually.

Just a quick note. Since you have defined your LEDs I changed your CASE statement to use those definitions instead of hard coding the GPIOs there. That way I was able to change the values in the definitions to match my LED locations.

Next in your ui_event you need to capture the values for later use. I used brightnessValue and frontValue.

Then in your loop you can test for phone connected AND that the UI is updatable before updating those value. Doing this will let you disconnect and come back and your UI Segments will reflect the values in your hardware.

Also, as a side affect, the default choices upon initial start up of the app is BLUE 25%. If you have a preference for what should be the initial startup you can change that in the brightnessValue and frontValue definition.

Code: [Select]

#include <SimbleeForMobile.h>

const int LED_WHITE = 2;
const int LED_RED = 5;
const int LED_BLUE = 17;
const int LED_GREEN = 6;
const int LED_YELLOW = 19;
int current_LED = 0;
const int pwm_LED = 4;
volatile uint32_t brightness = 65289; // This number divided by 255 is brightness (65,000 is brightest)
uint8_t intensityText;
uint8_t frontArrayText;
uint8_t blinkSwitchText;
uint8_t ui_segment;
uint8_t ui_segment_front;

uint8_t brightnessValue;
uint8_t frontValue;

void setup()
{
 
  pinMode(LED_WHITE, OUTPUT);
  digitalWrite(LED_WHITE, LOW);
  pinMode(LED_RED, OUTPUT);
  digitalWrite(LED_RED, LOW);
  pinMode(LED_BLUE, OUTPUT);
  digitalWrite(LED_BLUE, LOW);
  pinMode(LED_GREEN, OUTPUT);
  digitalWrite(LED_GREEN, LOW);
  pinMode(LED_YELLOW, OUTPUT);
  digitalWrite(LED_YELLOW, LOW);
  analogWrite(pwm_LED, brightness);

  SimbleeForMobile.advertisementData = "Demo";
  SimbleeForMobile.deviceName = "LED SEL";

  SimbleeForMobile.txPowerLevel = -4;

  SimbleeForMobile.begin();
}


void loop()
{
  SimbleeForMobile.process();

  if(SimbleeForMobile.connected && SimbleeForMobile.updatable)
  {
    SimbleeForMobile.updateValue(ui_segment_front, frontValue);
    SimbleeForMobile.updateValue(ui_segment, brightnessValue);
  }
 
}

void ui()
{
  color_t darkgray = rgb(13, 92, 199);

  uint16_t wid = SimbleeForMobile.screenWidth;
  uint16_t hgt = SimbleeForMobile.screenHeight;

  SimbleeForMobile.beginScreen(darkgray);

  frontArrayText = SimbleeForMobile.drawText(
                     (wid / 2) - 50,       // x location
                     (hgt / 2) - 200,       // y location
                     "FRONT ARRAY",           // text
                     WHITE);                // color of text

  const char* front_blue = "BLUE";
  const char* front_green = "GREEN";
  const char* front_yellow = "YELLOW";
  const char* front_red = "RED";
  const char* front_white = "WHITE";
  const char* const front_array[5] = {front_blue, front_green, front_yellow, front_red, front_white};

  ui_segment_front = SimbleeForMobile.drawSegment(
                       (wid / 2) - 150,        // x location
                       (hgt / 2) - 180,        // y location
                       300,                    // width
                       front_array,          // array
                       5,                      // count
                       WHITE);                 // color

  intensityText = SimbleeForMobile.drawText(
                    (wid / 2) - 33,         // x location
                    (hgt / 2) + 160,       // y location
                    "INTENSITY",           // text
                    WHITE);               // color of text


  const char* quarter = "25%";
  const char* half = "50%";
  const char* three_quarter = "75%";
  const char* full = "100%";
  const char* const segment_collection[4] = {quarter, half, three_quarter, full};

  ui_segment = SimbleeForMobile.drawSegment(
                 (wid / 2) - 100,        // x location
                 (hgt / 2) + 180,        // y location
                 200,                    // width
                 segment_collection,     // array
                 4,                      // count
                 WHITE);                 // color

  SimbleeForMobile.endScreen();
}

void ui_event(event_t &event)
{
  if (event.id == ui_segment)
  {
    brightnessValue = event.value;
    switch (brightnessValue)
    {
      case 0:
        brightness = 65535;
        break;
      case 1:
        brightness = 65500;
        break;
      case 2:
        brightness = 65430;
        break;
      case 3:
        brightness = 65289;
        break;
    }
    analogWrite(pwm_LED, brightness);
  }

  // Front array color selection
  if (event.id == ui_segment_front)
  {
    frontValue = event.value;
    switch (frontValue)
    {
      case 0:
        digitalWrite(LED_BLUE, HIGH);
        digitalWrite(LED_GREEN, LOW);
        digitalWrite(LED_WHITE, LOW);
        digitalWrite(LED_RED, LOW);
        digitalWrite(LED_YELLOW, LOW);
        current_LED = LED_BLUE;
        break;
      case 1:
        digitalWrite(LED_BLUE, LOW);
        digitalWrite(LED_GREEN, HIGH);
        digitalWrite(LED_WHITE, LOW);
        digitalWrite(LED_RED, LOW);
        digitalWrite(LED_YELLOW, LOW);
        current_LED = LED_GREEN;
        break;
      case 2:
        digitalWrite(LED_BLUE, LOW);
        digitalWrite(LED_GREEN, LOW);
        digitalWrite(LED_WHITE, HIGH);
        digitalWrite(LED_RED, LOW);
        digitalWrite(LED_YELLOW, LOW);
        current_LED = LED_WHITE;
        break;
      case 3:
        digitalWrite(LED_BLUE, LOW);
        digitalWrite(LED_GREEN, LOW);
        digitalWrite(LED_WHITE, LOW);
        digitalWrite(LED_RED, HIGH);
        digitalWrite(LED_YELLOW, LOW);
        current_LED = LED_RED;
        break;
      case 4:
        digitalWrite(LED_BLUE, LOW);
        digitalWrite(LED_GREEN, LOW);
        digitalWrite(LED_WHITE, LOW);
        digitalWrite(LED_RED, LOW);
        digitalWrite(LED_YELLOW, HIGH);
        current_LED = LED_YELLOW;
        break;
    }
  }
}



7
Simblee For Mobile / Re: Update Segments on Connection
« on: September 04, 2017, 10:34:56 AM »
Are you intending to use the pwm_led to modulate a common line that goes to the 5 color LEDs? Or are you meaning to have a pwm level or the active color LED independant of the others.

But, basically you need to have a onConnect routine that re-sets your various values to the display.
You might have a onDisconnect routine that saves your values, but may not be necessary.



8
RFduino Libraries / Re: RFduino Board compile error
« on: August 31, 2017, 09:26:15 AM »
Just yesterday, compiling and uploading codes from my PC to the RFduino module is flawless. But this day Aug 31, 2017. I can't seem to compile any code to RFduino module. I even tried the most basic examples for RFduino. Here is the Error Log:

Arduino: 1.8.4 (Windows 10), Board: "RFduino"

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.7.0_x86

HINT: Maybe? What is ArduinoIDE_1.8.7.0_x86. Surely not Arduino 1.8.4.


9
Bugs / Re: int takes 4 bytes
« on: August 29, 2017, 01:36:10 PM »
Integers on ARM Cortex M0 are 32 bits. Thus the 4 bytes.

10
I don't know why, or if this is repeatable.

The issue went away when I un-checked in the Preferences...
Aggressively cache compiled core


11
Hi biomurph,

Did you get this syscalls.c.o error resolved?

I am seeing the same thing occasionally on Arduino 1.8.3 and Simblee 1.1.2 and 1.1.3.

Hopefully somebody from RF Digital with inside information can comment.



12
Support / Re: Simblee getting input voltage
« on: August 18, 2017, 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.

13
Simblee For Mobile / Re: SimbleeForMobile two screens
« 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.

14
Knowing that it is just turning GPIO 31 on and off you can just use the Arduino way of doing that.

pinMode(31, OUTPUT);

digitalWrite(31, HIGH);
or
digitalWrite(31, LOW);

15
I for one would like to hear more about details to do these things.

Pages: [1] 2 3 ... 57