go_away

Author Topic: How to write a byte to digital pins in Arduino?  (Read 1603 times)

0 Members and 2 Guests are viewing this topic.

Offline jocatchTopic starter

  • Jr. Member
  • **
  • Posts: 29
  • Helpful? 0
How to write a byte to digital pins in Arduino?
« on: August 20, 2010, 11:46:20 AM »
Coming from an 8052 background I know how to send a byte to an I/O port. But using C and the Arduino Mega, I am not sure how.

I want to control 2 motors using a motor driver which of course has 2 inputs for each motor and PWM. I know I can used DIGITALWRITE to set a pin but that needs to be done 4 times (or at least 2 times). If I could write one byte (actually a nimble) to some port, I can do it in one statement. Inputs?

Thanks.

JC

Offline jocatchTopic starter

  • Jr. Member
  • **
  • Posts: 29
  • Helpful? 0
Re: How to write a byte to digital pins in Arduino?
« Reply #1 on: August 20, 2010, 12:07:05 PM »
Disregard the above request.

Upon digging alot deeper into the Arduino reference docs, I finally came across the PORTx statement so I am all set. As Gilda Radner would say "Never mind!"

Joe

P.S. Why isn't there a way to delete a post??

Offline amando96

  • Robot Overlord
  • ****
  • Posts: 187
  • Helpful? 1
Re: How to write a byte to digital pins in Arduino?
« Reply #2 on: August 22, 2010, 09:34:04 AM »
Why isn't there a way to delete a post??

If someone now searches what you asked SOR will appear in the search results, and SOR gets more visitors, and since you found the answer, happy visitors  8)
Rorcle, 60% complete
AATV, 5% complete

 

Related Topics

  Subject / Started by Replies Last post
9 Replies
2738 Views
Last post February 08, 2009, 09:08:53 AM
by Joesavage1
33 Replies
4430 Views
Last post March 20, 2009, 09:16:50 PM
by SmAsH
8 Replies
4374 Views
Last post March 22, 2009, 01:10:33 AM
by SmAsH
12 Replies
5746 Views
Last post October 24, 2010, 07:53:50 AM
by Soeren


Get Your Ad Here

data_list