Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Picture Rotate
Goto page 1, 2  Next
 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
MichaelB.

Bascom Member



Joined: 04 May 2017
Posts: 26

germany.gif
PostPosted: Sun Apr 07, 2019 2:12 pm    Post subject: Picture Rotate Reply with quote

Is there any Command to rotate ,for a 128x64 KS108 Display, a .Bfg file 90 degrees to left oder right or even 180 degrees?

(BASCOM-AVR version : 2.0.8.1 )
Back to top
View user's profile
Duval JP

Bascom Member



Joined: 22 Jun 2004
Posts: 827
Location: France

france.gif
PostPosted: Mon Apr 08, 2019 9:47 am    Post subject: Reply with quote

I followed the threads of discussions on the KS108, and I wonder if it is really necessary to use this old display.
On the market, at very low prices, you have color displays (touch or not) with very rich libraries allowing the rotation of images and or texts.
In the forum "Share your work" you have many examples.
JP Wink

_________________
pleasure to learn, to teach, to create
Back to top
View user's profile Visit poster's website
MichaelB.

Bascom Member



Joined: 04 May 2017
Posts: 26

germany.gif
PostPosted: Thu Apr 11, 2019 6:48 pm    Post subject: Reply with quote

Duval JP wrote:
I followed the threads of discussions on the KS108, and I wonder if it is really necessary to use this old display.
On the market, at very low prices, you have color displays (touch or not) with very rich libraries allowing the rotation of images and or texts.
In the forum "Share your work" you have many examples.
JP Wink


Because this type of Display is enough for my Project.

I also will ask if some Statements in BASCOM exist to rotate a Variable.
Like:
Code:

...
Dim Y as Byte
...
LCDAT 1,1, Y

and Rotate it on the Display... ?
Maybe kinda like this:

Code:
LCDAT 1,1,Y,90
LCDAT 1,1,Y,180


Regards
Back to top
View user's profile
AdrianJ

Bascom Expert



Joined: 16 Jan 2006
Posts: 2441
Location: Queensland

australia.gif
PostPosted: Thu Apr 11, 2019 11:59 pm    Post subject: Reply with quote

I think in the Help for LCDAT you will find that that construction does not exist.

I wrote something slightly similar for the SED122*32 display, but allowing to swap the image either left-to-right or up-down. Just a matter of adding appropriate code to that display library. You could do the same for your display. I could post the code if you wanted, but those two displays are so different that I doubt it will help much.

But I tend to agree with Duval, you could probably find a better, cheaper and much more powerful display to do the job.

My impression now is that the time of adding simple displays to low power processors, and trying to do anything more than text or trivial graphics is over. Use something like an Android phone with its very powerful graphics cababilities built in, and easy to create almost any conceivable display with a few lines of Java code, then use all the time you saved to do a really good implementation on the front-end processing, the bit between your sensors and inputs, and the processing of that data to output. You can still choose to use an AVR for that, just pass the result to the phone via something like Bluetooth for display.

_________________
Adrian Jansen
Computer language is a framework for creativity
Back to top
View user's profile Visit poster's website
Duval JP

Bascom Member



Joined: 22 Jun 2004
Posts: 827
Location: France

france.gif
PostPosted: Fri Apr 12, 2019 8:55 am    Post subject: Reply with quote

Hi
in my opinion, LCDAT is an instruction specific to the libraries created by Mrshilov ? . It is not a Bascom instruction
JP Wink

_________________
pleasure to learn, to teach, to create
Back to top
View user's profile Visit poster's website
MichaelB.

Bascom Member



Joined: 04 May 2017
Posts: 26

germany.gif
PostPosted: Fri Apr 12, 2019 8:56 am    Post subject: Reply with quote

AdrianJ wrote:
I think in the Help for LCDAT you will find that that construction does not exist.

I wrote something slightly similar for the SED122*32 display, but allowing to swap the image either left-to-right or up-down. Just a matter of adding appropriate code to that display library. You could do the same for your display. I could post the code if you wanted, but those two displays are so different that I doubt it will help much.

But I tend to agree with Duval, you could probably find a better, cheaper and much more powerful display to do the job.

