I wanted to use the tablet power supply to power the arduino via the usb connection.
The tablet is configured to use an OTG cable which sets the tablet as host.
I wrote a small application to use the tablet as a display. My code makes use of the core usb application.
The project code is in the download package. I use eclipse indigo with android 3.1 SDK.
If you have this or better you can upload the application to your tablet.
I send a set of bytes to the tablet to select the drawing function required. I only chose a few
but the full range of the android graphics is available.
If you don’t have this I published the application in the google play store.
It’s free no adds just search “Arduino Usb Android Display”.
The Arduino code is in a library class and has 6 functions.
canvas.setPaint(int wide, byte red , byte green , byte blue, byte style)
//wide - width of brush, style 0 = stroke 1 = fill
canvas.setText(String text)
//text string up to 8 characters
canvas.drawLine(int Xstart, int Ystart, int Xstop, int Ystop)
canvas.drawRect(int left, int top, int right, int bottom)
canvas.drawCircle(int Xcenter, int Ycenter, int radius)
canvas.drawText(int Xstart, int Ystart ,int TextSize
Using a DHT11 temperature/humidity sensor I put together a project.
The temperature and humidity are displayed for a 24 hour period.
The graphed data is fitted between the min and max values.
Two points of interest:
Very large letters and graph are used as its designed to be viewed from a
distance in a sitting room.
The speed limitations of the base Serial-USB program are seen with
the graph taking some 20 seconds to produce.
Though for this application with new samples taken once every 3 minutes
its quite a nice affect.
Forget about animation though.
The code is at the same download location as TempHumidDisplay.zip
I also put it into the canvas library as an example.
The speed limitations of the base Serial-USB program are seen with
the graph taking some 20 seconds to produce.
This I believe is more a limitation of an arduino clocked at only 16MHz which means that ANY I/O opp can't be any faster than 1/2 fclk, unless of course its a RISC arch, which case you might be able to achieve 1/1 fclk I/O opp.