![]() |
Forum Index : Microcontroller and PC projects : Armmite L4: 5.05.05: Arcs & displays
Author | Message | ||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10315 |
Please find attached version 5.05.05 for the Armmite L4 2019-01-10_204755_ArmmiteL4.zip This includes the following changes: Added triangle command with array support - see H7 manual for syntax Added ARC command - see H7 manual for syntax Added Bezier command - see H7 manual for syntax Added support for ST7789 display as in pictures OPTION LCDPANEL ST7789, orientation, DCpin, RESETpin, CSpin Added support for ST7735S display as per recent CFunction. NB: there appear to be two variants of this. I'll add support for the second variant when I have confirmed the initialisation differences OPTION LCDPANEL ST7735S, orientation, DCpin, RESETpin, CSpin Final decision to run single precision floating point on the L4. This saves a huge amount of flash memory for additional features and is faster. Applications that need double precision should use an alternative platform. The triangle command is highly optimised when outputting to colour displays in order to allow flicker free updates to the screen as per the video As there were reported issues I have bought a couple of HTU21D sensors and can confirm they work perfectly for me on the Armmite L4 using TassyJim's code Video of demo code ![]() Dim integer x1(1),y1(1),x2(1),y2(1),x3(1),y3(1) Dim integer c(1)=(0,RGB(yellow)),c2(1)=(0,RGB(yellow)) Dim integer x1s,y1s,x2s,y2s,x3s,y3s CLS x1(1)=MM.HRes\2-6 :x1(0)=x1(1) :x1s=x1(0) y1(1)=MM.VRes\2 :y1(0)=y1(1) :y1s=y1(0) x2(1)=MM.HRes\2+6 :x2(0)=x2(1) :x2s=x2(0) y2(1)=MM.VRes\2 :y2(0)=y2(1) :y2s=y2(0) x3(1)=MM.HRes\2 :x3(0)=x3(1) :x3s=x3(0) y3(1)=MM.VRes\2-75 :y3(0)=y3(1) :y3s=y3(0) Arc MM.HRes\2,MM.VRes\2,99,101,210,150 Arc MM.HRes\2,MM.VRes\2,84,86,210,150 Arc MM.HRes\2,MM.VRes\2,86,99,210,90,RGB(green) Arc MM.HRes\2,MM.VRes\2,86,99,90,150,RGB(red) Pause 1000 rotatetriangle -150,MM.HRes\2, MM.VRes\2 Do For i=-150 To 150 If(i>90)Then c2(1)=RGB(red) c(1)=RGB(yellow) Else c2(1)=RGB(yellow) c(1)=RGB(red) EndIf rotatetriangle i,MM.HRes\2, MM.VRes\2 Triangle x1(),y1(),x2(),y2(),x3(),y3(),c(),c2() Next i For i=150 To -150 Step -1 If(i>90)Then c2(1)=RGB(red) c(1)=RGB(yellow) Else c2(1)=RGB(yellow) c(1)=RGB(red) EndIf rotatetriangle i,MM.HRes\2, MM.VRes\2 Triangle x1(),y1(),x2(),y2(),x3(),y3(),c(),c2() Next i Loop Sub rotatetriangle(angle As float, x As integer, y As integer) Local float sine=Sin(Rad(angle)),cosine=Cos(Rad(angle)) Local integer x1a=x1s-x, y1a=y1s-y Local integer x2a=x2s-x, y2a=y2s-y Local integer x3a=x3s-x, y3a=y3s-y x1(0)=x1(1):x2(0)=x2(1):x3(0)=x3(1) y1(0)=y1(1):y2(0)=y2(1):y3(0)=y3(1) x1(1)= x1a*cosine - y1a * sine + x y1(1)= y1a*cosine + x1a * sine + y x2(1)= x2a*cosine - y2a * sine + x y2(1)= y2a*cosine + x2a * sine + y x3(1)= x3a*cosine - y3a * sine + x y3(1)= y3a*cosine + x3a * sine + y End Sub |
||||
OA47 Guru ![]() Joined: 11/04/2012 Location: AustraliaPosts: 986 |
Many, many thanks Peter OA47 |
||||
viscomjim Guru ![]() Joined: 08/01/2014 Location: United StatesPosts: 925 |
Very nice!!! Thanks for all the efforts matherp! |
||||
sawasdee01 Newbie ![]() Joined: 23/12/2016 Location: United KingdomPosts: 33 |
Hi Peter, The ST7789 based display looks fantastic! Ref my last post concerning ST7789 based 240 x 240 displays - after quite a lot of digging around, I have finally alighted on using an AMELIN AML015416 V3 SPI i/f with Capacitive Touch Screen display, which uses the ST7789 and FT6336 touch controller:- https://amelin.en.alibaba.com/product/60841978417-806620495/Brand_new_1_54_inch_240_240_TFT_LCD_screen_SPI_interface_wit _CTP_touch_panel.html?spm=a2700.icbuShop.41413.15.7b4b4d36UwKuzl I think that this display probably represents the best balance between quality and value. Additionally,this is a new generation of this type of display, where both the LCD SPI and Capacitive Touch Screen I2C connectors are brought out to a single 24 way Hirose connector, resolving the issue of having to solder multiple (fragile) flexible pcbs. I will order some of these displays from Amelin, as soon as I get back to Chiang Mai in a couple of weeks time. Best wishes. Sawasdee |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10315 |
Trivial update that hopefully improves I2C communication with semi-non-compliant devices (DHTU21?) Paul: please could you let me know if this works for you without added capacitance - thanks 2019-01-11_031325_ArmmiteL4.zip |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
My DHTU21 was OK with the original firmware and it still works OK. Jim VK7JH MMedit |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10315 |
Minor update that fixes a serious bug that resulted in pins 33-64 not being reserved properly when used for displays etc. on 48 and 64-pin chips. Thanks to panky for identifying a symptom that allowed me to find it. If you are using Nucleo-L433 or Nucleo-L476 you must update 2019-01-11_202934_ArmmiteL4.zip |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |