serial port - Arduino AltSoftSerial press enter to read/print altSerial? -
don't know if there arduino-wizards around here on stackoverflow, i'm gonna try , find one! i'm having issues understanding code, , why can't automate process instead of pressing enter.
i'm using rfid reader read tags, , using altsoftserial library. however, in order print tagid serial, need press enter. , love of god can't figure out why is. isn't possible check altserial.read id, , print when appears? cause when print serial automatically lot of 'fffffffffffffffffffffffffffffffffffff' noise...
#include <altsoftserial.h> altsoftserial altserial; char txrxbuffer[255]; char get_readid[] = { 0xaa , 0x00, 0x03, 0x25, 0x26, 0x00, 0x00, 0xbb }; void setup() { serial.begin(9600); serial.println("hit enter read rfid number"); altserial.begin(9600); } void loop() // run on , on { int counter = 0; if (serial.available()){ serial.read(); serial.println(""); (counter =0 ; counter < 8 ; counter++){ char tagid = get_readid[counter]; altserial.write(tagid); } } if (altserial.available()) serial.print(altserial.read(),hex); }
seems before reading tag, have send specific code rfod reader, code sending in first if; if @ least 1 char received on serial (from pc), read char (but not store it, clean input buffer, every char read, char good), , send code. second if answer , if present send pc. send code setup() , after every read, or alternative commad remain enabled
Comments
Post a Comment