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: 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
|
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.
|
|
|
|
|
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.
|
|
|
|
|
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.
|
|
|
|
|
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.pngHowever, 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: 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!
|
|
|
|
|
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: // 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!
|
|
|
|
|