Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:57 02 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Armmite L4: 5.05.05: Arcs & displays

Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 10:56am 10 Jan 2019
Copy link to clipboard 
Print this post

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

Edited by matherp 2019-01-11
 
OA47

Guru

Joined: 11/04/2012
Location: Australia
Posts: 986
Posted: 11:08am 10 Jan 2019
Copy link to clipboard 
Print this post

Many, many thanks Peter

OA47
 
viscomjim
Guru

Joined: 08/01/2014
Location: United States
Posts: 925
Posted: 12:33pm 10 Jan 2019
Copy link to clipboard 
Print this post

Very nice!!! Thanks for all the efforts matherp!
 
sawasdee01
Newbie

Joined: 23/12/2016
Location: United Kingdom
Posts: 33
Posted: 01:45pm 10 Jan 2019
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 10315
Posted: 05:13pm 10 Jan 2019
Copy link to clipboard 
Print this post

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: Australia
Posts: 6283
Posted: 10:05pm 10 Jan 2019
Copy link to clipboard 
Print this post

  matherp said   Trivial update that hopefully improves I2C communication with semi-non-compliant devices (DHTU21?)

My DHTU21 was OK with the original firmware and it still works OK.

Jim
VK7JH
MMedit
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 10:29am 11 Jan 2019
Copy link to clipboard 
Print this post

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
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025