node.jsとmbedを使ってインターネット越しに多人数でマウスをクリックする

Fork of AutoCookieClicker by Takuya Urakawa

Files at this revision

API Documentation at this revision

Comitter:
hsgw
Date:
Wed Sep 18 12:00:07 2013 +0000
Parent:
1:2cf612e040e0
Child:
3:35d8318e31bc
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
--- /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
--- 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);
     }