Show Posts
|
|
Pages: 1 2 3 [4] 5
|
|
46
|
International / Deutsch / Re: Roboter per Bluetooth steuern?
|
on: July 07, 2012, 07:21:29 am
|
|
und wenn der Bot mal was mehr machen soll als nur rumfahren, kannste dir noch nen kleines Protokoll zur Steuerung schreiben.
@Vorposter: Warum dieses Silvermate-Modul? Gibt doch auch günstigere und da die Steuerung eh nur über SPP geht....
|
|
|
|
|
47
|
International / Deutsch / PCB-Layout - Kommentare erwünscht
|
on: July 07, 2012, 06:29:23 am
|
Moin, also ich möchte gern einen Auslöser für meine Kameras bauen (IR + Kabel angeschlossen über 3,5-Klinke). Primärsensor ist ein HC-SR04 und daneben noch ein Analogeingang (zweiter 3,5-Klinke) für andere Sensoren. Ein Bluetoothmodul damit ich den Auslöser konfigurieren kann. Es sollte mit 3V3 (3xAAA-Akku) laufen. Komponenten: - ATMEGA328
- HC-SR04 (simple and cheap)
- DFROBOT Bluetooth module V3
- 80x60x40mm-Box
Fritzingentwurf Unterseite:  Oberseite:  Hat jemand noch Tipps oder Verbesserungsvorschläge? Gerade bei der Wahl von Widerständen, Kondensatoren etc. bin ich mir nicht so sicher:). Danke Peter
|
|
|
|
|
49
|
International / Deutsch / mega 2560 + Processing
|
on: June 05, 2012, 10:12:21 am
|
Hallo, ich wollte mir die Werte meines Lichtsensors mit Processing grafisch anzeigen lassen. Leider kennt gibt mir Processing immer den Wert "0" aus. Woran liegts? import processing.serial.*; import cc.arduino.*;
Arduino arduino;
int i = 0; void setup() { println(Arduino.list()); arduino = new Arduino(this, Arduino.list()[0], 19200); arduino.pinMode(2, Arduino.INPUT); size(600, 600); }
void draw() { int iVal = arduino.analogRead(2); println(iVal); line(i,0,iVal,0); delay(1000); i++; }
danke
|
|
|
|
|
54
|
International / Deutsch / Re: Mega 2560 + Strom sparen?
|
on: May 30, 2012, 02:13:44 pm
|
richtig. Hier ist er #include "LowPower.h"
void setup() { // No setup is required for this library }
void loop() { // Sleep for 8 s with ADC module and BOD module off LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF); // Do something here // Example: read sensor, log data, transmit data }
|
|
|
|
|
55
|
International / Deutsch / Mega 2560 + Strom sparen?
|
on: May 30, 2012, 02:02:41 pm
|
Hallo, ich möchte gern den Stromverbrauch meines Mega reduzieren. Ich bin mit ein bisschen suchen auf diese Bibliothek gestoßen. http://www.rocketscream.com/blog/2011/07/04/lightweight-low-power-arduino-library/Scheint recht simpel zu sein, aber leider geht es nicht so recht. Ich bekomme folgende Fehlermeldungen LowPower.cpp: In member function 'void LowPowerClass::powerDown(period_t, adc_t, bod_t)': LowPower.cpp:298: error: 'BODS' was not declared in this scope LowPower.cpp:298: error: 'BODSE' was not declared in this scope LowPower.cpp: In member function 'void LowPowerClass::powerSave(period_t, adc_t, bod_t, timer2_t)': LowPower.cpp:379: error: 'BODS' was not declared in this scope LowPower.cpp:379: error: 'BODSE' was not declared in this scope LowPower.cpp: In member function 'void LowPowerClass::powerStandby(period_t, adc_t, bod_t)': LowPower.cpp:439: error: 'BODS' was not declared in this scope LowPower.cpp:439: error: 'BODSE' was not declared in this scope LowPower.cpp: In member function 'void LowPowerClass::powerExtStandby(period_t, adc_t, bod_t, timer2_t)': LowPower.cpp:512: error: 'BODS' was not declared in this scope LowPower.cpp:512: error: 'BODSE' was not declared in this scope
Was bedeutet das? Grüße Peter
|
|
|
|
|
57
|
International / Deutsch / Re: SerialEvent() & Serial.read() mehr als 64Bytes
|
on: May 22, 2012, 03:38:39 pm
|
Das Problem ist das Serial.available() nur die ersten 64 Byte einer Konsoleneingabe lesen kann. Für meine Zwecke sollten es aber deutlich mehr sein,..300 ca. Ich habe folgenden Code: String inputString = ""; // a string to hold incoming data boolean stringComplete = false; // whether the string is complete
void setup() { inputString.reserve(800); Serial.begin(38400); setupBlueToothConnection();
}
void loop() { if (stringComplete) { Serial.println(inputString); // clear the string: inputString = ""; stringComplete = false; } }
void setupBlueToothConnection() { Serial.print("Setting up Bluetooth link"); Serial2.begin(38400); delay(1000); sendBlueToothCommand("\r\n+STWMOD=0\r\n"); sendBlueToothCommand("\r\n+STNA=modem\r\n"); sendBlueToothCommand("\r\n+STAUTO=0\r\n"); sendBlueToothCommand("\r\n+STOAUT=1\r\n"); sendBlueToothCommand("\r\n+STPIN=0000\r\n"); delay(2000); // This delay is required. Serial2.print("\r\n+INQ=1\r\n"); delay(2000); // This delay is required. Serial.print("Setup complete");
}
void sendBlueToothCommand(char command[]) { char a; Serial2.print(command); }
void serialEvent2() { while (Serial2.available()) { // get the new byte: char inChar = (char)Serial2.read(); // add it to the inputString: inputString += inChar; // if the incoming character is a newline, set a flag // so the main loop can do something about it: if (inChar == ';') { stringComplete = true; //Serial.println(inputString); } } }
|
|
|
|
|
60
|
International / Deutsch / Re: Frage: Empfehlung Bluetooth Xbee
|
on: May 19, 2012, 04:07:06 am
|
Habs hinbekommen. War banal,.. ich hatte es ja auf Serial0 und wenn es per USB am PC hängt, dann gehts halt net. Allerdings habe ich jetzt ein anderes Problem  Wenn ich die Eingaben auf der Console lesen und wieder dorthin schreiben will, dann fehlen manchmal Buchstaben. Nicht immer,...aber doch recht oft. Auch keine bestimmte Anzahl, meist eins,... aber auch mal mehr als die Hälfte :-// Nutze die Standard-Baudrate 38.4k. void setup() { Serial2.begin(38400); setupBlueToothConnection();
}
void loop() {
if(Serial2.read() == 'a') { Serial2.println("You are connected to Bluetooth Bee"); } int makeBtSerialStringPosition; int inBtByte; String sResult; char serialBtReadString[300]; inBtByte = Serial2.read(); //delay(10); makeBtSerialStringPosition=0;
if (inBtByte >= 0 ) { delay(120); Serial2.print("Chars: "); Serial2.println(Serial2.available());
while (Serial2.available() > 0){
serialBtReadString[makeBtSerialStringPosition] = inBtByte; sResult = sResult + serialBtReadString[makeBtSerialStringPosition] ; Serial2.println(serialBtReadString[makeBtSerialStringPosition]); makeBtSerialStringPosition++; inBtByte = Serial2.read(); }
serialBtReadString[makeBtSerialStringPosition] = 0; inBtByte = 0; if(sResult != ""){ Serial2.println(sResult); } delay(300); } Serial2.flush(); }
void setupBlueToothConnection() { Serial2.println("Setting up Bluetooth link");
delay(1000); sendBlueToothCommand("\r\n+STWMOD=0\r\n"); sendBlueToothCommand("\r\n+STNA=Arduino\r\n"); sendBlueToothCommand("\r\n+STAUTO=1\r\n"); sendBlueToothCommand("\r\n+STOAUT=1\r\n"); sendBlueToothCommand("\r\n+STPIN=0000\r\n"); delay(2000); // This delay is required. Serial2.println("\r\n+INQ=1\r\n"); delay(2000); // This delay is required. Serial2.println("Setup complete");
}
void sendBlueToothCommand(char command[]) { char a; Serial2.print(command); delay(3000); }
|
|
|
|
|