try/catch block in Arduino

The Arduino reference is not listing try catch (for details of why see, for example, this related answer). And I assume, that implementing try catch on a µ-controller could be kind of difficult/impossible. Try catch in most languages is a quite expensive operation: The program stack get copied once for the try block and for … Read more

Bitwise operation |= in C

| performs a bitwise OR on the two operands it is passed. For example, If you look at the underlying bits for 0x0A and 0x50, they are 0b00001010 and 0b01010000 respectively. When combined with the OR operator the result in b is 0b01011010, or 0x5A in hexadecimal. |= is analogous to operators like += and -= in that it will perform a bitwise OR on the two operands then store the result in … Read more

avrdude: stk500v2_ReceiveMessage(): timeout

This is the main error that I get when I try to run my ARDUINO program. The full list of errors is as follows: My code is as follows: I have tried updating the drivers (they are fully updated) and downloading some programs. I have Windows 7 and my arduino is a MEGA 2560. It … Read more

tech