Show Posts
Pages: [1]
1  Using Arduino / Displays / Re: Does STRLIST in m2tklib support Touchscreen? on: June 19, 2013, 03:54:29 pm
I try to make STRLIST aware of the "t1" option for the next release. Still you need the TSK elements to scroll to elements, which are not visible on the screen. I mean, once implemented "t1" will only apply to the visible elements of STRLIST. I do not have a good idea how to solve this without TSK elements...

Makes sense. That seems like it would cover most use cases pretty well, and I think it would be pretty intuitive for a user that tries to tap on an item in a list. When the list is > 1 item long, anyway. If only 1 item is shown, somebody might think that tapping on it would be what allows them to change it, rather than selecting it.

What I have right now is a 4-line STRLIST with a PREV, NEXT, and SELECT button to the right. The PREV and NEXT buttons scroll one item at a time. Since this is the only way to select an item, this makes perfect sense. When STRLIST becomes t1-aware, it might make sense for the NEXT/PREV buttons to be able to do a page-up/page-down function, since you can already select any of the 4 visible elements by tapping. I'm not sure if this would be possible/easy at all, I'm just speaking from a UI standpoint. Maybe there's a way to link an element to a variable to increment/decrement the _first variable by the height of STRLIST?

Great work!
2  Using Arduino / Displays / Re: Does STRLIST in m2tklib support Touchscreen? on: June 19, 2013, 02:59:48 pm
Thanks for the amazing fast response!

I was just coming back to update that I did exactly that - implemented touchscreen buttons for UP/DOWN/SELECT and got rid of the VSB. The only thing that is not intuitive is that the list itself cannot be tapped to select an item - you have to scroll to it and then press the select button. Thanks for the fast update!
3  Using Arduino / Displays / Does STRLIST in m2tklib support Touchscreen? on: June 19, 2013, 01:13:48 pm
I have m2tklib set up with a DOGL128 LCD (64x128, resistive touchscreen, uses u8glib). It's working fine with the touchscreen examples, so I know I have things wired up properly and the library set up and working.

I modified the Touchpanel example code to use a GRIDLIST instead of VLIST, and that worked fine.

I'm now trying to get dynamic menus working. The way the example code is written, the menu strings are all hard-coded. To get a dynamic string, it looks like I will need to use something like STRLIST.

Problem is, the STRLIST examples all use the button-based inputs. I'm trying to use the touchpad input and having limited success.

I modified the constructor call to use the touchpad event handler and event source handlers: m2_es_touch_screen and m2_eh_ts (also tried m2_eh_6bsts and m2_eh_4bsts). I'm seeing the cursor registering on the screen when I press, but the UI is nonfunctional.

Does SRTLIST not work with a touchscreen input? Or am I missing something critical with how to use the different input types? Thanks for any help!


I made a little progress when I found the Touchscreen Tutorial here:
I still do not have it working, however. I'm thinking that perhaps the VSB element does not work well with a touchscreen, either, as there's only an increment and no decrement
4  Using Arduino / Networking, Protocols, and Devices / Re: How to get the JY-MCU bt board to work on: October 11, 2012, 01:20:14 pm
I have not got it to connect again since that once.  RealTerm gives "apro exception." on one of the ports, and the other port just lags and doesn't work in either direction.  Now I removed the device and re-added it, and I have no serial ports.  I hate BT!  Have you others really got this to work reliably?  Maybe I need a different BT dongle?

I've never had much luck with Windows and Bluetooth in general. I've had zero issues at all with using this module with Android devices, though. I've been doing a burn-in test for the last 2 days with one, actually. I've just left it running and connected to it from my tablet and phone sporadically to see that it will still accept a new connection. So far so good, it's been quite reliable. I've also just left it connected for a few hours at a time and it seems to keep the connection without any problems.

