Question: Can anyone help to get this code running? Not sure how to fix the error. #include Arduino.h #include Buzzer.h #include HX711.h #include Wire.h #include SPI.h

Can anyone help to get this code running? Not sure how to fix the error.

#include "Arduino.h" #include "Buzzer.h" #include "HX711.h" #include "Wire.h" #include "SPI.h" #include "Adafruit_SSD1306.h" #include "Adafruit_GFX.h"

#define BUZZER_PIN_SIG 2 #define SCALE_PIN_DAT 3 #define SCALE_PIN_CLK 4 #define OLED128X64_PIN_VCC 5 #define OLED128X64_PIN_DC 6 #define OLED128X64_PIN_CS 5 #define HX711 (F("0.2.1"))

Buzzer buzzer(BUZZER_PIN_SIG); #define scale (SCALE_PIN_DAT, SCALE_PIN_CLK); #define calibration_factor 2280 // Obtain factor from calibration factor code https://learn.sparkfun.com/tutorials/load-cell-amplifier-hx711-breakout-hookup-guide?_ga=2.77038550.2126325781.1526891300-303225217.1493631967 #define SSD1306_LCDHEIGHT 64 Adafruit_SSD1306 oLed128x64(OLED128X64_PIN_DC, OLED128X64_PIN_VCC, OLED128X64_PIN_CS); void setup() // put your setup code here, to run once: { Serial.begin(9600); while (!Serial) ; // wait for serial port to connect. Needed for native USB Serial.println("start"); scale.begin(SCALE_PIN_DAT, SCALE_PIN_CLK); scale.set_scale(calibration_factor); scale.tare(); //Assuming there is no weight on the scale at start up, reset the scale to 0 menuOption = menu(); }

void loop() // put your main code here, to run repeatedly: { if(menuOption == '1') { // Buzzer - Test Code // The buzzer will turn on and off for 500ms (0.5 sec) buzzer.on(); // 1. turns on delay(500); // 2. waits 500 milliseconds (0.5 sec). Change the value in the brackets (500) for a longer or shorter delay in milliseconds. buzzer.off(); // 3. turns off. delay(500); // 4. waits 500 milliseconds (0.5 sec). Change the value in the brackets (500) for a longer or shorter delay in milliseconds. } else if(menuOption == '2') { // Graphic LCD 160x128 Huge - Test Code // The LCD Screen will display the text of your choice at the location (30,50) on screen. Counting from the top left corner: 30 pixels to the right and 50 pixels down graphicLCD.setX(30); // 1. sets left-right indent for text to print. Change the value in the brackets (1 - left, 164 - right) for a different indent. graphicLCD.setY(50); // 2. sets top-bottom height for text to print. Change the value in the brackets (1 - top, 128 - bottom) for a different height. graphicLCD.print("The Safety Shovel"); // 3. prints the text in the brackets. Modify the text to get your own unique print. delay(1000); // 4. waits 1000 milliseconds (1 sec). Change the value in the brackets (1000) for a longer or shorter delay in milliseconds. graphicLCD.clear(); // 5. wipes the screen delay(1000); // 6. waits 1000 milliseconds (1 sec). Change the value in the brackets (1000) for a longer or shorter delay in milliseconds. } else if(menuOption == '3') { // SparkFun HX711 - Load Cell Amplifier - Test Code scale.begin(SCALE_PIN_DAT, SCALE_PIN_CLK); scale.set_scale(calibration_factor); float scaleUnits = scale.get_units(); //scale.get_units() returns a float graphicLCD.setX(30); graphicLCD.setY(50); Serial.print(scaleUnits); Serial.println(" lbs"); graphicLCD.print(scaleUnits "lbs"); } if (millis() - time0 > timeout) { menuOption = menu(); } // Alarm sounds 3 times if weight exceeds limit // Weight needs to be defined for this section of code to function // Alarm code begins if (scaleUnits > 10){ buzzer.on(); delay(1000); buzzer.off(); delay(500); buzzer.on(); delay(1000); buzzer.off(); delay(500); buzzer.on(); delay(1000); buzzer.off(); delay(500); }

