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 X_NUCLEO_PLC01A1
Diff: main.cpp
- Revision:
- 4:17b45bcd5b40
- Parent:
- 2:bf16a2ba8662
- Child:
- 5:321e4e37ba1c
--- a/main.cpp Tue Feb 23 10:45:16 2016 +0000
+++ b/main.cpp Tue Feb 23 13:00:04 2016 +0000
@@ -45,19 +45,8 @@
/* Definitions ---------------------------------------------------------------*/
-#define SPI_MOSI D11
-#define SPI_MISO D12
-#define SPI_SCLK D13
-
-#define SPI_BITS 16
-
-#define SPI_CS1 D9
-#define SPI_CS2 D10
-
-#define OUT_EN D6
-
/* Uncomment this for OUTPUT_CYCLING ENABLE */
-#define OUTPUT_CYCLING
+//#define OUTPUT_CYCLING
/* Variables -----------------------------------------------------------------*/
@@ -126,11 +115,11 @@
/*----- Initialization. -----*/
/* Initializing SPI bus. */
- SPI spi(SPI_MOSI, SPI_MISO, SPI_SCLK);
- setup(spi, SPI_BITS);
+ SPI spi(X_NUCLEO_PLC01A1_PIN_SPI_MOSI, X_NUCLEO_PLC01A1_PIN_SPI_MISO, X_NUCLEO_PLC01A1_PIN_SPI_SCLK);
+ setup(spi, X_NUCLEO_PLC01A1_PIN_SPI_BITS);
/* Initializing PLC IO Channels Component. */
- PLC plc(SPI_CS1, SPI_CS2, OUT_EN, spi);
+ PLC plc(X_NUCLEO_PLC01A1_PIN_SPI_CS1, X_NUCLEO_PLC01A1_PIN_SPI_CS2, X_NUCLEO_PLC01A1_PIN_OUT_EN, spi);
while(1) {
plc.plcInput().SetReadStatus(1);