rtos ile keypad, servo, step ve lcd ekran kontrolu

Dependencies:   beep TextLCD keypad

Files at this revision

API Documentation at this revision

Comitter:
marvas
Date:
Mon May 06 10:32:55 2019 +0000
Commit message:
rtos ile keypad, servo, step ve lcd ekran kontrolu

Changed in this revision

TextLCD.lib Show annotated file Show diff for this revision Revisions of this file
beep.lib Show annotated file Show diff for this revision Revisions of this file
keypad.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-os.lib Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TextLCD.lib	Mon May 06 10:32:55 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/simon/code/TextLCD/#308d188a2d3a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/beep.lib	Mon May 06 10:32:55 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/dreschpe/code/beep/#d8e14429a95f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/keypad.lib	Mon May 06 10:32:55 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/teams/Marvas/code/keypad/#7da3ab010a87
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon May 06 10:32:55 2019 +0000
@@ -0,0 +1,111 @@
+#include "mbed.h"
+
+#include "TextLCD.h"
+#include <iostream>//cin ve cout 
+#include "beep.h"
+#include "Keypad.h"
+char x;
+TextLCD lcd(D7, D6, D5, D4, D3, D2); // rs, e, d4-d7
+// Define your own keypad values
+char key_table[] = { '1', '2', '3', 'A',
+                     '4', '5', '6', 'B',
+                     '7', '8', '9', 'C',
+                     '*', '0', '#', 'D'
+                   };
+
+
+Beep buzzer(A0);
+
+BusOut step(D8,D9,D10,D11);
+DigitalOut servo(D12);
+Serial pc(USBTX,USBRX);
+DigitalOut led(LED1);
+void servometot();
+void stepmetot();
+void lcdmetot();
+Thread servomotor,stepmotor,lcdekran;
+
+
+int main()
+{
+    Keypad key(PC_4, PB_13, PB_14, PB_15, PB_1, PB_2, PB_12, PA_11);
+    //satır 4321 sutun 4321
+    uint32_t key_num;
+    servomotor.start(servometot);
+    stepmotor.start(stepmetot);
+    lcdekran.start(lcdmetot);
+    while(true) {
+        while ((key_num = key.read()) != 0) {
+            lcd.locate(0,1);
+            lcd.printf("%c", *(key_table + key_num-1));
+            printf("%c\n", *(key_table + key_num-1));
+        }
+        wait(0.1);
+    }
+}
+void servometot()
+{
+    while(1) {
+        for(uint8_t x=0; x<5; x++) {
+            servo=1;
+            wait_ms(1.5);
+            servo=0;
+            wait_ms(18.5);
+        }
+        wait(1);
+        for(uint8_t x=0; x<5; x++) {
+            servo=1;
+            wait_ms(1);
+            servo=0;
+            wait_ms(19);
+        }
+        wait(1);
+        for(uint8_t x=0; x<10; x++) {
+            servo=1;
+            wait_ms(2);
+            servo=0;
+            wait_ms(18);
+        }
+        wait(1);
+    }
+
+}
+
+
+void stepmetot()
+{
+    step=0x0;
+    while(1) {
+
+        step=0x8;
+        wait_ms(1);
+        step=0x4;
+        wait_ms(1);
+        step=0x2;
+        wait_ms(1);
+        step=0x1;
+        wait_ms(1);
+    }
+}
+void lcdmetot()
+{
+    // bool y=0;
+    while(1) {
+
+        for(uint8_t x=0; x<11; x++) {
+
+          lcd.locate(x-1,0);
+            lcd.printf(" ");
+            lcd.locate(x,0);
+            lcd.printf("mehmet");
+            wait_ms(200);
+        }
+          for(uint8_t x=0; x<16; x++) {
+
+          lcd.locate(x,0);
+            lcd.printf(" ");
+        }
+        // y=!y;
+
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-os.lib	Mon May 06 10:32:55 2019 +0000
@@ -0,0 +1,1 @@
+https://github.com/ARMmbed/mbed-os/#c9e63f14085f5751ff5ead79a7c0382d50a813a2