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 /* mbed Microcontroller Library 00002 * Copyright (c) 2019 ARM Limited 00003 * SPDX-License-Identifier: Apache-2.0 00004 */ 00005 00006 /* Anschlüsse: 00007 * MOSI: PB15 - D8 00008 * SCLK: DB13 - D7 00009 */ 00010 00011 #include "mbed.h" 00012 #include "platform/mbed_thread.h" 00013 00014 00015 // Blinking rate in milliseconds 00016 #define BLINKING_RATE_MS 5 00017 00018 DigitalOut summer(D3); 00019 DigitalOut SS(D4); 00020 AnalogIn ain(A0); 00021 00022 00023 // Deklarieren Sie die SPI: SPI anzeige(?, ?, ?); 00024 00025 int seg7[10]={0b11000000,0b11111001,0b10100100, 00026 0b10110000,0b10011001,0b10010010, 00027 0b10000010,0b11111000,0b10000000, 00028 0b10010000}; 00029 00030 int tausender(int e) 00031 { 00032 return (seg7[((e%10000)/1000)]<<8)+0b00000001; 00033 } 00034 //ebenso hunderter, zehner und einer 00035 int main() 00036 { 00037 int eingabe; 00038 summer=1; //Summer ausschalten 00039 // Wählen Sie das richtige Format: anzeige.format(???); 00040 while (true) { 00041 eingabe=(int)(ain*4096); 00042 00043 SS=0; 00044 anzeige.write(tausender(eingabe)); 00045 SS=1; 00046 thread_sleep_for(BLINKING_RATE_MS); 00047 //Ebenso hunderter, Zehner, Einer 00048 } 00049 }
Generated on Sat Dec 31 2022 11:00:57 by
1.7.2