Loading...
  Show Posts
Pages: [1] 2 3 ... 9
1  Using Arduino / Programming Questions / mouse library and absolute mouse position on: April 20, 2013, 04:23:21 pm
Hello,

This is a question regarding Arduino keystrokes and mouse movements. I'm writing a program in which when you make contact with a capacitive touch sensor, the mouse moves a specific distance across the screen. This is done using an Arduino Leonardo.

The problem I'm experiencing, however, is that the mouse move command can be pretty erratic in terms of the mouse's position. I was wondering, is there a way to make the mouse position absolute, rather than relative to where it initially was in my program?

Here's the code I have that deals with the sensor and mouse movements:

Code:
  if(total1 > 200 && var != 1) {
    Mouse.begin();
    Mouse.move(100, 0, 0);
    Mouse.end();
    var = 1;
  }

  if(total1 <= 200 && var == 1) {
    Mouse.begin();
    Mouse.move(-100, 0, 0);
    Mouse.end();
    var = 0;
  }
2  Using Arduino / Project Guidance / Re: soft circuit hugging dolls and transceivers on: April 13, 2013, 12:35:30 pm
Quote
The nRF24L01+ transceivers are bidirectional so you would have identical code on both sides which are configured in some way to tell each one which address to use. That could be by a value saved in EEPROM, or an input pin pulled low by a jumper. However you do it, you need to give each Arduino some way to figure out which one it is out of the pair.

Each Arduino will listen to the RF24 interface. If it receives a message, it carries out the action. Each Arduino will also poll the FSR at regular intervals; if it detects a 'hug' then it will stop listening to the radio, send a message to the other Arduino and resume listening again.

How exactly would I do all of that? I've managed to get the transceivers communicating with each other, but I just don't know how to get them to do specific things.
3  Using Arduino / Networking, Protocols, and Devices / make servos move with nrf24l01+ on: April 13, 2013, 03:07:30 am
I'm trying to get one transceiver to tell the other transceiver to make some servos move on an Arduino board. I managed to make the transceivers work using this tutorial: http://maniacbug.wordpress.com/2011/11/02/getting-started-rf24/ and the RF24 library. However, I have no idea how I would make servos move using the transceivers. Does anybody know? Thanks in advance.
4  Using Arduino / Project Guidance / soft circuit hugging dolls and transceivers on: April 13, 2013, 12:03:26 am
Hello,

I'm working on a project in which I'm making two dolls. Suppose there are two people, one holding each doll. When one person hugs his doll, the other doll will move its arms to hug the other person. If the other person hugs the doll back, then the first doll will hug the first person, and so on and so forth.

I'm using servos to control the arm rotations and FSRs to sense the force of the hugging. I'll also be using a Lilypad to control each doll. I've got that part covered, pretty much. However, I'm using nRF24L01+ transceivers to make the Lilypads communicate with each other. I've made the transceivers work, using this tutorial: http://maniacbug.wordpress.com/2011/11/02/getting-started-rf24/ and the RF24 library. However, I'm not sure how to make the transceivers communicate specific commands to each other. I want to make it so that when the FSRs in one doll reach a specific threshold, the transceiver tells the servos in the other doll to move. How would I go about doing that?

Thanks in advance, y'all.
5  Using Arduino / Project Guidance / Re: making two arduinos communicate wirelessly on: April 02, 2013, 12:39:40 pm
Great, thank you! I live in New York, so that first link you suggested was pretty good news for me.

Do you know how I would deal with the voltage conversion?
6  Using Arduino / Project Guidance / Re: making two arduinos communicate wirelessly on: April 01, 2013, 11:25:09 pm
Thanks, but dealxtreme usually takes forever to process and ship orders, and I need this in about a week, unfortunately. Sparkfun is reliable but they're also expensive as fuck. -_-
7  Using Arduino / Project Guidance / making two arduinos communicate wirelessly on: April 01, 2013, 10:23:38 pm
Hello all,

I'm working on a project in which I want to make two dolls. With the aid of some servos and force-sensing resistors, I'm going to make it such that when each doll is being held by an individual person, and one of those people hugs his/her respective doll, the other doll hugs the other individual. I'm planning on controlling each doll with a separate arduino (well...technically, a flora: http://www.adafruit.com/products/659)

I'm looking for a good protocol to make the two arduinos communicate wirelessly. What do you guys recommend I use? Xbee? Transceivers? I'd appreciate some input (no pun intended, heh). Thank you.
8  Using Arduino / Motors, Mechanics, and Power / Re: Driving fan using transistor on: March 23, 2013, 03:37:40 pm
I tried reversing the diode direction and it didn't do anything. Could I have damaged the diode or the transistor with the short?
9  Using Arduino / Motors, Mechanics, and Power / Driving fan using transistor on: March 23, 2013, 03:29:02 pm
Hi everyone,

