Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Car remote sketch by Bigboy™
- This code uses HID library by NicoHood
- See HID Project documentation for more Consumer keys.
- https://github.com/NicoHood/HID/wiki/Consumer-API
- */
- #include "HID-Project.h"
- void setup() {
- Consumer.begin();
- }
- void loop() {
- delay(100);
- int x;
- x = analogRead(A0);
- if (x > 1000) {
- Consumer.write(MEDIA_VOL_DOWN);
- }
- else if ( (x >= 700) && (x <=800) ) {
- Consumer.write(MEDIA_VOL_UP);
- }
- else if ( (x >= 500) && (x <=600) ) {
- Consumer.write(MEDIA_NEXT);
- }
- else if ( (x >= 350) && (x <=450) ) {
- Consumer.write(MEDIA_PREV);
- }
- else if ( (x >= 200) && (x <=300) ) {
- Consumer.write(MEDIA_PLAY_PAUSE);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement