auto clicker for coockieclicker

Dependencies:   USBDevice mbed

Fork of DigitalIn_HelloWorld_Mbed by mbed official

main.cpp

Committer:
hsgw
Date:
2013-09-18
Revision:
2:8e5fb73637e5
Parent:
0:aaf5a9d465fd

File content as of revision 2:8e5fb73637e5:

//sw connect p30 and gnd

#include "mbed.h"
#include "USBMouse.h"
 
USBMouse mouse;

DigitalIn sw(p30);
DigitalOut led(LED1);
 
int main() {
    sw.mode(PullUp);
 
    while (1) {
        if(sw.read()!=1) {
            led = !led;
            mouse.click(MOUSE_LEFT);
        }
        wait(0.25);
    }
}