The MAX32630FTHR is included in the Mbed OS. No need to include the library max32630fthr ! Just look at https://github.com/ARMmbed Select mbed-os or directly https://github.com/ARMmbed/mbed-os Select folder targets Select folder TARGET_Maxim Select folder TARGET_MAX32630 SPI pin, PWM pin definitions https://github.com/ARMmbed/mbed-os/blob/master/targets/TARGET_Maxim/TARGET_MAX32630/PeripheralPins.c The PwmOut voltage rises from 0.0 V up to 1.8 V and the DigitalOut voltages are 0.0 V and 1.8 V . Timo Karppinen 20.12.2021
The MAX32630FTHR is included in the Mbed OS. No need to include the library max32630fthr ! Just look at https://github.com/ARMmbed Select mbed-os or directly https://github.com/ARMmbed/mbed-os . Select folder targets. Select folder TARGET_Maxim. Select folder TARGET_MAX32630 . SPI pin, PWM pin definitions https://github.com/ARMmbed/mbed-os/blob/master/targets/TARGET_Maxim/TARGET_MAX32630/PeripheralPins.c . The PwmOut voltage rises from 0.0 V up to 1.8 V and the DigitalOut voltages are 0.0 V and 1.8 V . Timo Karppinen 20.12.2021
main.cpp@0:1f74aad84310, 2021-12-20 (annotated)
- Committer:
- timo_k2
- Date:
- Mon Dec 20 09:36:39 2021 +0000
- Revision:
- 0:1f74aad84310
The MAX32630FTHR is included in the Mbed OS. No need to include ; the library max32630fthr !
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
timo_k2 | 0:1f74aad84310 | 1 | /* |
timo_k2 | 0:1f74aad84310 | 2 | The MAX32630FTHR is included in the Mbed OS. No need to include |
timo_k2 | 0:1f74aad84310 | 3 | the library max32630fthr ! |
timo_k2 | 0:1f74aad84310 | 4 | Just look at |
timo_k2 | 0:1f74aad84310 | 5 | https://github.com/ARMmbed |
timo_k2 | 0:1f74aad84310 | 6 | Select mbed-os or directly https://github.com/ARMmbed/mbed-os |
timo_k2 | 0:1f74aad84310 | 7 | Select folder targets |
timo_k2 | 0:1f74aad84310 | 8 | Select folder TARGET_Maxim |
timo_k2 | 0:1f74aad84310 | 9 | Select folder TARGET_MAX32630 |
timo_k2 | 0:1f74aad84310 | 10 | |
timo_k2 | 0:1f74aad84310 | 11 | SPI pin, PWM pin definitions |
timo_k2 | 0:1f74aad84310 | 12 | https://github.com/ARMmbed/mbed-os/blob/master/targets/TARGET_Maxim/TARGET_MAX32630/PeripheralPins.c |
timo_k2 | 0:1f74aad84310 | 13 | |
timo_k2 | 0:1f74aad84310 | 14 | The PwmOut voltage rises from 0.0 V up to 1.8 V and the DigitalOut voltages are |
timo_k2 | 0:1f74aad84310 | 15 | 0.0 V and 1.8 V . |
timo_k2 | 0:1f74aad84310 | 16 | |
timo_k2 | 0:1f74aad84310 | 17 | Timo Karppinen 20.12.2021 |
timo_k2 | 0:1f74aad84310 | 18 | ********************************************************/ |
timo_k2 | 0:1f74aad84310 | 19 | |
timo_k2 | 0:1f74aad84310 | 20 | #include "mbed.h" |
timo_k2 | 0:1f74aad84310 | 21 | |
timo_k2 | 0:1f74aad84310 | 22 | //DigitalOut rLED(P5_4); |
timo_k2 | 0:1f74aad84310 | 23 | PwmOut rLED(P5_4); |
timo_k2 | 0:1f74aad84310 | 24 | DigitalOut gLED(P5_5); |
timo_k2 | 0:1f74aad84310 | 25 | int ledStatus = false; |
timo_k2 | 0:1f74aad84310 | 26 | float intensity; |
timo_k2 | 0:1f74aad84310 | 27 | |
timo_k2 | 0:1f74aad84310 | 28 | int main() |
timo_k2 | 0:1f74aad84310 | 29 | { |
timo_k2 | 0:1f74aad84310 | 30 | gLED = true; |
timo_k2 | 0:1f74aad84310 | 31 | //rLED = true; |
timo_k2 | 0:1f74aad84310 | 32 | rLED.period_us(100); |
timo_k2 | 0:1f74aad84310 | 33 | rLED.write(1.0); |
timo_k2 | 0:1f74aad84310 | 34 | |
timo_k2 | 0:1f74aad84310 | 35 | ThisThread::sleep_for(1000ms); |
timo_k2 | 0:1f74aad84310 | 36 | //rLED = false; |
timo_k2 | 0:1f74aad84310 | 37 | rLED.write(0.1); |
timo_k2 | 0:1f74aad84310 | 38 | printf("Initialized.\n"); |
timo_k2 | 0:1f74aad84310 | 39 | |
timo_k2 | 0:1f74aad84310 | 40 | while (true) { |
timo_k2 | 0:1f74aad84310 | 41 | gLED = !gLED; |
timo_k2 | 0:1f74aad84310 | 42 | ledStatus = gLED.read(); |
timo_k2 | 0:1f74aad84310 | 43 | printf("The gLED status is %d\n", ledStatus); |
timo_k2 | 0:1f74aad84310 | 44 | |
timo_k2 | 0:1f74aad84310 | 45 | for(int i = 0; i < 5; i++){ |
timo_k2 | 0:1f74aad84310 | 46 | intensity = 0.25 * float(i); |
timo_k2 | 0:1f74aad84310 | 47 | rLED.write(intensity); |
timo_k2 | 0:1f74aad84310 | 48 | ThisThread::sleep_for(500ms); |
timo_k2 | 0:1f74aad84310 | 49 | } |
timo_k2 | 0:1f74aad84310 | 50 | ThisThread::sleep_for(2000ms); |
timo_k2 | 0:1f74aad84310 | 51 | } |
timo_k2 | 0:1f74aad84310 | 52 | } |