Show Posts
|
|
Pages: [1] 2 3 ... 7
|
|
7
|
Development / Other Software Development / Re: Interfacing Arduino and Android using a USB host shield. Testers needed!
|
on: February 24, 2011, 02:29:40 am
|
MicroBridge supports multiple bidirectional connections. The easiest way to get data from the Arduino to the phone/tablet is for your App to listen on a TCP port (using ServerSocket). On the Android side you can do adb_connection * tcpConnection = adb_openConnection('tcp:1234', true, adbEventHandler); And when you have data to send, just write to the connection: uint16_t sensorValue = readADC(0); if (tcpConnection->status == ADB_OPEN) adb_write(tcpConnection, sizeof(uint16_t), (uint8_t*)&sensorValue);
|
|
|
|
|
9
|
Using Arduino / Networking, Protocols, and Devices / Interfacing Arduino and Android using a USB host shield.
|
on: February 21, 2011, 06:34:00 pm
|
I posted this in 'other software development', but I guess this may be a better place. Please accept my sincerest apologies if you've received this message twice  I wrote a library to let an Arduino talk to an Android phone over USB using a USB host shield. Basically I implemented the Android Debug Bridge (ADB) protocol. This lets you set up multiple bi-directional pipes, execute shell commands from the Arduino, and catch logcat messages. The goal is to apply commodity smartphone hardware for robotics, home automation, and the like. http://code.google.com/p/microbridge/
|
|
|
|
|
11
|
Development / Other Software Development / Interfacing Arduino and Android using a USB host shield. Testers needed!
|
on: February 18, 2011, 08:01:24 pm
|
I've developed a C library to allow an Arduino Mega to talk directly to an Android phone over USB using SparkFun's USB host shield. This library will allow you to drive motors, servos, sensors, etc. from your phone. The USB protocol is Android Debug Bridge (ADB), which supports multiple bi-directional pipes. Since ADB is a part of any Android device there is no need to root your phone or install custom drivers for this to work, just enable debugging from the settings menu. If anyone with a USB host shield, an Arduino Mega, and an Android device would be able to test this, I'd be very grateful. Specifically I have been having some stability problems which seem to be electrical, as the phone is trying to charge from the host shield and it may not be outputting enough current  The code is Arduino Mega only right now (that's all I own) but should be trivial to port to the 'smaller' Arduinos, please contact me if you're willing to try to port it for me. http://code.google.com/p/microbridge/
|
|
|
|
|
12
|
Forum 2005-2010 (read only) / Development / Re: Energy Consumed in WSN
|
on: November 17, 2009, 04:02:49 am
|
|
You can read datasheets to get a rough feel for these numbers. It really all depends on what node you're using.
Afaicr our Mica2 clone uses ~0.5mA while in sleep mode, ~5mA in wake, ~12mA receiving, ~15mA sending. I don't really have timings for you on that so I can't really give you an energy budget in terms of joules/bytes.
If you have access to a university network, just try scholar.google.com.
- Niels
|
|
|
|
|
13
|
Forum 2005-2010 (read only) / Development / Nokia LCD shield & Arduino Mega via software S
|
on: September 24, 2009, 05:38:21 pm
|
Hi all, I recently got one of those nifty color LCD screen shield from nuelectronics, and was disappointed to find out it didn't work out of the box because the SPI pins on the Arduino Mega are at a different location. I found some hardware rewiring hacks but I felt a pure software fix would be more elegant. So I fixed the library so that it makes use of software SPI, using pins 10, 11, 12 and 13 for SS, MOSI, MISO and SCK respectively. I'm pleased to say it works like a charm. Basically you'll need to go into PCF8833.h and redefine the pins so that it reads: #define LCD_CS(x) PORTB = (x)? (PORTB|(1<<PB4)) : (PORTB&~(1<<PB4)) #define LCD_CLK(x) PORTB = (x)? (PORTB|(1<<PB7)) : (PORTB&~(1<<PB7)) #define LCD_DATA(x) PORTB = (x)? (PORTB|(1<<PB5)) : (PORTB&~(1<<PB5)) #define LCD_RESET(x) PORTH = (x)? (PORTH|(1<<PH6)) : (PORTH&~(1<<PH6)) #define LCD_BACKLIGHT(x) PORTH = (x)? (PORTH|(1<<PH5)) : (PORTH&~(1<<PH5))
Then in PCF8833.c change the SendColor and SendLCD functions to read void SendLcd_color(unsigned char color) { unsigned char i;
LCD_DATA(LCDData); // set up first bit as command or data
LCD_CLK(0); // Pull Clock LOW LCD_CLK(1); // Pul Clock HIGH
// clock over the byte for (i=0; i<8; i++) { LCD_DATA(color & 0x80); color <<= 1;
LCD_CLK(0); // Pull Clock LOW LCD_CLK(1); // Pul Clock HIGH } }
void SendLcd(unsigned char type, unsigned char dat) { unsigned char i;
LCD_DATA(type); // set up first bit as command or data LCD_CS(0); // Enable device CS
LCD_CLK(0); // Pull Clock LOW LCD_CLK(1); // Pul Clock HIGH
// clock over the byte for (i=0; i<8; i++) { LCD_DATA(dat & 0x80); dat <<= 1;
LCD_CLK(0); // Pull Clock LOW LCD_CLK(1); // Pul Clock HIGH }
LCD_CS(1); }
This was a quick hack and it's late so I may have messed up somewhere, but I think this should do it. Cheers, - Niels 
|
|
|
|
|