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.
Diff: main2.txt
- Revision:
- 0:ee7ec177de7e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main2.txt Mon Jan 17 15:59:40 2022 +0000
@@ -0,0 +1,30 @@
+//Include
+#include "mbed.h"
+#include "platform/mbed_thread.h"
+
+
+//definisanje
+#define DISPLAY_TIME 2
+
+
+//Deklaracija promenjivih
+PwmOut ZUJALICA(PA_11);
+AnalogIn POT1(PA_0), POT2(PA_1);
+BusOut display1(PA_10, PA_9, PA_8, PB_10, PB_5, PB_4, PB_3, PB_6);
+DigitalIn SW1(PC_9);
+int a = 0;
+int NUMBERS[10] = {0x40, 0x79, 0x24, 0x30, 0x19, 0x12, 0x02, 0x78, 0x00, 0x10};
+
+//Glavna funckija
+int main()
+{
+ while(true){
+ ZUJALICA.period(0.0002 + POT2.read() * 0.0001);
+ ZUJALICA.write(1 - POT1.read());
+
+ if(SW1 == 0){
+ a = POT1.read() * 10;
+ display1 = NUMBERS[a];
+ }
+ }
+}