danieleff / STM32GENERIC

Generic implementation of Arduino for STM32 boards
https://danieleff.github.io/STM32GENERIC/
118 stars 87 forks source link

STM32F7 Discovery tft.setRotation not working #16

Open ChrisMicro opened 7 years ago

danieleff commented 7 years ago

Thanks for testing. First I would like somebody with a STM32F429ZI Discovery board to implement it for that display, should be similar to LTDC_F746_Discovery.h, but needs to check the cubemx examples. After that, I will implement rotation.

ChrisMicro commented 7 years ago

Thanks for testing. Welcome :-) Just one question: could you turn the display preliminary by 180° as default ? ( only if it is possible without effort ... ) Because the USB cable points in my direction and it would be much better from the opposite site.

danieleff commented 7 years ago

Change the buffer[x + y * W] = color to buffer[(W - x - 1) + (H - y - 1) * W] = color in https://github.com/danieleff/STM32GENERIC/blob/master/STM32/libraries/LTDC/src/LTDC.h#L164

It has to be changed in all 4 methods below too, not just 1. Thats basically 180.

Pretty cool that writing to the buffer changes the pixel on the screen.

ChrisMicro commented 7 years ago

Pretty cool that writing to the buffer changes the pixel on the screen. Yes, I like it :-) I've just made more experiments with a my new voltmeter example https://github.com/ChrisMicro/STM32GENERIC/blob/master/STM32/libraries/BoardExamples/examples/Discovery746NG/TFT_voltmeter/TFT_voltmeter.ino

Just an observation: I made measure the voltage with a 100KOhm resistor in front of the ADC for protection. If the ADC is running, a voltage drop of 300mV occurs which means it draws 3uA in active state.

danieleff commented 7 years ago

Cursor positioning is in pixels, so something like tft.setCursor(50, 100); comment out the tft.setRotation(1); because that would be portrait mode. wide screen is 0 and 2 add precision parameter to print like tft.print(voltage, 6);

ChrisMicro commented 7 years ago

Thanks. I changed it in the repository. I added a simple oscilloscope with auto trigger: https://github.com/ChrisMicro/STM32GENERIC/blob/master/STM32/libraries/BoardExamples/examples/Discovery746NG/TFT_oscilloscope/TFT_oscilloscope.ino

ChrisMicro commented 7 years ago

I've just added a mandelbrot set example: https://github.com/ChrisMicro/STM32GENERIC/tree/master/STM32/libraries/BoardExamples/examples/Discovery746NG/TFT_mandelbrot Well ... double buffering wouldn't be bad ...