Skip to content

Commit

Permalink
using internal pull up resistor for xbee (xbee pcb rev 2.0)
Browse files Browse the repository at this point in the history
  • Loading branch information
5v3n committed Jun 8, 2013
1 parent 9384b1e commit 3094039
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ You can test drive if the server reacts without using the actual remote control

### Build the rat pack remote control

See `fritzing/ratpack_wifly.fzz` for the needed components and the wiring of your remote control.
See `fritzing/ratpack_xbee_wifly.fzz` for the needed components and the wiring of your remote control.

![Rat Pack Fritzing Sketch](https://github.com/5v3n/ratpack/blob/master/fritzing/ratpack_wifly.jpg?raw=true)
![Rat Pack Fritzing Sketch](https://github.com/5v3n/ratpack/blob/master/fritzing/ratpack_xbee_wifly.jpg?raw=true)

If you aren't using Fritzing already you can download it [here](http://fritzing.org/download/).

Find the arduino software in `arduino/ratpack_wifly`. All you have to do is adjust the `Config.h` file with your wify credentials and the rat pack server's host data:
Find the arduino software in `arduino/ratpack_xbee_wifly`. All you have to do is adjust the `Config.h` file with your wify credentials and the rat pack server's host data:

```c
// Wifi parameters
Expand Down
6 changes: 4 additions & 2 deletions arduino/ratpack_xbee_wifly/ratpack_xbee_wifly.ino
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ void setup(){
pinMode(ledPin, OUTPUT);
//------------------------ button setup ------------------------
pinMode(buttonPin, INPUT);
//use internal 10k
digitalWrite(buttonPin, HIGH);
//------------------------ wifly setup ----------------------------------
Serial.begin(9600);
WiFly.setUart(&Serial);
Expand All @@ -52,12 +54,12 @@ void loop() {
// your last connection, then connect again and send data:
if(!client.connected() && (millis() - lastConnectionTime > IO_INTERVAL)) {
//------------------- button part ---------------------------------------
if(digitalRead(buttonPin) == LOW){
if(digitalRead(buttonPin) == HIGH){
//--------- send status to server
connectClient(generateHttpPut(HOST, RESOURCE, '0'));
client.stop();
}
else if(digitalRead(buttonPin) == HIGH){
else if(digitalRead(buttonPin) == LOW){
//--------- send status to server
connectClient(generateHttpPut(HOST, RESOURCE, '1'));
client.stop();
Expand Down
Binary file modified fritzing/ratpack_xbee_wifly.fzz
Binary file not shown.
Binary file modified fritzing/ratpack_xbee_wifly.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3094039

Please sign in to comment.