else{ buzzer.off(); } // Alarm code endsCan anyone help to get this code running? Not sure how to

| 17 pt. aut AAA, o ran Tapasy: 1 I L.T. -- TONEET JT ** f nfc * ! * , 11 terr7 1. : . - ... . ila - ... - - . . . - ---- -. .. . F C /!ter *111 mond++ for 500 13.5 L.VII. RAYS: 772. WE 5001 til 13. Charnath in the traccet. (Color hacer AIRY million. tuzzer. 01:1 dy ISUU: 1 clc Sza.coption - // Gestion 10 lexues Codul ?! A TED BARN 11 the part 1 Chat A-HA 1-om (30,00 RCTAAN ting from the 16+- OSTA: 39 T TA the right and to . LLLL 64 TAPD. St.Vi 2. to tonton hint tar text to print. Charot. Van in the track 1 t., 12 tritten tur i ditt rent hit. graphicle.print("ibe safety shovelli: 1! 3. prints the text in the brackers. Modify the text to get your nique princ. deyil !! 4. i 100 milliouwd (1) Colla value in Le Livela (2009) IULIung UE alores delay in . r +f, 17 5. wise the crean del 1100011 16. Wt 1000 nillisccouds ( Ice). Change the walue in the brackets (1000) Io longer or shortce delay in seconds 1 TRA 1 (YAH : 17 v 3711 - 3A 5.3 :qir |--Tr_r_THI, CLE_TT_CLW; scate eccleicolibration Pastori L) TAPI RAT? graphiLD. COX1501 Eerial.LIMLM) Seriale !! " Th": - - -- _ - ;1; . = 1 CAETAVE - 1 TTTTTT DONUTLON - : 1 -ii L. !! 3 in 1 : li !! nicht dat te detin tor this website on ta tuncta Am code ins expected primary-expression before'' taken Copy error messages xi. xlu 1 expected Wirar-lesson Eefore '.' Toen 70 Arduino Une | 17 pt. aut AAA, o ran Tapasy: 1 I L.T. -- TONEET JT ** f nfc * ! * , 11 terr7 1. : . - ... . ila - ... - - . . . - ---- -. .. . F C /!ter *111 mond++ for 500 13.5 L.VII. RAYS: 772. WE 5001 til 13. Charnath in the traccet. (Color hacer AIRY million. tuzzer. 01:1 dy ISUU: 1 clc Sza.coption - // Gestion 10 lexues Codul ?! A TED BARN 11 the part 1 Chat A-HA 1-om (30,00 RCTAAN ting from the 16+- OSTA: 39 T TA the right and to . LLLL 64 TAPD. St.Vi 2. to tonton hint tar text to print. Charot. Van in the track 1 t., 12 tritten tur i ditt rent hit. graphicle.print("ibe safety shovelli: 1! 3. prints the text in the brackers. Modify the text to get your nique princ. deyil !! 4. i 100 milliouwd (1) Colla value in Le Livela (2009) IULIung UE alores delay in . r +f, 17 5. wise the crean del 1100011 16. Wt 1000 nillisccouds ( Ice). Change the walue in the brackets (1000) Io longer or shortce delay in seconds 1 TRA 1 (YAH : 17 v 3711 - 3A 5.3 :qir |--Tr_r_THI, CLE_TT_CLW; scate eccleicolibration Pastori L) TAPI RAT? graphiLD. COX1501 Eerial.LIMLM) Seriale !! " Th": - - -- _ - ;1; . = 1 CAETAVE - 1 TTTTTT DONUTLON - : 1 -ii L. !! 3 in 1 : li !! nicht dat te detin tor this website on ta tuncta Am code ins expected primary-expression before'' taken Copy error messages xi. xlu 1 expected Wirar-lesson Eefore '.' Toen 70 Arduino Une

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!