Arduino-Based Ordering System using QR/Barcode Scanner

Very simple: 40 mA is the absolute maximum current.

It is never a good idea to run at or exceed an absolute maximum rating, so 20 mA is the recommended maximum, and is safe for long term operation.

I can understand but maximum is different from recommended.

You are certainly correct!

For output pin current sink or current draw, the absolute maximum of 40 mA is to be avoided, and the recommended maximum of 20 mA should be heeded.

Arduino specification is very conservative about the maximum current of a pin but didn't the same when says that an Arduino can be powered with 12 V.

We all know that 5 V regulator will overheat with about 300 mA when the board is powered with 12 V.

This information serves only to confuse beginners.

What could be missing to this code? The compiler says "Compilation error: 'textsize' does not name a type"

#include <TftSpfd5408.h>
#include <pin_magic.h>
#include <registers.h>

#include <RH_ASK.h>
#include <SPI.h>
#include <SPFD5408_Adafruit_GFX.h>
#include <SPFD5408_Adafruit_TFTLCD.h>
#include <SPFD5408_TouchScreen.h>

RH_ASK driver;

#define TS_MINX 125
#define TS_MINY 85
#define TS_MAXX 965
#define TS_MAXY 905

#define YP A3
#define XM A2
#define YM 9
#define XP 8

// Define touch screen pressure thresholds
#define MINPRESSURE 10
#define MAXPRESSURE 1000

#define BLACK   0x0000
#define BLUE    0x001F
#define RED     0xF800
#define GREEN   0x07E0
#define CYAN    0x07FF
#define MAGENTA 0xF81F
#define YELLOW  0xFFE0
#define WHITE   0xFFFF
#define GOLD    0xFEA0
#define LIME    0xAFE5

TouchScreen ts = TouchScreen(XP, YP, XM, YM, 364);

TftSpfd5408 tft; // declare an object of type TftSpfd5408

textsize  = 1;

void setup() {
  tft.setRotation(1); // adjust the screen orientation as needed
}

void loop() {
  tft.fillScreen(WHITE);
  tft.drawRoundRect(0, 0, 319, 240, 8, WHITE);     //Page border
  tft.fillRoundRect(30, 40, 100, 40, 8, GOLD);
  tft.drawRoundRect(30, 40, 100, 40, 8, WHITE);  //Dish1​
  tft.fillRoundRect(30, 90, 100, 40, 8, GOLD);
  tft.drawRoundRect(30, 90, 100, 40, 8, WHITE);  //Dish2​
  tft.fillRoundRect(30, 140, 100, 40, 8, GOLD);   //Dish3
  tft.drawRoundRect(30, 140, 100, 40, 8, WHITE);

  tft.setCursor(60, 0);
  tft.setTextSize(3);
  tft.setTextColor(LIME);
  tft.print("   Menu");
  tft.setTextSize(2);
  tft.setTextColor(WHITE);
  tft.setCursor(37, 47);
  tft.print(" Dish1");

  TSPoint p = ts.getPoint();
  p.x = map(p.x, TS_MAXX, TS_MINX, 0, 320);
  p.y = map(p.y, TS_MAXY, TS_MINY, 0, 240);

  if (p.x > 180 && p.x < 280 && p.y > 190 && p.y < 230  && p.z > MINPRESSURE && p.z < MAXPRESSURE)
  {
    Serial.println("Dish1");
    char* msg = "Dish1"; // declare and initialize the msg variable
    driver.send((uint8_t *)msg, strlen(msg));
    driver.waitPacketSent();
    delay(1000);
    tft.fillRoundRect(30, 40, 100, 40, 8, WHITE);
    delay(70);
    tft.fillRoundRect(30, 40, 100, 40, 8, GOLD);
    tft.drawRoundRect(30, 40, 100, 40, 8, WHITE);
    tft.setCursor(37, 47);
    tft.print(" Dish1");
    delay(70);
  }
}

What happened to my advice about UTFT library?

Good day! How could I connect our QR/Barcode Scanner (MH-ET LIVE) to the Arduino Uno set so that the Arduino can receive the detected information and display it to the Arduino IDE

Care to share a few detail on your device? Like a data sheet or use documentation?

May I suggest your very first step is to test the device using a USB connection to you PC. Use a standard terminal program like PUTTY.
The device may also be able to appear to be a keyboard, but I am not sure of that. Just plug into your UBS and see if it powers up and does something. The Arduino can come later.
I do not have that board, so cannot tell you what to connect to you Arduino, but you will need to use a Software Serial program to make a second serial port for the Arduino.

This module works with 3.3 V a level shifter or voltage divider is needed.

Captura de tela de 2023-03-14 00.14.03

The connection should be like this:

Threads merged.

Hello migsdacs11, can you please share the code you used for the barcode scanner. I am using the same module for our project as well but i can't make the scanner work. It would be a great help, thanks a lot

Because of this ↓

It could be uint8_t textsize=1; or int textsize = 1;

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.