Author Topic: Cannot get LED example to work  (Read 578 times)

SusanStoHelit

  • RFduino Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Cannot get LED example to work
« on: January 30, 2017, 02:40:49 PM »
I just received two Lilypad Simblees (with the Lilypad FTDI breakout) and am trying to get them to work. So far, I can seem to make a connection and get the device to respond. Compiling and uploading to the device works without any problems.
However, I cannot seem to get any outputs to work. Even the small LED example does not turn on the on-board LEDs at all. Anything involving the actual BLE does not show up in the app on my phone.
I've tried this with two different cables and both devices, so nothing seems to be broken. I've also tested the temperature example by taking out all the BLE stuff and just writing the value to the serial output, and that also works and gives me reasonable values. The RX and TX LEDs on the FTDI also flash as expected.
Any ideas what this could be? My only idea is that it could have something to do with the power supply...? (I haven't tried attaching any external battery. It should get enough via the FTDI, correct?)
Thanks!

tolson

  • Global Moderator
  • *****
  • Posts: 854
  • Karma: +20/-0
    • View Profile
    • Thomas Olson Consulting
Re: Cannot get LED example to work
« Reply #1 on: January 30, 2017, 08:41:17 PM »
Can you show your full sketch.

SusanStoHelit

  • RFduino Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Cannot get LED example to work
« Reply #2 on: January 31, 2017, 01:31:22 AM »
It's just the Simblee Blink example, but nothing blinks when I try it:

Code: [Select]
/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.
 
  This example code is in the public domain.
 */
 
// Pin 3 has an green LED connected on the RGB LED shield
// give it a name:
int led_green = 3;

// the setup routine runs once when you press reset:
void setup() {               
  // initialize the digital pin as an output.
  pinMode(led_green, OUTPUT);     
}

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(led_green, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                     // wait for a second
  digitalWrite(led_green, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                     // wait for a second
}

This is the temperature example I was talking about, which works:

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

void setup() {
    Serial.begin(9600);
}

void loop() {
 
  // get a cpu temperature sample
  // degrees c (-198.00 to +260.00)
  // degrees f (-128.00 to +127.00)
  float temp = Simblee_temperature(CELSIUS);

  Serial.println(temp);
}
« Last Edit: January 31, 2017, 05:28:38 AM by tolson »

tolson

  • Global Moderator
  • *****
  • Posts: 854
  • Karma: +20/-0
    • View Profile
    • Thomas Olson Consulting
Re: Cannot get LED example to work
« Reply #3 on: January 31, 2017, 05:38:02 AM »
The Sparkfun Lilypad has it's on-board LED on GPIO 13, not 3.

As far as BLE, does your smartphone supports BLE?
« Last Edit: January 31, 2017, 05:55:20 AM by tolson »

SusanStoHelit

  • RFduino Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Cannot get LED example to work
« Reply #4 on: January 31, 2017, 02:36:51 PM »
D'oh! Thanks so much, I just kind of assumed that 3 would be correct because there are multiple LEDs next to the "3" connector.
As for the BLE example, I made the mistake of trying the examples in the "SimbleeBLE" group rather than the ones from "SimbleeForMobile" *facepalm*
Well, everything works now  :D

 

anything