3

Yes, you can use the analog pins as digital pins. Quoting this Arduino tutorial: pinMode(A0, OUTPUT); digitalWrite(A0, HIGH); EDIT: Here is the code snippet for digital input: pinMode(A0, INPUT); digitalRead(A0);


3

Note, you haven't specified, which Arduino you are using. I'm assuming a Atmega328p based Arduino (Uno, Nano, Mini) here, though the principle works with every AVR microcontroller, that has this hardware). With analogWrite() are are not sending data bitwise out of a pin. It configures the hardware Timer for setting that pin at a specific frequency and with a ...


2

I can confirm that 1023 does indeed give 100% duty cycle. I connected an output of my D1 Mini to my oscilloscope and got a steady voltage. I can also confirm that the same voltage is output for digitalWrite() and analogWrite(). However the output drivers may not be the same. With analogWrite() it may be using a weaker output driver that can't deliver as much ...


1

but is there something about arduino that requires using latin-1? No, not really. What it comes down to is that Serial.read() reads bytes, irrespective of whatever encoding they may be being used with. ISO-8859 only encodes character code points in the 0-255 range, so when you choose a 0-255 code point and send it as ISO-8859, it gets sent as 1 byte, which ...


1

You can use the I2C interface. TX: // Wire Master Writer // by Nicholas Zambetti <http://www.zambetti.com> // Demonstrates use of the Wire library // Writes data to an I2C/TWI slave device // Refer to the "Wire Slave Receiver" example for use with this // Created 29 March 2006 // This example code is in the public domain. #include <...


1

Pin 53 is just the default "slave select" pin. There is nothing special about it. You can use any other pin as slave select, as long as the libraries for your devices allow it (check the documentation and tutorials for those libraries). You cannot transmit information with analogWrite() since it isn't really analogue (it's PWM), and analogue doesn'...


1

Another subtle difference between analogWrite(pin, 255) and digitalWrite(pin, HIGH) is that digitalWrite requires you to set the pin to output using pinMode. analogWrite sets the pin to output on each call, which makes it slower and might ruin the code which uses the same pin alternatively as input and output, and relies on the fact that writing to the input ...


Only top voted, non community-wiki answers of a minimum length are eligible