Go Down

Topic: Multiplexing Help - Digital I/O Pins (Read 487 times) previous topic - next topic

wsbz001

Hi,

I am new to Arduino, so I have some simple questions about using an Arduino Mega 2560 to communicate to some multiplexers (MUX36S16). My goal is to use 4 of the digital I/O pins to send signals to each multiplexer to select an input on the multiplexer. I am looking for some help on setting pins HIGH and LOW and to configure the I/O pins to be set as outputs. If anyone could direct me to someone else's post or some sample code, that would be amazing. Thank you in advance for your help.

-Spencer

septillion

I am new to Arduino,
Looks to me you don't even started yet... Did you even open standard examples like the most basic one like Blink? What questions can you possible have about "setting pins HIGH and LOW and to configure the I/O pins to be set as outputs" after looking at that... ::)
Use fricking code tags!!!!
I want x => I would like x, I need help => I would like help, Need fast => Go and pay someone to do the job...

NEW Library to make fading leds a piece of cake
https://github.com/septillion-git/FadeLed

Reiter

#define PIN10 10


void setup() {

  pinMode(PIN10 , OUTPUT); // set PIN10 as output
}


void loop() {
  digitalWrite(PIN10 , HIGH);   // turn PIN 10 on
  delay(1000);                       // wait for a second
  digitalWrite(PIN10 , LOW);    // turnPIN 10 off
  delay(1000);                       // wait for a second
}

septillion

So you copied your version of Blink... But what about it?

PS
Code: [Select]
#define PIN10 10
Most terrible name of today defined in the most terrible way...
Use fricking code tags!!!!
I want x => I would like x, I need help => I would like help, Need fast => Go and pay someone to do the job...

NEW Library to make fading leds a piece of cake
https://github.com/septillion-git/FadeLed

Reiter

So you copied your version of Blink... But what about it?

PS
Code: [Select]
#define PIN10 10
Most terrible name of today defined in the most terrible way...
I hope this version is better for you, but certainly worse for wsbz001.


Code: [Select]

void setup()
{
  pinMode(SS, OUTPUT); // set Pin 10 as output
}


void loop()
{
  digitalWrite(SS, HIGH);   // turn Pin 10 on
  delay(1000);                       // wait for a second
  digitalWrite(SS, LOW);    // turn Pin 10 off
  delay(1000);                       // wait for a second
}

Grumpy_Mike

#5
Jul 16, 2019, 05:46 pm Last Edit: Jul 16, 2019, 05:50 pm by Grumpy_Mike
@Reiter what on Earth has an LED blink program got to do with the original question?


A good way of setting the multiplex select pins to a number is shown in he first part of this. http://www.thebox.myzen.co.uk/Tutorial/Arrays.html

But it is a bit advanced for a beginner.

GolamMostafa

#6
Jul 18, 2019, 09:22 pm Last Edit: Jul 18, 2019, 09:23 pm by GolamMostafa
Look at the following diagram and then use pinMode() function to set the directions of the digital IO lines as indicated. There is no need to initialize the direction of analog line A0; it will be automatically working as input when this instruction is executed: analogRead(A0);.

Go Up