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
main.cpp
- Committer:
- bgrissom
- Date:
- 2014-07-03
- Revision:
- 0:b0f98b83cb07
- Child:
- 1:256d7a2f8391
File content as of revision 0:b0f98b83cb07:
#include "mbed.h" ///////////////////////////////////////////////// // SPI SETUP ///////////////////////////////////////////////// // We are not using MISO, this is a one-way bus SPI device(SPI_MOSI, NC, SPI_SCK); // Note: Polarity and phase are both 0 for the TC62D723FNG // For a graphical reminder on polarity and phase, visit: // http://www.eetimes.com/document.asp?doc_id=1272534 // device.format(16, 0); device.frequency(1000000); // 1 MHz ///////////////////////////////////////////////// ///////////////////////////////////////////////// // PWMCLK ///////////////////////////////////////////////// PwmOut pinPWMCLK(D9); // For Nucleo board, not for Redgarden board pinPWMCLK.write(0.5f); // Set to 50% duty cycle for testing ///////////////////////////////////////////////// // OTHER / DEBUG ///////////////////////////////////////////////// Serial pc(SERIAL_TX, SERIAL_RX); DigitalOut myled(LED1); ///////////////////////////////////////////////// int main() { int i = 0; pc.printf("Hello World!\n"); while(1) { wait(1); pc.printf("Alive for %d seconds.\n", i++); myled = !myled; device.write(0x55); device.write(0xE0); } }