ilan Expert Licensed User Longtime User Jun 13, 2022 #1 Hi i see that it is possible to use Analog Pins as Digital pins. so if i am out of all digital pins i could basically use the analog pins to write HIGH/LOW Voltage like i do with Digital Pins, right? digitalWrite() - Arduino Reference The Arduino programming language Reference, organized into Functions, Variable and Constant, and Structure keywords. www.arduino.cc how to initialize the Pin? with A1 instead of 1 (like a digital pin)?
Hi i see that it is possible to use Analog Pins as Digital pins. so if i am out of all digital pins i could basically use the analog pins to write HIGH/LOW Voltage like i do with Digital Pins, right? digitalWrite() - Arduino Reference The Arduino programming language Reference, organized into Functions, Variable and Constant, and Structure keywords. www.arduino.cc how to initialize the Pin? with A1 instead of 1 (like a digital pin)?
klaus Expert Licensed User Longtime User Jun 13, 2022 #2 The initialization is the same. Only the pin number is different. Digital pin, pin number as integer: B4X: DPin.Initialize(3, DPin.MODE_INPUT) Analog pin: Analog pin, pin number like below: B4X: APin.Initialize(APin.A0, APin.MODE_INPUT) A link to documentation. Last edited: Jun 13, 2022 Upvote 0
The initialization is the same. Only the pin number is different. Digital pin, pin number as integer: B4X: DPin.Initialize(3, DPin.MODE_INPUT) Analog pin: Analog pin, pin number like below: B4X: APin.Initialize(APin.A0, APin.MODE_INPUT) A link to documentation.
ilan Expert Licensed User Longtime User Jun 13, 2022 #3 Can i use digitalwrite with analog pins right? Upvote 0
klaus Expert Licensed User Longtime User Jun 13, 2022 #4 Yes. But once you have set an analog pin as output, and later you want to use as an analog input, you need to reinitialize for input. Upvote 0
Yes. But once you have set an analog pin as output, and later you want to use as an analog input, you need to reinitialize for input.