Using Nextion displays with the Arduino

Nextion are a range of HMI displays with built in controller that can be used with any microcontroller via a 2 pin UART interface. We have some resources here. Installing Nextion Arduino Library Download ITEADLIB_Arduino_Nextion from GitHub Rename the “ITEADLIB_Arduino_Nextion-master” folder to “ITEADLIB_Arduino_Nextion”.Move it to your Arduino IDE installation libraries folder. Configuring the library for […]

Read More

Arduino UNO

https://store.arduino.cc/arduino-uno-rev3 Microcontroller: ATmega328PIO voltage: 5V IO pin high voltage (for VCC = 5V): min 0.6VCC to max VCC + 0.5So digital IO pins have a nominal high level input range of 3.0V to 5.5V, so are compatible with 3.3V input signals. UART pins RX and TX are marked as the pins that are RX and TX on […]

Read More

Increasing available memory

To increase available RAM Move constants to program memory instead of RAM Use the F macro to move string literals to program memory. Serial.print("some string") is stored in RAM (dynamic memory), Serial.print(F("some string literal") is stored in program memory. Any function that uses the print class functions can use the F macro (e.g.client.print). Avoid long […]

Read More

RAM

Ram used in interrupts Use volatile: volatile byte my_variable_name; Stopping constants using RAM Use the F macro to move string literals to program memory. Serial.print(“some string”) is stored in RAM (dynamic memory), Serial.print(F(“some string literal”) is stored in program memory.  Any function that uses the print class functions can use the F macro (e.g.client.print).  Use […]

Read More

UNO-Comparator Interrupt

Initialise //Enable gobal interrupts (should already be enabled but do anyway) SREG = SREG | B10000000; Turning interrupt on //Enable analog comparator interrupt ACSR = B00000010; //On failing edge (bit 1=1), AIN0 applied to positive input of the analog comparator (bit6=0) ACSR = ACSR | B00001000; // Enable analog comparator interrupt (bit 3). Turning interrupt […]

Read More