Go Down

Topic: Binary Tutorial? (Read 1 time) previous topic - next topic

Bosscheesemo

Hello everybody I'm new to Arduino and I'm getting used to C slowly. The bulk of my programming background is in programming PIC18's in machine assembly code.

My question is how do I incorporate binary and hex into Arduino and C? Can anybody provide a few good sample programs that can illustrate hex and binary being used in the Arduino environment? Is it even possible to interface to C using raw binary values?

At the moment I've got a row of 10 LEDs and a potentiometer. One lab i would like to try is a binary counter and another is rotating the POT and having the LEDs show the binary value of the POT's wiper.


fungus


byte = 0xff;
byte = b00000000;

for starters


...as a google search for "hexadecimal in C" would have revealed.
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

AWOL

Quote
byte = b00000000;

Close, but no oral carcinogens.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Bosscheesemo


byte = 0xff;
byte = b00000000;

for starters


That's not very helpful to me. Could you use this in a sample of code to illustrate proper use?

Go Up