volatile int pressed = 0;
// put your setup code here, to run once:
// pin change interrupt
PCMSK2 |= bit (PCINT18)| bit (PCINT19); // want pin D2 and D3
PCIFR |= bit (PCIF2); // clear any outstanding interrupts
PCICR |= bit (PCIE2); // enable pin change interrupts for D0 to D5
//enable watchdog to check for code lockups
// handle pin change interrupt for D2/D3
pressed = 1;
void sleepNow ()
set_sleep_mode (SLEEP_MODE_PWR_DOWN); // sleep mode is set here
byte adcsra_save = ADCSRA;
ADCSRA = 0; // disable ADC
power_all_disable (); // turn off all modules
sleep_cpu (); // now goes to Sleep and waits for the interrupt
ADCSRA = adcsra_save; // stop power reduction
power_all_enable (); // turn on all modules
// put your main code here, to run repeatedly:
//reset watchdog timer
//print if button pressed
if (pressed == 1)
pressed = 0;
//do something useful here
float dtostf();and doesn't work, looks like i will never understand where to put it in the code. I have no clue how to call dtostf with float... thank you for your time anyway.
The EID number looks like this: 982_000175197588, and the visual number on the tag is like this:Are these actual numbers from a particular tag or "like" the numbers? Can you please post actual numbers?
UK9 371177 0800 5.
The output format for a read of an EM4100 transponder is a simple string of 10 ASCII coded Hexidecimal characters followed by the ASCII code $0D (carriage return) as a string end marker.Thus I would expect to see some numbers in the range A to F (in addition to 0 to 9), and not to see an underscore. I also expect to see 10 of them, and not some other number.