I think the module is best left as a serial communication terminal, though, rather than as the primary connection to the arduino for programming. For that reason, I attached mine to a SoftwareSerial port (or on the Mega, I just used one of the non-primary serial ports).
5  Using Arduino / Networking, Protocols, and Devices / Re: How to get the JY-MCU bt board to work on: October 09, 2012, 11:23:29 pm
I got my JY-MCU, but can't get it to work.

Wired with 5V @ 8A going in to Arduino VBus, BT, and 100 pixel LEDs.  Pixel data on D4, TX/RX swapped from BT to Arduino (tried both ways).

1) When powered, red light on it blinks continuously even with TX/RD unplugged, always, never seen any change.

2) When paired I get 2 serial ports: "Com11 - SSP" and "Com12 - SSP (Dev B)". Windows lets me enable or disable 12 in BT settings.  11 is always only in device manager.

3) When I try to open either port (at 9600), term program locks up for a few seconds, then says it is open but it doesn't work.

Seller said board default was 9600.  I was hoping I could just plug this in and do everything (re-program Arduino, send bytes to change LED colors) the exact same as when I connect my TTL board to the same 4-pins and use a cable.  The whole thing is installed on my roof, so I'd rather not have to send any AT commands while unpaired or any of that stuff, but I guess I could just pull the BT and connect it to my TTL if I have to.

Any suggestions?  Which of the 2 serial ports is right?  Is the red light supposed to blink no matter what?

Blinking red light is what I see as well, even with nothing attached to TX and RX. I think the light may change when it goes into command mode, but I don't recall offhand.

I haven't tried to reprogram an Arduino over the bluetooth serial link, but I don't see any reason why it wouldn't work.

I think your best bet is to get the Bluetooth module working on its own before trying to incorporate it into your project. The sketch I wrote should be able to configure the module to whatever you specify, regardless of what the default configuration is. From there, you can test it out with a simple "Hello World" kind of sketch and a Bluetooth terminal on the PC. The module will keep that configuration forever, so once you set it up once and get it working, you can just drop the module into the project on the roof and it should just work.
6  Using Arduino / Networking, Protocols, and Devices / Re: e-bay Blue tooth module on: September 10, 2012, 01:21:05 am
They should work great!

Here's some EXTREMELY rough and hard-coded example code for sending serial to one of those modules from the Android side. I just happened to be working on that exact thing tonight!

private static final UUID SPP_UUID = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB"); // Very important - has to be this for SPP to work

BluetoothAdapter mBluetoothAdapter = null;
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
String address = "00:12:03:27:50:44"; // Hard-coded to match my module - you'll probably want to actually be able to select a module from a list
BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(address);
String message = "Thing To Send";
byte[] send = message.getBytes();
BluetoothSocket btSocket = null;
OutputStream btOutputStream = null;