My impression now is that the time of adding simple displays to low power processors, and trying to do anything more than text or trivial graphics is over. Use something like an Android phone with its very powerful graphics cababilities built in, and easy to create almost any conceivable display with a few lines of Java code, then use all the time you saved to do a really good implementation on the front-end processing, the bit between your sensors and inputs, and the processing of that data to output. You can still choose to use an AVR for that, just pass the result to the phone via something like Bluetooth for display.



Thanks for the Answer. Smile

I know it would be better to write an APP for a Smatphone.
But a Smartphone with his Blutooth dont have the ability of a 433Mhz RF Module.
What i build is , so to speak, a Smartphone with a 8x8 Font , a 128x64 Display with Touchscreen, Acceleration Sensor for Tilt and Sprite Rotate, and a 433Mhz RF Module.
It all Works very fine.

Regards
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 4706
Location: Holland

blank.gif
PostPosted: Fri Apr 12, 2019 9:14 am    Post subject: Reply with quote

LCDAT is really a BASCOM statement.

The Q is : do you need to rotate dynamic or static?
for static you could use the original bmp and rotate and save it.

dynamic is something else. when you have sufficient memory you could read the memory, then write it back in the right order.
the problem is that these pixels are combined into bytes. So 8 first dots are 1 byte.
Some displays have a rotate option built in.

For this old lcd i think making/using an separate rotated bgf is the best option.
otherwise i would recommend to use a newer lcd that supports rotating.

_________________
Mark
Back to top
View user's profile Visit poster's website
MichaelB.

Bascom Member



Joined: 04 May 2017
Posts: 26

germany.gif
PostPosted: Fri Apr 12, 2019 10:03 am    Post subject: Reply with quote

albertsm wrote:
LCDAT is really a BASCOM statement.

The Q is : do you need to rotate dynamic or static?
for static you could use the original bmp and rotate and save it.

dynamic is something else. when you have sufficient memory you could read the memory, then write it back in the right order.
the problem is that these pixels are combined into bytes. So 8 first dots are 1 byte.
Some displays have a rotate option built in.

For this old lcd i think making/using an separate rotated bgf is the best option.
otherwise i would recommend to use a newer lcd that supports rotating.


Edit: The Variable have to be a Live Update, like showing the Speed, Temperature or ADC Meassure for example...

I allready make .bgf Files for , for example a "2", in 90 and 180. for Rotaiton.
But when i want to Display a Variable Number of 1234 for example, i have to make 4 Bytes, 4 Case Select, a ton of Code to Display a Set of 4 .bgf Files, and a Pixelset if it is in some cases only a Variable Number of 234...

Regards


Last edited by MichaelB. on Fri Apr 12, 2019 10:25 am; edited 1 time in total
Back to top
View user's profile
Duval JP

Bascom Member



Joined: 22 Jun 2004
Posts: 827
Location: France

france.gif
PostPosted: Fri Apr 12, 2019 10:24 am    Post subject: Reply with quote

oops Embarassed

LCDAT
I'm confuse I used it with
$lib "glcdSSD1306-I2C-Buf.lib"

for the small 0.96" display
I looked at the help about LCDAT and I found it

see https://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=13611

JP

Wink

_________________
pleasure to learn, to teach, to create
Back to top
View user's profile Visit poster's website
kimmi

Moderator



Joined: 24 Feb 2006
Posts: 1922
Location: Denmark

denmark.gif
PostPosted: Sat Apr 13, 2019 1:20 am    Post subject: Reply with quote

try forum search : Best way to make a speedometer for an ATV
OR
If Graphic fonts is an option with Rotation
look at evert dekker web site
Link:
https://evertdekker.com/?p=359

_________________
/ Kim
Back to top
View user's profile Visit poster's website MSN Messenger
AdrianJ

Bascom Expert



Joined: 16 Jan 2006
Posts: 2441
Location: Queensland

australia.gif
PostPosted: Sat Apr 13, 2019 5:08 am    Post subject: Reply with quote

