Sha256: 58d605af7fafbaf0269582b02dac474f5c2985960b86ce9a219a60213ed23184
Contents?: true
Size: 829 Bytes
Versions: 18
Compression:
Stored size: 829 Bytes
Contents
#include <Firmata.h> void setup() { Firmata.setFirmwareVersion(FIRMATA_MAJOR_VERSION, FIRMATA_MINOR_VERSION); Firmata.attach(START_SYSEX, sysexCallback); Firmata.begin(57600); } void loop() { while(Firmata.available()) { Firmata.processInput(); } } void sysexCallback(byte command, byte argc, byte*argv) { switch(command){ case 0x01: // LED Blink Command if(argc < 3) break; byte blink_pin; byte blink_count; int delayTime; blink_pin = argv[0]; blink_count = argv[1]; delayTime = argv[2] * 100; pinMode(blink_pin, OUTPUT); byte i; for(i = 0; i < blink_count; i++){ digitalWrite(blink_pin, true); delay(delayTime); digitalWrite(blink_pin, false); delay(delayTime); } Firmata.sendSysex(command, argc, argv); // callback break; } }
Version data entries
18 entries across 18 versions & 1 rubygems