auto clicker for coockieclicker

Dependencies:   USBDevice mbed

Fork of DigitalIn_HelloWorld_Mbed by mbed official

Files at this revision

API Documentation at this revision

Comitter:
hsgw
Date:
Wed Sep 18 12:00:07 2013 +0000
Parent:
1:2cf612e040e0
Commit message:
1st commit

Changed in this revision

USBDevice.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
diff -r 2cf612e040e0 -r 8e5fb73637e5 USBDevice.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/USBDevice.lib	Wed Sep 18 12:00:07 2013 +0000
@@ -0,0 +1,1 @@
+https://mbed.org/users/mbed_official/code/USBDevice/#d495202c90f4
diff -r 2cf612e040e0 -r 8e5fb73637e5 main.cpp
--- a/main.cpp	Thu Feb 21 17:06:06 2013 +0000
+++ b/main.cpp	Wed Sep 18 12:00:07 2013 +0000
@@ -1,12 +1,20 @@
+//sw connect p30 and gnd
+
 #include "mbed.h"
+#include "USBMouse.h"
  
-DigitalIn enable(p5);
+USBMouse mouse;
+
+DigitalIn sw(p30);
 DigitalOut led(LED1);
  
 int main() {
-    while(1) {
-        if(enable) {
+    sw.mode(PullUp);
+ 
+    while (1) {
+        if(sw.read()!=1) {
             led = !led;
+            mouse.click(MOUSE_LEFT);
         }
         wait(0.25);
     }