Quote:
I know it would be better to write an APP for a Smatphone.
But a Smartphone with his Blutooth dont have the ability of a 433Mhz RF Module.


I think you misunderstand what I mean.

By all means have whatever hardware you want built around an AVR. Then instead of sending the data from that to a display, send it via Bluetooth serial and receive it with a smartphone where you do all the graphic stuff. You will of course have to add some commands to the serial stream to tell the phone how you want to rotate the display etc.

I know it seems like gross overkill to use a smartphone just for that, with all the processor power you have there, but they are cheap, and easy to transport the app to another different one when you need to, unlike graphics displays, which are a major job to program for when either the one you use goes out of production, or you want to add more capability.

_________________
Adrian Jansen
Computer language is a framework for creativity
Back to top
View user's profile Visit poster's website
MichaelB.

Bascom Member



Joined: 04 May 2017
Posts: 26

germany.gif
PostPosted: Sat Apr 13, 2019 7:30 am    Post subject: Reply with quote

kimmi wrote:


If Graphic fonts is an option with Rotation
look at evert dekker web site
Link:
https://evertdekker.com/?p=359



This Looks pretty neat Smile)) I Investigate it.
Back to top
View user's profile
MichaelB.

Bascom Member



Joined: 04 May 2017
Posts: 26

germany.gif
PostPosted: Sat Apr 13, 2019 7:46 am    Post subject: Reply with quote

AdrianJ wrote:
Quote:
I know it would be better to write an APP for a Smatphone.
But a Smartphone with his Blutooth dont have the ability of a 433Mhz RF Module.


I think you misunderstand what I mean.

By all means have whatever hardware you want built around an AVR. Then instead of sending the data from that to a display, send it via Bluetooth serial and receive it with a smartphone where you do all the graphic stuff. You will of course have to add some commands to the serial stream to tell the phone how you want to rotate the display etc.

I know it seems like gross overkill to use a smartphone just for that, with all the processor power you have there, but they are cheap, and easy to transport the app to another different one when you need to, unlike graphics displays, which are a major job to program for when either the one you use goes out of production, or you want to add more capability.


First of , its not a Phone. It looks like a Smartphone, But it is just a Smart Handheld device.

Quote:
have to add some commands to the serial stream to tell the phone how you want to rotate the display

No.
I Call it "Process Corretion". All Sending or Recieving Data coming in Standard direction 0, no Extra data. The my Smart Handheld Device Process the Angle it self with a Acceleration sensor, and registed if the device is 0, 90 or 270 Twisted.

Regards
Back to top
View user's profile
MWS

Bascom Member



Joined: 22 Aug 2009
Posts: 1655

blank.gif
PostPosted: Sat Apr 13, 2019 10:23 am    Post subject: Reply with quote

MichaelB. wrote:
...and registed if the device is 0, 90 or 270 Twisted.

How in case of 90/270 degrees rotation would it be possible to project an image of 128 x 64 pixels onto a screen of 64 x 128 pixels?

Technically, scaling without aspect ratio would be feasible, but...
If not the controller would be too small for that.
If not the display would be to coarse for that.
If not the viewer of that thing would not getting sick by watching the distorted result.
Quote:
...it is just a Smart Handheld device

I would not concentrate on optical gadgets, but more on the 'core smartness' of the device.
As you seem to have missed Bascom's help, which btw. is pretty good, and commands are extensively described, I wonder how smart the device will be, if the maker of same device did not find out there is no rotate command for images and seems to posses little understanding about the hurdles of image processing.
Maybe it would advance your project if you describe what you want to do and ask for ideas to achieve your goal, instead of holding on to concepts which won't work out.
Back to top
View user's profile
six1

Bascom Expert



Joined: 27 Feb 2009
Posts: 519

germany.gif
PostPosted: Sat Apr 13, 2019 11:35 am    Post subject: Reply with quote

Quote:
If not the viewer of that thing would not getting sick by watching the distorted result.

Very Happy

...that will look like the product of an epileptic chicken having a seizure on a bad day and, that is on a good day! Laughing

_________________
For technical reasons, the signature is on the back of this message.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR All times are GMT + 1 Hour
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum