44 lines
594 B
C++
44 lines
594 B
C++
/* RFID ID12
|
|
*/
|
|
|
|
#include "WProgram.h"
|
|
void setup();
|
|
void loop ();
|
|
char val = 0; // variable to store the data from the serial port
|
|
int i=0;
|
|
|
|
void setup() {
|
|
Serial.begin(9600); // connect to the serial port
|
|
delay(100);
|
|
Serial.println("Hola");
|
|
}
|
|
|
|
void loop () {
|
|
// read the serial port
|
|
|
|
if(Serial.available() > 0) {
|
|
val = Serial.read();
|
|
Serial.print(val, BYTE);
|
|
analogWrite(9,255);
|
|
analogWrite(10,255);
|
|
analogWrite(11,255);
|
|
delay(10);
|
|
analogWrite(9,0);
|
|
analogWrite(10,0);
|
|
analogWrite(11,0);
|
|
}
|
|
}
|
|
|
|
int main(void)
|
|
{
|
|
init();
|
|
|
|
setup();
|
|
|
|
for (;;)
|
|
loop();
|
|
|
|
return 0;
|
|
}
|
|
|