![]() ![]() I used register access 'shortcut' to set 8 outputs at a time vs looping thru pinMode. The port pins are tri-stated when reset condition becomes active, To switch the pull-up resistor off, PORTxn has to be written logic zero or the pin has toīe configured as an output pin. If PORTxn is written logic one when the pin is configured as an input pin, the pull-up resistor isĪctivated. If DDxn is written logic zero, Pxn is configured as an input The DDxn bit in the DDRx Register selects the direction of this pin. As shown in ”Registerĭescription” on page 91, the DDxn bits are accessed at the DDRx I/O address, the PORTxn bitsĪt the PORTx I/O address, and the PINxn bits at the PINx I/O address. Read the datasheet, many answers are there:Įach port pin consists of three register bits: DDxn, PORTxn, and PINxn. Im very new and know nothing about this arduino can i ask some reference where can i learn more about this arduino? maybe you know some recommended ebooks for me to buy. Can you give me a little explanation about your code? what is the difference between DDRG = 0xff and pinmode(1, OUTPUT) ? and what was DDRA-DDRF mean? Im sorry for my newbie question. You said that your code is use to set ports as output. Serial.begin(9600) // set up Serial library at 9600 bps Using simple code like this void setup() // run once, when the sketch starts So i detect 11 sensor using pin number 2-13 and 31 sensors using pin number 22-53. You was right Waski only pin number 2-13 and 22-53 was usedd. Big thankssss to both of youuuu!!! Now i can detect 40 digital sensorss.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |