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
1_zadatak.cpp
00001 #include "mbed.h" 00002 00003 SPI spi_port(p5, NC, p7); // mosi, miso, sclk, znaci miso linija je NOT CONNECTED. 00004 DigitalOut ss(p8); //slave select pin 00005 00006 int main() { 00007 00008 spi_port.format(8,0); // 8 bitni podatak, mod rada 0 00009 spi_port.frequency(1000000); // frekvencija takta 1MHz 00010 00011 while (1){ 00012 00013 ss = 0; //spusti SS pin u nulu (oznaci slave, slave je aktivan ako je SS pin u nuli) 00014 spi_port.write(0b11001001); //posalji podatak 0xC9 00015 ss = 1; //vrati SS pin u jedinicu (odznaci slave) 00016 wait_us(50); 00017 } 00018 }
Generated on Thu Jul 14 2022 08:32:39 by
