Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: main.cpp
- Revision:
- 1:1779a3279496
- Parent:
- 0:5945217144be
- Child:
- 2:6566f09256dc
diff -r 5945217144be -r 1779a3279496 main.cpp
--- a/main.cpp Wed Aug 07 10:05:35 2019 +0000
+++ b/main.cpp Thu Aug 15 12:09:06 2019 +0000
@@ -2,18 +2,20 @@
//------------------------------------
// configuration liaison série à 19200 bps ( driver stlink)
-// A0 et A1 sont placés en entrée analogique ( mesure sortie AOP)
-// A4 et A5 sont placés en sortie analogique ( offset vers AOP)
+// A0 et A1 sont placées en entrée analogique ( mesure sortie AOP)
+// A3 et A4 sont placées en sortie analogique ( offset vers AOP)
// led sur carte nommée LL
// chaque seconde ce programme numérise 4 datas de A0 et A1 sans plus
// il transfert 4 octets en duj2 (avant dernier exemple fiche duj2)
-// fiche protocole duj2 sur mon site
+//
//------------------------------------
-Serial pc(SERIAL_TX, SERIAL_RX); // PORT SERIE SUR usb !!
-AnalogIn Ch1(A0); AnalogIn Ch2(A1); // entrées ana
-AnalogOut out1(PA_4);AnalogOut out2(A4);// sorties ana
-DigitalOut LL(LED1);
+Serial pc(SERIAL_TX, SERIAL_RX); // PORT SERIE SUR usb !!
+AnalogIn Ch1(A0) ;AnalogIn Ch2(A1); // entrées ana nommées Ch1 Ch2
+AnalogOut out1(A3);AnalogOut out2(A4); // sorties ana nommées out1 out2
+I2C i2c(D0,D1); // (sda,scl) canal I2C nommé i2c
+DigitalOut S0(D2); // sortie TTL nommée S0
+DigitalOut LL(LED1); // led nommée LL ( sur module L432
uint16_t ch1i[5]; // tableaux d' int
uint16_t ch2i[5];
@@ -23,9 +25,10 @@
{
pc.baud(19200); // initialisations
LL = 0 ;
- out1.write(0.5); // sortie A5 = 0.5 * 3.3V
- out2.write(0.25); // sortie A4 = 0.25* 3.3V
-
+ out1.write(0.5); // sortie A3 = 0.5 * 3.3V soit 1.6 V
+ out2.write(0.25); // sortie A4 = 0.25* 3.3V soit 0.8 V
+ S0 = 1 ; // sortie commande mise à 1 ou 3.3V
+
while(1) // boucle sans fin
{
LL = 1 ; // allume Led