mbed FRDM-KL25Z Example Programs

/media/uploads/chris/frd_small.jpg

Early support for interfaces

  • DigitalIn (Including Bus and Port)
  • DigitalOut (Including Bus and Port)
  • Serial
  • I2C
  • PWM
  • TSI
  • Timer
  • Ticker
  • Timeout

mbed FRDM-KL25Z - Hello World!

[Repository '/users/mbed_official/code/FRDM_GPIO/docs/tip/main_8cpp_source.html' not found]

Touch Sensor - Hello World!

Import program

00001 #include "mbed.h"
00002 #include "TSISensor.h"
00003 
00004 int main(void) {
00005     PwmOut led(LED_GREEN);
00006     TSISensor tsi;
00007     
00008     while (true) {
00009         led = 1.0 - tsi.readPercentage();
00010         wait(0.1);
00011     }
00012 }

Accelerometer Example - Hello World!

Import program

00001 #include "mbed.h"
00002 #include "MMA8451Q.h"
00003 
00004 #define MMA8451_I2C_ADDRESS (0x1d<<1)
00005 
00006 int main(void) {
00007     MMA8451Q acc(PTE25, PTE24, MMA8451_I2C_ADDRESS);
00008     PwmOut rled(LED_RED);
00009     PwmOut gled(LED_GREEN);
00010     PwmOut bled(LED_BLUE);
00011 
00012     while (true) {
00013         rled = 1.0 - abs(acc.getAccX());
00014         gled = 1.0 - abs(acc.getAccY());
00015         bled = 1.0 - abs(acc.getAccZ());
00016         wait(0.1);
00017     }
00018 }

RGB LED - Hello World!

[Repository '/users/mbed_official/code/FRDM_RGBLED/' not found]

Ticker - Hello World!

[Repository '/users/mbed_official/code/FRDM_Ticker/' not found]

Timer - Hello World!

[Repository '/users/mbed_official/code/FRDM_Timer/' not found]

Timeout - Hello World!

[Repository '/users/mbed_official/code/FRDM_Timeout/' not found]

Serial port - Hello World!

Before you can use the USB Serial port functionality, visit the Serial PC page for the USB serial drivers and terminal programs :

[Repository '/users/mbed_official/code/FRDM_Serial/' not found]


Please log in to post comments.