I'm using an 8.4V battery pack to power an Attwood Turbo 3000 fan and a TIP41C to drive it. The circuit I'm using basically looks like this (except the diode is reversed and the Arduino ground is connected to the battery ground): http://i.imgur.com/dYAa5.png

However, I need to be able to use code to power the fan on and off at various times. This is what I wrote, but the fan is perpetually turned on, regardless:

Code:
int fanPin = 7;

void setup() {
  Serial.begin(9600);
  pinMode(fanPin, OUTPUT);
}

void loop() {
  digitalWrite(fanPin, HIGH);
  Serial.println("high");
  delay(2000);
  digitalWrite(fanPin, LOW);
  Serial.println("low");
  delay(2000);
}

Any ideas on what I might need to do? Thanks!
10  Using Arduino / Programming Questions / Re: keyboard.print vs. keyboard.write vs. keyboard.press? on: March 04, 2013, 09:51:47 pm
Thanks so much for your help, guys!
11  Using Arduino / Programming Questions / Re: arduino leonardo keystrokes on: March 04, 2013, 06:51:54 pm
Never mind, I figured out my problem! I should have been using keyboard.print instead of keyboard.press. smiley
12  Using Arduino / Programming Questions / keyboard.print vs. keyboard.write vs. keyboard.press? on: March 04, 2013, 06:47:28 pm
I was reading up on keystrokes here: http://arduino.cc/en/Reference/MouseKeyboard

I'm still not entirely sure what the differences are between those three functions. Could somebody please explain the differences to me a bit better? I'm writing a program that involves sending keystrokes to my computer, and I'm not quite sure which one is the appropriate one to use. Thanks.
13  Using Arduino / Programming Questions / arduino leonardo keystrokes [solved] on: March 04, 2013, 06:09:30 pm
Hello everyone,

I'm making a book, and I put a switch on each page that outputs a LOW to the Arduino when it's open and a HIGH when it's closed. There's a webcomic that I made (http://allotrope-dome.net/advdesign/innergirl/ — not quite cross-browser compatible yet so it might look wonky to some of you), and I'm trying to implement some keystrokes that navigate to a different webcomic panel when a new page is opened.

I got the page-turning algorithm down fine, but there seems to be a problem with the keystrokes. Only the first page/panel works. When I turn the pages, it always prints the correct page to the console, but the keystrokes simply do not work.

Here is my code for page 1, for example (I only have three pages wired/coded so far. Pages 2 and 3 follow more or less the same logic). I also put in the variables I'm using:

Code:
// assign pins for pages 1, 2, and 3
int page1 = 8;
int page2 = 9;
int page3 = 10;

// variable that changes whenever user turns to a specific page
int currentPage = 0;

// char variables created for tab and return commands
char tabKey = KEY_TAB;
char returnKey = KEY_RETURN;

// if only page 1 is low, and the current page isn't already 1:
  if(pageState1 == 0 && pageState2 != 0 && pageState3 != 0 && currentPage != 1) {
    Serial.print("state of page 1:");
    Serial.println(pageState1);
    // if the user is just opening the book now
    if(currentPage == 0) {
      Serial.println("about to hit tab once");
      Keyboard.begin();
      Keyboard.press(tabKey);
      Serial.println("about to hit return");
      Keyboard.press(returnKey);
      Keyboard.end();
    }
    // if the user was on page 2 previously
    if(currentPage == 2) {
      Serial.println("about to hit tab 7x");
      Keyboard.begin();
      Keyboard.press(tabKey);
      Keyboard.press(tabKey);
      Keyboard.press(tabKey);
      Keyboard.press(tabKey);
      Keyboard.press(tabKey);
      Keyboard.press(tabKey);
      Keyboard.press(tabKey);
      Serial.println("about to hit return");
      Keyboard.press(returnKey);
      Keyboard.end();
    }
    //if the user was on page 3 previously:
    if(currentPage == 3) {
      Serial.println("about to hit tab 6x");
      Keyboard.begin();
      Keyboard.press(tabKey);
      Keyboard.press(tabKey);
      Keyboard.press(tabKey);
      Keyboard.press(tabKey);
      Keyboard.press(tabKey);
      Keyboard.press(tabKey);
      Serial.println("about to hit return");
      Keyboard.press(returnKey);
      Keyboard.end();
    }
    // set the current page to page 1
    currentPage = 1;
  }

Anybody know why it's not working? Thank you!
14  Topics / E-Textiles and Craft / Specs/schematic sheet for Flora? on: February 14, 2013, 01:26:30 pm
Hey y'all, I've been looking for a schematic and specs sheet for the recently-released Flora. I looked for the sheet on the page where you can order it, and it doesn't seem to be there: http://www.adafruit.com/products/659
Anybody know where/if I can find it?
15  Using Arduino / Audio / Re: processing beads library on: December 03, 2012, 03:00:53 am
Yes. Sorry for not being clear!
Pages: [1] 2 3 ... 9