View previous topic :: View next topic |
Author |
Message |
Duval JP
Joined: 22 Jun 2004 Posts: 1161 Location: France
|
Posted: Fri Dec 18, 2020 12:07 pm Post subject: Analogic Clcok with the gauges of nextion HMI |
|
|
Hi
This video shows the interest of using the "intelligent" Nextion .
the gauges have the possibility to be transparent, i.e. the hand is displayed but not the background.
This considerably reduces the number of programme lines.
Moreover I used the internal RTC which frees an I2C port.
Again this is possible only with the "intelligente Nextion display
[img][/img]
Video here : https://youtu.be/rZ9rJepxNWU
code here :
JP _________________ pleasure to learn, to teach, to create |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Fri Dec 18, 2020 9:19 pm Post subject: |
|
|
thank you for sharing JP.
Time is going fast in the video
It looks smooth.
In 2021 i will check out nextion too. _________________ Mark |
|
Back to top |
|
|
Duval JP
Joined: 22 Jun 2004 Posts: 1161 Location: France
|
|
Back to top |
|
|
Duval JP
Joined: 22 Jun 2004 Posts: 1161 Location: France
|
Posted: Sun Dec 27, 2020 6:44 pm Post subject: letter weighing with a HX711 |
|
|
I have added a letter weighing function to my clock.
I was helped by Mikael from the Bascom.de forum. You can see the software I used as an inspiration.
https://bascomforum.de/index.php?thread/1644-load-cell-sensor-hx711/&postID=27108#post27108
many thanks to him for this very simple way to do
I use a DFROBOT SEN160 1Kg module from GoTronic to do it
the Video :
https://youtu.be/-D6NelyDm-U
the code :
I remark the dim because they are put in the main program.
Code: | ''HX711 weight----------------------------------------------
Sub Hx711 ()
'HX711 Wägezellen-Sensor michael@bascomforum.de
Call Nex_page (2) 'give here the name of the weight page==============
Waitms 100
'Dim Wert As Long 'Wandlerwert Converter value Valeur du convertisseur
'Dim C As Byte At Wert Overlay 'serielles Byte LSB
'Dim B As Byte At Wert + 1 Overlay
'Dim A As Byte At Wert + 2 Overlay 'serielles Byte MSB
'Dim X As Byte At Wert + 3 Overlay 'MSB im Long
'Dim Tara As Long 'Offset
'Dim Wert_final As Long 'Rechnungsvariable
'Const Faktor = 1989
Clock Alias Portc.5 ' the clock
Config Clock = Output
D_in Alias Pinc.4 ' data in
Config D_in = Input
Tara = 0
Do
For Ibyte = 7 To 0 Step -1
Clock = 1
Waitus 2
A.ibyte = D_in
Waitus 1
Clock = 0
Next
If A.7 = 1 Then
X = 255
Else
X = 0
End If
For Ibyte = 7 To 0 Step -1
Clock = 1
Waitus 2
B.ibyte = D_in
Waitus 1
Clock = 0
Next
For Ibyte = 7 To 0 Step -1
Clock = 1
Waitus 2
C.ibyte = D_in
Waitus 1
Clock = 0
Next
Clock = 1 '25 Clocks
Waitus 2
Waitus 1
Clock = 0
Waitms 20
Device_id = 0
Call Nex_returntime ()
Select Case Device_id
Case 1 'tare
Tara = Wert
Debug #usb , "tare:" ; Wert
Device_id = 0
Wait 1
Case 2 'retour
Exit Sub
End Select
Waitms 200
If Tara = 0 Then Call Nex_text ( "t3" , "Zero ?" , Black , White , 4)
Call Weighing ()
Loop
End Sub
Sub Weighing ()
If Tara > 0 Then
Wert = Wert - Tara 'Offset abziehen 'deduct offset (tare) , soustraire le décalage
End If
If Tara = 0 Then
Call Nex_text ( "t3" , "Zero ?" , Black , White , 4)
Debug #usb , "mesure vide " ; Wert
Exit Sub
End If
Wert_final = Wert / Faktor 'Faktor für metrische Gramm Factor for metric grams ' facteur pour les grammes
Wert_final = Abs(wert_final )
Debug #usb , "Wert_final " ; Wert_final
Sentence = Str(wert_final ) : Sentence = Sentence + " g"
Call Nex_text ( "t3" , Sentence , Black , White , 4)
Device_id = 0
End Sub |
_________________ pleasure to learn, to teach, to create
Last edited by Duval JP on Mon Dec 28, 2020 10:56 am; edited 1 time in total |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Mon Dec 28, 2020 10:53 am Post subject: |
|
|
hi JP
thanks for the video and this addition.
it seems to be very accurate.
Ha Michael , he can do about anything with bascom _________________ Mark |
|
Back to top |
|
|
Duval JP
Joined: 22 Jun 2004 Posts: 1161 Location: France
|
Posted: Mon Dec 28, 2020 11:01 am Post subject: |
|
|
yes that right . Mikael use overlay and with this sample I understand overlay with the MSB and LSB
JP _________________ pleasure to learn, to teach, to create |
|
Back to top |
|
|
|