Show Posts
Pages: 1 ... 3 4 [5] 6 7 ... 30
61  Products / Arduino Due / Re: Arduino Due libraries (official and 3rd party) on: May 20, 2013, 08:22:33 am
First version of the DueGUI library is now downloadable...


http://forum.arduino.cc/index.php?topic=164788.0
62  Products / Arduino Due / Re: Due GUI on: May 20, 2013, 08:21:51 am
Ok....

This is an ALPHA test version but here is the first downloadable version with early manual:

www.cowasaki.co.uk/DueGUI/DueGUI_manual001.pdf

www.cowasaki.co.uk/DUEGUI_001.zip
63  Products / Arduino Due / Re: Due GUI on: May 18, 2013, 11:48:10 am
Well I've had a useful day with the library.  There was a bug that was corrupting the variables and causing hours of wasted time but I've fixed it now!

Anyway new additions to the working objects list:

addInputBox !!!
drawInputBox
updateInputBox
updateLabel       (automates the sequence..  if variable has changed then remove old value,display new value, update object.
setColorLong           (these new colour commands allow setting of a colour using 1 long int in the form 0xFFFFFF where value is 0xRRGGBB
setBackColorLong          having it as one value makes it easy to have presets such as clrBlack,clrBlue,clrYellow etc)

This scrolls the screen up so that the object is visible in the top half of the screen and displays a keyboard at the bottom half of the screen.  The keyboard is definable with a caps key and a symbol key allowing 3 full 52 key keyboards.

So we are nearing the point where it is alpha testable.....

I need to write a manual for it first but as my code is very heavily remarked that will make it much easier.

There are still parts not finished but I will highlight those in the manual.....
64  Using Arduino / Programming Questions / Re: delay() & equivalent not working. on: May 18, 2013, 11:38:52 am
Sorry, posting 5500+ lines of code would have been silly when this was more out of interest than anything else.  Someone was able to come up with the solution without the code.  I am more than happy to jump in and help others and usually the code is necessary but on this occasion it would have been ott.

I'm certain that it would have been possible to demonstrate the problem in considerably less than 5500 lines of code. Just the act of doing so would probably have been enough for you to spot the problem on your own. In any case, posting a minimal sketch that actually demonstrated the problem would have avoided relying on some inspired guesswork by majenko and would have avoided everyone else looking at this thread from wasting time trying to guess what you were doing. If you had posted a short sketch demonstrating the problem, it would have been blindingly obvious what was causing it.

I'm sorry but as I didn't know what was causing the problem it makes building a small sketch that recreates the problem quite difficult!

It just seemed odd really and knowing that interrupts stop delay() and millis() working would have made the process of finding the problem instant hence another member knowing what the likely issue was. 

Like I said, the library was never going to keep the delay in anyway so writing the rest of that function negated the need for it but I was curious as to why it was happening.


Anyway I now know what the issue is and anyone reading this will do too so it has been a useful excursion from what I am doing.
65  Using Arduino / Programming Questions / Re: delay() & equivalent not working. on: May 18, 2013, 06:19:35 am
You're not using delay() or millis() from within an interrupt are you ...?

Yes, a slow one. Didn't know that was an issue but it does make sense thanks.
delay() checks the return value of millis() against a timeout value.  millis() returns the value of a counter variable.  That counter variable is updated once a millisecond by a timer driven interrupt routine.

That interrupt routine cannot run while you are in your interrupt routine, so the counter never increases.

Interrupt routines should be kept as short as possible so that other interrupts have a chance to fire.  The "proper" way of doing what you want is to set a flag (and maybe a couple of variables - x/y coordinates for example) in the interrupt routine, and then watch for that flag being set in the main loop.  Only in the main loop would you do slow and intensive operations like drawing widgets on a screen.

You need to separate the "capturing" of the event and the "reacting to" the event.  The capturing is done in the interrupt by setting a flag that says this event has happened.  The reacting to is done in the main loop by it realising that the event happened recently, so it does what is needed.  The capturing wants to be instant and reliable (interrupt) but the reacting to can be slightly delayed by a few milliseconds without any adverse consequences (and maybe not even being noticable) - the event has already been captured.

Thanks for your reply but I actually already understand all this anyway.  My interrupt handler is very short and uses its own interrupt on the Due (checked beforehand to make sure it was clear), if it detects an event it needs to deal with then it halts the interrupt whilst it updates the screen etc then restarts it.


Thanks to everyone who tried to help but majenko got it..


the only thing here I didn't realise was that delay() and millis() didn't work inside an interrupt. 

millis() could have been updated by another interrupt hence me trying to use the loop alternative myself to see if delay() was the issue.

It was only done like this as a quick kludge to check the display before connecting the process to the on button press and on button release events.
66  Using Arduino / Programming Questions / Re: delay() & equivalent not working. on: May 18, 2013, 06:10:59 am
You're not using delay() or millis() from within an interrupt are you ...?

Yes, a slow one. Didn't know that was an issue but it does make sense thanks.
So you're starting to realize why most people ask you to post all of your code rather than just what you think is the problem?

Sorry, posting 5500+ lines of code would have been silly when this was more out of interest than anything else.  Someone was able to come up with the solution without the code.  I am more than happy to jump in and help others and usually the code is necessary but on this occasion it would have been ott.
67  Products / Arduino Due / Re: Due GUI on: May 17, 2013, 08:02:03 pm
I have a full qwerty keyboard with number pad very nearly finished. This will be for text input boxes. I am hoping that it will be in a fit state to go out for alpha testing within the week. There are dozens of functions added and a demo program which shows them in action. All the object orientated stuff works via an interrupt which is added by the library so you can even end up with the loop function empty! 

Anyway will update with more pictures etc soon.
68  Using Arduino / Programming Questions / Re: delay() & equivalent not working. on: May 17, 2013, 07:56:40 pm
You're not using delay() or millis() from within an interrupt are you ...?

Yes, a slow one. Didn't know that was an issue but it does make sense thanks.
69  Using Arduino / Programming Questions / Re: delay() & equivalent not working. on: May 17, 2013, 07:31:10 pm
The sketch stopped at the delay. Its all working now as the delay was only there as a temporary measure.

I just thought it a little strange.

The whole sketch compiles to 64k so probably a bit much listing it all smiley-grin
70  Using Arduino / Programming Questions / Re: delay() & equivalent not working. on: May 17, 2013, 02:10:01 pm
No it's not really part of my code at all! It was a quick hack to replace the delay() function to see why it was happening! 

I'm still writing it at the moment and it now works because I now change the key top colour until the user takes the stylus away then change it back so it is working without the delay bit.....  The delay bit was only there to test the colour bits and was never staying.  It just seemed weird that it would do that at all!
71  Using Arduino / Programming Questions / [sorted] delay() & equivalent not working. on: May 17, 2013, 01:50:58 pm
I'm writing a library at the moment and wanted to change the colour of an object when pressed....

The following function draws a key and by changing the cap colour and text colour it has the appearance of being pressed:

calckey(key number,clrWhite,clrBlack);

The function works perfectly now if I do the following:

calckey(key number,clrRed,clrWhite);
calckey(key number,clrWhite,clrBlack);

It displays the key in red then straight away in white, so fast that you can barely see it in red (as you would expect)....

So now to what I would have done:

calckey(key number,clrRed,clrWhite);
delay(15);
calckey(key number,clrWhite,clrBlack);

The sketch locks up at the delay....  so I tried:

calckey(key number,clrRed,clrWhite);
unsigned long int=now;
while (millis()<now+20){};
calckey(key number,clrWhite,clrBlack);

it also crashes !

any ideas??

confused.com


72  Using Arduino / Displays / Re: Can this Sure GLCD use Arduino library on: May 17, 2013, 07:32:46 am
And all the connections are as per the above table? Does the lcd light up?
73  Using Arduino / Displays / Re: Can this Sure GLCD use Arduino library on: May 17, 2013, 06:39:12 am
What board/IC are you using?
What version of the IDE?
What date/version of the library?
74  Products / Arduino Due / Re: Due GUI on: May 15, 2013, 11:12:54 am


Hi and Many thanks for your extensive efforts -

is there any downloadable form or repository where i can download the files for testing and verifying - would be great as you really hit the spot by combining the essential libs to one Gui tooolbox
i'm thinking about an Dali based lighting control with an Due and 5" touch display which i will put on the playgroud once i have everything put together - your toolbox would be very helpfull for this project.

Kind regards, Mike

I have got checkboxs and a variant of them called cycleboxs working.  I am just working on an input box for text and will then release a downloadable version for testing whilst I finish the other planned bits.I have a demo running here that has three pages and allows people to switch between them and keep the variables consistent etc.  The input box effectively scrolls up the part of the screen with the input and creates a keyboard across the bottom half of the screen so quite a bit of work...  I will also be adding the option of PS2 and bluetooth keyboard support etc but that is for later.......
75  Using Arduino / Programming Questions / Strange problem with library... on: May 13, 2013, 01:12:59 pm
I am working on a library that was working fine yesterday evening but I wanted to change the name so first I backed up the whole library folder by selecting it and zipping it up and then messed with it but kept getting errors so I deleted the folder and reverted to the backup by unzipping the folder back to it's original place (this is a quick backup method I use regularly)

BUT

I am now getting errors which are silly!

This is an example of a call on the current version of the library:

Code:
DueGUI.addPanel(0,0,799,50,clrBlue,clrWhite,clrWhite,2,"Board   control   menu",280,8,BVS_34,visible,URNnull);
The final attribute "URNnull" was added yesterday but it was working for hours after being added....

Following being restored from the backup I am now getting the errors (actually I am getting pages of errors in pairs for each call, this is the pair relating to the 1st error):

Code:
/Users/darren/Documents/Arduino DUEGUI/libraries/UTFT/UTFT.h:294: error: expected ',' or '...' before numeric constant
AND

Code:
DueGUI_demo_01:178: error: no matching function for call to 'UTFT::addPanel(int, int, int, int, int, int, int, int, const char [23], int, int, int, int, int)'
/Users/darren/Documents/Arduino DUEGUI/libraries/UTFT/UTFT.h:301: note: candidates are: int UTFT::addPanel(word, word, word, word, long int, long int, long int, byte, String, int, int, int, bool)

My call in the sketch is calling "addPanel" with 8 ints a string and 5 ints BUT the compiler thinks that the corresponding line in the h file only has 8 ints, a string and 4 ints......

It DID the day before but since last night it has had 5 ints following the string.

The actual line in the h file is:


  int     addPanel(word x,word y,word xs,word ys,long colour,long borcolour,long textcolour,byte borwidth,String top,int xo,int yo,int font,bool visible,int URN);


and the corresponding line in the cpp file is:


int UTFT::addPanel(word x,word y,word xs,word ys,long colour,long borcolour,long textcolour,byte borwidth,String top,int xo,int yo,int font,bool visible,int URN){


This makes no sense as it all worked before.....


So I installed the IDE on another fresh computer this time running Windows7 rather than MacOS and with a completely fresh install I get the SAME issue!

I thought that it might be looking at an old file but if I go to the latest h file and insert a lot of lines before the error the line number of the error increases so the IDE is looking at the right file.


IF I remove the final attribute from the definition in the sketch, h file and in the cpp file the first error:

/Users/darren/Documents/Arduino DUEGUI/libraries/UTFT/UTFT.h:294: error: expected ',' or '...' before numeric constant

Stays but the other one goes away.....


This was working perfectly earlier and it's not now....  I cannot understand what on earth is wrong with it.
Pages: 1 ... 3 4 [5] 6 7 ... 30