I have some ideas on how to do this a lot better, just not the time yet...
No problem I'd try to help but the Pasm is a bit over my head at the moment and hard for me to follow what's going on with that bit of code, having tried already to gain control through changing the spin portions of code without success.Thanks for your help so far.
I might have a look at jazzing up the slideshow in the meantime now I have the knowledge to utilise controls.
@Rayman Looking at the schematics for the QMP I'm not absolutely sure what I/O are unused, I think P6 is but not sure what else is, also do any unused I/O's come out onto the QMP board for use? For a project in mind I need at least two spare I/O's.
If not it's not a problem as the quickstart has the extra connections to the I/O's it's just knowing whats unused really.
P8 through P15 are completely free. You can also use the I2C bus on P28 and P29 for other things. Also, P30 and P31 could be used if need be although these are used for programming. If you don't need the uSD card, you could use it's pins too...
Thanks Rayman, One more question, I thought I had worked out the coordinate thing by using the commented out line to map the buttons, I'm creating a new screen with buttons for another project but when I tried to draw a rectangle in the correct place I'm having all sorts of problems with size and position, must have been lucky when mapping out the buttons on the wav player project?
I have sent the touchx and touchy coords to the PST and when holding the QMP in landscape with the home,email icons to the left then top left is 0,0 (x,y) and bottom right is 320,240 as expected what I am having trouble with is what is x1,x2,y1,y2 in relation to the screen as what I thought is not correct.
If possible please could you show a diagram of those coords for the rectangle as I've tried all sorts of combinations but am getting no where, thanks for your help
This is with the landscape driver so top-left corner of visible screen is (x=0,y=0) and bottom-right corner is (319,239).
If I remember right, (x1,y1) would be the top-left corner of the button you want to make and (x2,y2) would be the bottom-right corner of that button.
So, it expects x2>x1 and y2>y1
That's what I was thinking , I touched the screen at the top left of where I wanted the button got the coords and entered them accordingly for x1 and y1 in the Dat section
I touched the bottom right of where I wanted the button and put those coords in x2 and y2
X2>X1 and Y2>Y1 as you say,
the rectangle drawn ends up long in width and drawn to the left of where I expected an approximate square given thickness and inexact positioning of the stylus used.
could the x1 x2 y1 y2 positions in the DAT section be wrong?
The code is identical to the wavplayer code regarding the DrawRectangle line and the define buttons DAT section (with new coords).
When touching the top left and bottom right of the "Play" button square from the wav player code , I get almost the coords of the ones you placed in the DAT section bar stylus,position errors as above.
The error comes when I touch to the right and above centre of the screen: touchx (241) touchy(48) Top left of where I want the square and touchx(287) touchy(82)bottom right of the square, this is an approx square but the drawn rectangle is long horizontally and to the left of where I want it.
This suggests I may be putting the wrong values in place of the x1, y1,x2,y2 which were in the DAT line for the original play button , could the original rectangle have been rotated somewhat or other so the x1 y1 corner is not where expected and same with the x2,y2 corner?
Or could it be the touchx and touchy coords are not corresponding to the expected inputs for the DAT line of code?
I've attached the code as is, which is a stripped down version of the wavplayer code and the bitmap for the new screen, I'm basically trying to map the two red triangles (Up and Down), the code increments and decrements a byte value from 0 to 255 and works fine when I used the Wav Player controls (lower part of screen) Playbutton for UP and Stopbutton for Down, it's basically the mapping of the new area of the screen that's causing problems.
As you will see the rectangle drawn is horizontally long, I just can't understand where i'm going wrong.
Thanks as always for helping me with the problems.
Thanks Rayman, I will try it out tomorrow as I have to redesign a button in the original area >255 because I had moved everything <255.
As a matter of interest and information, did you change anything apart from the keypad program, I noticed you made the word changes there and I'm almost certain I did those same changes myself but it didn't work for me, I changed the byte references to word in the DAT define button section and also in GetButtons unless you changed something else elsewhere?
I'm having problems with the lcd.DrawString command with my project, in the wavplayer program you use the command to print the filename that's playing to the screen using the variable j as in :
lcd.DrawString(50,120,j)
coordinates may be different just using for example, printing j is not a problem as it is a string
the problem i'm having is I have a variable long storing a number which can be 1 or 100 or 1000 or any value between(using a long as i'm sharing the variable with other objects)
When I use the LCD.Drawstring command I get spurious characters, so the question is how do I convert the number stored in the variable into a string that I can put in the LCD.Drawstring command?
When I use the LCD.Drawstring command I get spurious characters, so the question is how do I convert the number stored in the variable into a string that I can put in the LCD.Drawstring command?
Short of writing your own conversion you could use the Simple_Numbers object (comes with the PropTool). Its dec method takes a long and returns the buffer/string address where the converted number is stored. This is then fed into any matching string print method.
@william chan Yes it comes complete with touchscreen as in the photos in post #1 of this thread, it's a great compact screen, I love it!
Rayman has many examples of code to use with it on the website shown in post #1
I have tinkered a bit with Rayman's code objects to accomplish several things in a very short time, so I would say it's ideal for beginners using the propeller like myself.
@kureneko That worked brilliantly! Thank you very much, The programming side of the project is almost complete just needs a bit of tweaking of the display and layout
then just the interface hardware to sort out.
William, QMP comes with the display, it's actually directly soldered to the board. Maybe I should be more explicit about that in the description...
I might mention one update though. I've run out of my original display supply and Newhaven stopped selling that version.
But, (and this is what I love about Newhaven) the new version is pin compatible with the old version.
So, it's not a big deal, but now there are two drivers, one for the original version and one for the new version.
To the programmer, but drivers work exactly the same way.
skylight, glad to hear everything is working out.
I'm in the airport right now, on my way to the Expo...
skylight, there is a virtual text disply mode in the driver. You start it with the "StartText" function.
Then, you can use the dec, bin, and hex functions to show numbers.
But, I not 100% sure what happens if you try to do this and graphics at the same time. It may or may not do what you want...
Glad kuroneko helped, I've been busy making parts to sell at the expo today...
William, you've just reminded me that I have some work to do...
I need to provide an updated version of QMP_TV that works with the new driver...
For now, you might try skylight's keypad code in post #103 or the waveplayer with screen buttons posted earlier.
This will demo how to use the touchscreen.
Just replace the old driver with the new one to make it work...
Ok, that's what I get too... I forgot you'd need to copy this bitmap file to uSD card for it to work... FrLitD.zip
Just tested and with that bmp file on uSD, it sorta works.
Not a terribly good demo though... Up button works, but down button is actually out it the middle of the screen somewhere...
Sorry, I am not sure what I did wrong.
After placing the bmp file on the uSD card, that bitmap now appears on screen, but no numeric buttons appear. : (
Touching the screen everywhere gave no visible responses.
@William Chan the keypad version I posted some time back was a very early experiment , I was having trouble mapping the two arrow buttons but if you read on Rayman helped sort that out.
Here is a bitmap of an earlier half sized keypad I produced:
The mapping was not utilising the whole screen due to the limitations of using a byte variable instead of a word variable ie coordinates beyond 255 were not possible, as the display is 320x240 it needed a word variable to be able to map the whole screen and now works great. see post #103 (coordinates havn't been changed so as Rayman says the buttons need remapping).
If you wish to create a keyboard then here are a good collection of buttons and icons that you can reduce in size to make a keyboard, then you just have to map out the keys in the define keys dat section of the keypad.spin program.
use zoner photo studio to resze the buttons, this program is excellent as it allows the user to easily manipulate the bitmaps and gives coordinates which makes it a doddle when mapping the buttons.
Comments
I might have a look at jazzing up the slideshow in the meantime now I have the knowledge to utilise controls.
If not it's not a problem as the quickstart has the extra connections to the I/O's it's just knowing whats unused really.
I have sent the touchx and touchy coords to the PST and when holding the QMP in landscape with the home,email icons to the left then top left is 0,0 (x,y) and bottom right is 320,240 as expected what I am having trouble with is what is x1,x2,y1,y2 in relation to the screen as what I thought is not correct.
If possible please could you show a diagram of those coords for the rectangle as I've tried all sorts of combinations but am getting no where, thanks for your help
If I remember right, (x1,y1) would be the top-left corner of the button you want to make and (x2,y2) would be the bottom-right corner of that button.
So, it expects x2>x1 and y2>y1
I touched the bottom right of where I wanted the button and put those coords in x2 and y2
X2>X1 and Y2>Y1 as you say,
the rectangle drawn ends up long in width and drawn to the left of where I expected an approximate square given thickness and inexact positioning of the stylus used.
could the x1 x2 y1 y2 positions in the DAT section be wrong?
The code is identical to the wavplayer code regarding the DrawRectangle line and the define buttons DAT section (with new coords).
When touching the top left and bottom right of the "Play" button square from the wav player code , I get almost the coords of the ones you placed in the DAT section bar stylus,position errors as above.
The error comes when I touch to the right and above centre of the screen: touchx (241) touchy(48) Top left of where I want the square and touchx(287) touchy(82)bottom right of the square, this is an approx square but the drawn rectangle is long horizontally and to the left of where I want it.
This suggests I may be putting the wrong values in place of the x1, y1,x2,y2 which were in the DAT line for the original play button , could the original rectangle have been rotated somewhat or other so the x1 y1 corner is not where expected and same with the x2,y2 corner?
Or could it be the touchx and touchy coords are not corresponding to the expected inputs for the DAT line of code?
I've attached the code as is, which is a stripped down version of the wavplayer code and the bitmap for the new screen, I'm basically trying to map the two red triangles (Up and Down), the code increments and decrements a byte value from 0 to 255 and works fine when I used the Wav Player controls (lower part of screen) Playbutton for UP and Stopbutton for Down, it's basically the mapping of the new area of the screen that's causing problems.
As you will see the rectangle drawn is horizontally long, I just can't understand where i'm going wrong.
Thanks as always for helping me with the problems.
Same thing for the "GetButton" routine...
Problem is that with x coordinates >255 are bigger than can fit in a "byte"...
That explains why it worked for the original button but not the new place on the screen.
Maybe the i2c driver needs it's byte references changed also?
Not a problem meantime as I can keep all buttons coords beneath 255 on the screen, but it might get a bit condensed.
I'll try to look at this tomorrow and fix that bug...
Keypad - Archive [Date 2013.04.21 Time 16.01].zip
As a matter of interest and information, did you change anything apart from the keypad program, I noticed you made the word changes there and I'm almost certain I did those same changes myself but it didn't work for me, I changed the byte references to word in the DAT define button section and also in GetButtons unless you changed something else elsewhere?
I'm having problems with the lcd.DrawString command with my project, in the wavplayer program you use the command to print the filename that's playing to the screen using the variable j as in :
coordinates may be different just using for example, printing j is not a problem as it is a string
the problem i'm having is I have a variable long storing a number which can be 1 or 100 or 1000 or any value between(using a long as i'm sharing the variable with other objects)
When I use the LCD.Drawstring command I get spurious characters, so the question is how do I convert the number stored in the variable into a string that I can put in the LCD.Drawstring command?
Short of writing your own conversion you could use the Simple_Numbers object (comes with the PropTool). Its dec method takes a long and returns the buffer/string address where the converted number is stored. This is then fed into any matching string print method.
Does the QMP come with the 2.4" touchscreen or do we have to purchase the touchscreen separately?
@william chan Yes it comes complete with touchscreen as in the photos in post #1 of this thread, it's a great compact screen, I love it!
Rayman has many examples of code to use with it on the website shown in post #1
I have tinkered a bit with Rayman's code objects to accomplish several things in a very short time, so I would say it's ideal for beginners using the propeller like myself.
then just the interface hardware to sort out.
I might mention one update though. I've run out of my original display supply and Newhaven stopped selling that version.
But, (and this is what I love about Newhaven) the new version is pin compatible with the old version.
So, it's not a big deal, but now there are two drivers, one for the original version and one for the new version.
To the programmer, but drivers work exactly the same way.
skylight, glad to hear everything is working out.
I'm in the airport right now, on my way to the Expo...
Then, you can use the dec, bin, and hex functions to show numbers.
But, I not 100% sure what happens if you try to do this and graphics at the same time. It may or may not do what you want...
Glad kuroneko helped, I've been busy making parts to sell at the expo today...
What does it take to make the Paint program work with the new ili9340 lcd?
The first demo does not show how to use the touch function.
William
I need to provide an updated version of QMP_TV that works with the new driver...
For now, you might try skylight's keypad code in post #103 or the waveplayer with screen buttons posted earlier.
This will demo how to use the touchscreen.
Just replace the old driver with the new one to make it work...
I loaded the keypad program ( with the new 2d driver ) but all I got was a blank red screen.
The QMP_GfxDemo program works well.
FrLitD.zip
Just tested and with that bmp file on uSD, it sorta works.
Not a terribly good demo though... Up button works, but down button is actually out it the middle of the screen somewhere...
After placing the bmp file on the uSD card, that bitmap now appears on screen, but no numeric buttons appear. : (
Touching the screen everywhere gave no visible responses.
Here's a very basic paint demo for you:
QMP_Paint2 - Archive [Date 2013.05.22 Time 06.37].zip
Needs polish, but it works...
@William Chan the keypad version I posted some time back was a very early experiment , I was having trouble mapping the two arrow buttons but if you read on Rayman helped sort that out.
Here is a bitmap of an earlier half sized keypad I produced:
Example Keypad.bmp
The mapping was not utilising the whole screen due to the limitations of using a byte variable instead of a word variable ie coordinates beyond 255 were not possible, as the display is 320x240 it needed a word variable to be able to map the whole screen and now works great. see post #103 (coordinates havn't been changed so as Rayman says the buttons need remapping).
If you wish to create a keyboard then here are a good collection of buttons and icons that you can reduce in size to make a keyboard, then you just have to map out the keys in the define keys dat section of the keypad.spin program.
http://icons.mysitemyway.com
use zoner photo studio to resze the buttons, this program is excellent as it allows the user to easily manipulate the bitmaps and gives coordinates which makes it a doddle when mapping the buttons.
http://download.cnet.com/Zoner-Photo-Studio/3000-2192_4-75186165.html