try {
  btSocket = device.createInsecureRfcommSocketToServiceRecord(SPP_UUID);
  btOutputStream = btSocket.getOutputStream();
catch (IOException e) {

7  Using Arduino / Networking, Protocols, and Devices / Re: e-bay Blue tooth module on: September 09, 2012, 03:00:40 pm
That JY-MCU bluetooth module is a pretty good choice. I have a couple of those and they work great.

I got mine from here, but it's probably the same or very-similar hardware:

What are you going to be doing with them? This device is a simplified slave-only serial module. You set up the name, pin, and baud, and that's all. You need to use a master-mode bluetooth module to connect to it (an Android, PC, or different piece of hardware). You cannot connect two of these modules to eachother wirelessly (they don't have any way to scan or connect to another device, they just accept connections).
8  Using Arduino / Networking, Protocols, and Devices / Re: How to get the JY-MCU bt board to work on: September 09, 2012, 10:44:00 am
I just wrote up an Arduino sketch that configures this module if that is helpful to anyone.,122070.0.html
9  Using Arduino / Networking, Protocols, and Devices / Utility to configure JY-MCU module (inexpensive bluetooth serial) on: September 09, 2012, 01:57:41 am
For $8.60, you can buy a very simple Bluetooth serial module that works great with Arduino. It uses 4 pins: GND, VCC, TX, and RX, and has a very simplified configuration of only Name, PIN, BAUD. With a device like this, you can do simple bi-directional serial over bluetooth with a PC or Android phone easily. BlueTerm is an Android Bluetooth Serial Terminal app that works quite well. You can also interface to Bluetooth Serial in native Android applications if you want to easily interface an Arduino with an Android on the cheap (Bluetooth SPP is supported by a LOT of Android devices!)

I wrote this utility to easily configure the NAME, PIN and BAUD of the module. Once they are set, they are stored in firmware and you won't need to set them again.

NOTE: You probably do not want this configuration to be a part of the actual Arduino application - If there is an active Bluetooth connection, these configurations will fail. Better off to just set it and forget it.

This is written to run on a Mega (multiple serial ports), but can probably be modified to run on a board with a single serial port by removing all the logging and just using the single port, but it will be much harder to debug problems, of course. Since you only need to run this once and the settings will be saved, if you have access to an Arduino with a secondary serial port, just use that to configure it and then transfer it to the target single-serial system.

Hope somebody else finds this useful!

Here's a link to the device I'm referring to:
10  Using Arduino / Installation & Troubleshooting / Re: Arduino 1.0, Ubuntu 10.10, and Mega2560 on: February 28, 2012, 01:48:11 pm
Ubuntu 11.10 might not work, either. I've been asking around in the #arduino channel on to see if anyone was able to use the Mega2560 with Arduino 1.0 with any kind of 64-bit linux at all. I found zero people - unless you count the people that claimed they were, but then realized they were not using a Mega or not using linux.

I did eventually get it working in Gentoo, once I got the exact correct combination of versions in the cross-compiler. See if you can find some way to install the AVR versions of GCC 4.6.2, LibC 1.7.1 and BinUtils 2.21 and the 2.2 release of rxtx in either Ubuntu 10.10 or 11.10. That was the magic combination to get my Mega 2560 to work with Gentoo. I suspect the same will be true for any 64-bit Linux.

That is the ONLY combination I found that worked. GCC < 4.4 will not even try to upload to the Mega 2560, as it is not supported. GCC < 4.6.2 appears to work fine but exhibits that serial problem. libc 1.8.0 deprecates functions that arduino is still using. rxtx < 2.2 won't be able to use /dev/ttyACM0 (but you can symlink it to a name that it can use, like ttyUSB0 as a workaround - or set up a udev rule to do it). Not sure what the deal was with binutils.
11  Using Arduino / Installation & Troubleshooting / Re: USB communications on mega 2560 on: February 28, 2012, 01:35:06 pm
I fixed my problem. Arduino is apparently VERY picky when it comes to the cross-compile environment.

If you use GCC < 4.4, you cannot program for the Arduino Mega 2560. If you use GCC 4.4 <= ver < 4.6.2, you get that serial issue. Only 4.6.2 works as far as I have been able to find (I tried a lot of combinations!)

Additionally, libc MUST be version 1.7.1. Version 1.8.0 deprecates some functions that arduino uses. Binutils needed to be 2.21.1-r1 (2.22 didn't work for some reason).

In Gentoo, this is a solvable problem. Somebody else posted the same solution, and it's the same solution I somewhat-independantly came up with:,93672.0.html

I don't know about ubuntu. Perhaps find those versions of avr-gcc, libc, and binutils in ubuntu?
12  Using Arduino / Installation & Troubleshooting / Re: USB communications on mega 2560 on: February 22, 2012, 03:51:31 pm
I was about to post about this exact same problem, but I wanted to do some more testing first.

Gentoo Linux, Arduino 1.0. Very simple serial code fails exactly the way you describe - Serial works from PC to Arduino, but Arduino cannot send it back.

Same exact board plugged into a windows PC is able to load the same exact test code and it works fine.
Pages: [1]