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.
main.cpp
00001 /* Program Example 7.1: Sets up the mbed as SPI master, and continuously sends 00002 a single byte 00003 */ 00004 #include "mbed.h" 00005 SPI ser_port(p11, p12, p13); // mosi, miso, sclk 00006 char switch_word ; //word we will send 00007 00008 00009 00010 int main() { 00011 ser_port.format(8,0); // Setup the SPI for 8 bit data, Mode 0 operation 00012 ser_port.frequency(1000000); // Clock frequency is 1MHz 00013 while (1){ 00014 switch_word=0xA1; //set up word to be transmitted 00015 ser_port.write(switch_word); //send switch_word 00016 wait_us(50); 00017 } 00018 } 00019
Generated on Fri Jul 15 2022 12:47:08 by
1.7.2