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-STM32F103C8T6 mbed
Fork of STM32F103C8T6_USBSerial by
main.cpp
00001 #include "stm32f103c8t6.h" 00002 #include "mbed.h" 00003 #include "MCP4822.h" 00004 00005 MCP4822 MCP(SPI_MOSI, SPI_SCK, SPI_CS); // MOSI, SCLK, nCS 00006 00007 int main() { 00008 while(1){ 00009 MCP.writeA(1650); // 1650 V out 00010 MCP.writeB(1650); // Same on B output 00011 wait(5); 00012 MCP.writeA(0); // Zero v out 00013 MCP.writeB(0); // Same on B 00014 wait(5); 00015 MCP.writeA(3300); // Guess what? 00016 MCP.writeB(3300); // 3.3 V 00017 wait(5); 00018 } // Return to beginning. 00019 }
Generated on Mon Jul 18 2022 00:00:51 by
1.7.2
