Author Topic: Sketch only works when connected to USB-Shield  (Read 485 times)

JSteinhilber

  • RFduino Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Sketch only works when connected to USB-Shield
« on: June 14, 2016, 08:27:32 AM »
Hi all,
i try to get my first RFDuino-Project running - but no success.
When the RFDuino ist pluged in the USB-Shiel everything works fine.
But when i connect the RFDuino to external 3,3V Powersource nothing works.
Can anybody tell me where I'm wrong? Thanks in advance.
J├╝rgen
Here ist the Sketch of the DEVICE
Code: [Select]
#include <RFduinoGZLL.h>

device_t role = DEVICE0;
const int PIR = 2;
const int LED = 4;
const int VCC = 5;
int start = 0;

int myPinCallback(uint32_t ulPin){
  if(digitalRead(PIR)==LOW){
    return 0;
  }
  RFduinoGZLL.sendToHost((char*)"alarm1");
  digitalWrite(LED,HIGH);
  delay(500);
  digitalWrite(LED,LOW);
  Serial.println("Bewegung erkannt");
  return 0;
}


void setup() {
  Serial.begin(9600);
  RFduinoGZLL.begin(role); 

  pinMode(LED, OUTPUT);
  digitalWrite(LED, HIGH);
 
  RFduinoGZLL.sendToHost((char*)"gestartet1");

  pinMode(PIR, INPUT);
   
  while(digitalRead(PIR)==HIGH){
    delay(100);
  }
  Serial.println("gestartet und LOW");
  digitalWrite(LED, LOW);
 
  RFduino_pinWakeCallback(PIR, HIGH, myPinCallback);
 
}

void loop() {
  RFduino_ULPDelay(INFINITE);

}

  void RFduinoGZLL_onReceive(device_t device, int rssi, char *data, int len)
{
}


 

anything