|
1217
|
Using Arduino / Project Guidance / Re: How can i take 4 bit binary input
|
on: December 17, 2012, 09:41:19 am
|
Something else to try, http://www.arduino.cc/en/Reference/PortManipulationlook at PINB, this reads in the inputs of pins 8 - 13 as 0000 0000 => (0,0,13,12 11,10,9,8) so you could probably do if(PINB == 00001111) { ... } else if (PINB == 00001010) { ... } etc that might work, but try to get more info from that page.
|
|
|
|
|
1218
|
Using Arduino / Project Guidance / Re: How can i take 4 bit binary input
|
on: December 17, 2012, 08:19:51 am
|
|
You could do something like set up an array, and using a FOR loop, read the inputs from the four pins.
Psuedo: byte array[3]; void loop { for(count = 0; count<4; count ++) { array[count] = bitRead(8 + count, 1); Serial.print(array[count]) } Serial.println(); } something like this.
|
|
|
|
|
1219
|
Using Arduino / Project Guidance / Re: BLUETOOTH + IPHONE + ARDUINO
|
on: December 16, 2012, 10:19:37 pm
|
Is there anyway to emulate these devices? Most HID devices (keyboards, etc) can connect with the iphone without the need to jailbreak. My question would be with an arduino and a BT board (which one would do best for this situation?) with an HID profile should be able to work right ? and if so is there a way to make arduino run a command on connect and disconnect (say turn a pin on and off)? To be honest, I'm not sure. Would there be any chance that you may have retained a copy or access to that information? All my idevices are jailbroken and its a non issue. If i want to develop a friendlier version i could use the BT BLE module in the future but my phone does not support BT4.0 . No, I don't have any of it anymore, I had a problem with my computer and lost literally everything on it, including my robot stuff that I was working, and had to start from scratch.
|
|
|
|
|
1221
|
Using Arduino / Project Guidance / Re: BLUETOOTH + IPHONE + ARDUINO
|
on: December 16, 2012, 09:22:46 pm
|
|
For my senior year in college, I had to think of ideas for a seminar project. I wanted to control a robot (that I made myself) with my IPhone, but I found out that the bluetooth protocol was very difficult to crack. It turns out that only a select few outside BT devices could found by the phone. Of course other phones could be found, but not store bought BT modules. So unfortunately, I had to scrap that plan and used an Android.
However I did hear that it could be done with a Jail broken phone, but at the time I didn't want to jail break my phone, because I wanted to make an app of my own that could do it from any Iphone and not just a jail broken one. Since then, I got rid the the phones altogether and just made my own controller from various arduino components.
If you still want to control it from your Iphone, it would be better to just pay someone at Apple to make you your own app. I think they want $150 - $200 depending on complexity.
|
|
|
|
|
1222
|
Using Arduino / Project Guidance / Re: Entering 3 digits
|
on: December 16, 2012, 09:05:59 pm
|
Quick question, why is keyIn declaired as a string at the top, but an int at the bottom? Make the one at the top the "int", and remove just "int" at the bottom. also char Data[5]; should only be 2, not 5. umm, const byte COLS = 4; //should go back to 3, unless you plan on getting a 4x4 keypad, in which case you need to fix the numbers in char keys[ROWS][COLS]. You have a 15 by 2 LCD, I thought you had a 16 by 2 ? ok, so you got "----" as the output when you entered the numbers but it was correct when you pressed " * ", weird. Ok try this, void loop(){ //lcd.begin(15,2); lcd.setCursor(2,0); lcd.print("Input Digits");
char key = keypad.getKey(); if(key != NO_KEY) // Do nothing if no key is pressed, incorporated from PaulS's example. { if (key != '*') { Data[currentCommand++] = key; keyIn = atoi(Data); lcd.setCursor(6,1); lcd.print(keyIn); //this should print the first digit in it's same spot and the 2nd and 3rd will follow like normal, when inputted. }
else { //keyIn = atoi(Data); //lcd.setCursor(6,1); //lcd.print(keyIn); //lcd.print(" "); lcd.print(" OK"); //just to tell you * was pressed Serial.println(keyIn); while(currentCommand !=0){ // This can be used for any array size, Data[currentCommand--] = 0; //clear for new data } } } }
Could you post a picture or little video of what your getting on the display?
|
|
|
|
|
1223
|
Using Arduino / Project Guidance / Re: Entering 3 digits
|
on: December 16, 2012, 11:04:22 am
|
|
Your not a pain in the arse, your like everyone else.You try really hard (on your own) for something to work, and when it doesn't you turn for help. Now what we do, is try to cross everything off the "to do list" before tackling another problem, that way we know that everything prior works. So I was basically crossing the keypad off.
Now as for displaying what you enter, that is relativly simple, but you will need to tweak the code a bit.
I can tell you what to put and where to put it, or I can take a crack at it myself, but again I dont know if it will work without any actual hardware to confirm that it does so. So I would rather you wrote it yourself and test it.
========================================= In a nut shell what you want to see is this, if a number gets pressed, it shows on the LCD. If another number is pressed ,the cursor moves over and outputs the next number, same for the third number. Now with this, you can add the backspace if you want.
What you need to do is add the following under "Data[currentCommand++] = key;" in the IF statement //sorry, had to make an edit
lcd.setCursor(6 + currentCommand,0); // you need to insert "currentCommand" to move the cursor over for the next number. lcd.print(Data[currentCommand]);//then print it. Im not sure if this will output garbage, if it does let me know.
It would be a good idea to make a new sketch, copy/paste the working code and test THIS code out with it, rather than modify the one you have now. Reason why is because if this new code dont work, then you have the original code to try again.
Try this as a start.
NOTE, this is compiled, but not tested
|
|
|
|
|
1224
|
Using Arduino / Project Guidance / Re: Entering 3 digits
|
on: December 15, 2012, 07:49:11 pm
|
|
Ok, does the keypad finally work? You have an encoder to input pulses, incrementally. If the keypad data matches the encoder data, it triggers a relay.
What exactly are you making that would require 2 LCD screens, a rotary encoder and a keypad?
I'm just curious, that's all.
|
|
|
|
|
1225
|
Using Arduino / Project Guidance / Re: Servo not working properly
|
on: December 15, 2012, 06:07:14 pm
|
|
Oh and dont forget this, the Ground wire from the motor/servos must also be connected to the GND pin on the arduino, otherwise it won't work properly.
Many overlook that little detail and wonder why it still wont work right.
|
|
|
|
|
1226
|
Using Arduino / Project Guidance / Re: Arduino Nano & Bluetooth Mate Silver project
|
on: December 15, 2012, 05:42:29 pm
|
|
Are you powering the arduino with the Vin? It would be better to power it from the regular plug, and use the 3.3V that the arduino supplies. Of course that would mean a battery with more voltage (7 - 12V) but you would need to buy any regulators.
It's what ever you decide to do, it is your project.
you can always test the bluetooth module with the USB in the arduino, and just power the bluetooth with the 3.3V like that.
|
|
|
|
|
1229
|
Using Arduino / Project Guidance / Re: Turn on lights
|
on: December 15, 2012, 02:41:44 pm
|
|
In another forum post, one person found this, I made a slight modification.
int on=0; If(sensor==HIGH) { // this works
~on; // on !=on should work too
digitalWrite(lights, on ? HIGH : LOW); }
This would be your simple latch.
|
|
|
|
|