Connect with us

Sending a hex number to 8 pins

Discussion in 'Microcontrollers, Programming and IoT' started by gregfox, Dec 24, 2015.

  1. gregfox

    gregfox

    149
    3
    Mar 25, 2013
    Hi all,
    I'm trying to send a hex code to 8 pins of a parallax propeller in c.
    Send hex 38 to pins 27,26,25,24,23,22,21,20 which is 00111000 in binary, so that;
    0 goes to pin27
    0 goes to pin26
    1 goes to pin25
    1 goes to pin24
    1 goes to pin23
    0 goes to pin22
    0 goes to pin21
    0 goes to pin20
    In stead of sending a binary to each pin I want to send a single hex code.
    Thanks
     
  2. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,178
    2,690
    Jan 21, 2010
  3. cjdelphi

    cjdelphi

    1,098
    104
    Oct 26, 2011
    You'll find those 8 pins are infact 8bits

    You should be able to set the value and each bit will represent the byte..
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-