Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
projektews2013:wwsr:start:robotwlankrammitstepper [2014/01/04 15:04] gorgotha angelegt |
projektews2013:wwsr:start:robotwlankrammitstepper [2016/01/21 12:45] (aktuell) |
||
---|---|---|---|
Zeile 29: | Zeile 29: | ||
//int ausrichtungsWinkel; //nur für servovariante | //int ausrichtungsWinkel; //nur für servovariante | ||
int step1=24; //stepper motor | int step1=24; //stepper motor | ||
- | int dir=22; //stepper motor | + | int dir1=22; //stepper motor |
+ | |||
+ | //Rechtes Rad | ||
+ | int step2=26; | ||
+ | int dir2=28; | ||
+ | //Linkes Rad | ||
+ | int step3=30; | ||
+ | int dir3=32; | ||
+ | |||
+ | int startVariable=99; | ||
Zeile 42: | Zeile 51: | ||
57600, // if you use a hardware serial, I would recommend the full 115200. This does not work with a software serial. | 57600, // if you use a hardware serial, I would recommend the full 115200. This does not work with a software serial. | ||
true, // should we try some other baudrates if the currently selected one fails? | true, // should we try some other baudrates if the currently selected one fails? | ||
- | "arduinonetz", //Your Wifi Name (SSID) | + | "wally", //Your Wifi Name (SSID) |
- | "florian2", //Your Wifi Password | + | "robomint", //Your Wifi Password |
"WiFly", // Device name for identification in the network | "WiFly", // Device name for identification in the network | ||
0, // IP Adress of the Wifly. if 0 (without quotes), it will use dhcp to get an ip | 0, // IP Adress of the Wifly. if 0 (without quotes), it will use dhcp to get an ip | ||
Zeile 51: | Zeile 60: | ||
true // show debug information on Serial | true // show debug information on Serial | ||
); | ); | ||
- | wifly.printStatusInfo(); //print some debug information | + | //wifly.printStatusInfo(); //print some debug information |
pinMode(ledPin,OUTPUT); //prepare to fade th einternal LED by OSC | pinMode(ledPin,OUTPUT); //prepare to fade th einternal LED by OSC | ||
Zeile 59: | Zeile 68: | ||
wifly.startCommand(); | wifly.startCommand(); | ||
pinMode(step1, OUTPUT); | pinMode(step1, OUTPUT); | ||
- | pinMode(dir, OUTPUT); | + | pinMode(dir1, OUTPUT); |
+ | |||
+ | pinMode(step2, OUTPUT); | ||
+ | pinMode(dir2, OUTPUT); | ||
+ | pinMode(step3, OUTPUT); | ||
+ | pinMode(dir3, OUTPUT); | ||
} | } | ||
Zeile 66: | Zeile 80: | ||
void loop() | void loop() | ||
{ | { | ||
+ | Serial.println(startVariable); | ||
//check for new incoming messages. If a message with a registered adress is recieved, the callback function will be invoked. | //check for new incoming messages. If a message with a registered adress is recieved, the callback function will be invoked. | ||
if(server.availableCheck(2)>0) | if(server.availableCheck(2)>0) | ||
Zeile 71: | Zeile 86: | ||
//debugoutln("alive!"); //callback after process | //debugoutln("alive!"); //callback after process | ||
} | } | ||
- | rotateStepper(10); | + | rotateStepper(225); |
} | } | ||
//myservo.write(ausrichtungsWinkel); | //myservo.write(ausrichtungsWinkel); | ||
Zeile 95: | Zeile 110: | ||
void rotateStepper(int delayValue){ //entweder rotateStepper oder rotateServo in for schleife | void rotateStepper(int delayValue){ //entweder rotateStepper oder rotateServo in for schleife | ||
| | ||
- | digitalWrite(dir, LOW); | + | digitalWrite(dir1, LOW); |
| | ||
- | for(int i=0;i<200;i++) { | + | for(int i=0;i<1600;i++) { |
digitalWrite(step1, HIGH); | digitalWrite(step1, HIGH); | ||
delay(delayValue); | delay(delayValue); | ||
Zeile 104: | Zeile 119: | ||
Serial.println(wifly.getRSSI()); | Serial.println(wifly.getRSSI()); | ||
} | } | ||
- | digitalWrite(dir, HIGH); | + | digitalWrite(dir1, HIGH); |
| | ||
- | for(int i=0;i<200;i++) { | + | for(int i=0;i<1600;i++) { |
digitalWrite(step1, HIGH); | digitalWrite(step1, HIGH); | ||
delay(delayValue); | delay(delayValue); |