[Solved] Arduino audio playback without SD card not working? [closed]

const unsigned char sample2[] PROGMEM = { 100,96,84,72,60,58,46,34,20,18,4,12,20,38,46,54,62, }; int inPin = 7; void setup() { pinMode(inPin, INPUT_PULLUP); } int lastPin = HIGH; // HIGH means not pressed for Pullup Inputs void loop() { int pin = digitalRead(inPin); if (pin == lastPin) return; if (pin == HIGH) { startPlayback(sample1, sizeof(sample1)); } else { startPlayback(sample2, sizeof(sample2)); … Read more

[Solved] control servo using android

Read the data as string using: string input = bluetooth.readString(); Then convert string to int using: int servopos = int(input); Then write the position to the servo:servo.write(servopos); Now depending on the data you send from android, you could need to : Trim it: input = input.trim(); Or constrain it : servopos = constrain(servopos,0,180); Your corrected … Read more

[Solved] what does type error mean in Arduino

Introduction Type errors in Arduino refer to errors that occur when the data type of a variable or an expression does not match the expected data type. These errors can occur when a variable is declared with the wrong data type, when a variable is used in an expression with an incompatible data type, or … Read more

[Solved] Split string into N parts [closed]

You can do it recursively. First part size m = (str_size+N-1)/N; Then str_size -= m; and N–; A little example: #include <iostream> #include <vector> #include <string> std::vector<std::string> split_string(const std::string& s, int N) { std::vector<std::string> vect; if (N > s.size()) return vect; vect.resize(N); int n = s.size(); auto it = s.begin(); int Nnew = N; for … Read more

[Solved] Is there anyway we could use the data from rfid to fetch something from another website? [closed]

You need to have some kind of storage on your backend side, which will map RFID IDs to some website. Then you could redirrect user to that website with HTTP codes 301 or 302. Here is a pseudocede example for client and server: # Client rfid_id = get_rfid_id() make_request_to_server(rfid_id) # Server storage = { ‘12345’: … Read more

[Solved] Communication between wemos d1(as a client) and a webserver(on arduino or wemos d1) through LAN [closed]

Yes, you can run a webserver with Arduino. This is the example from https://www.arduino.cc/en/Tutorial/WebServer /* Web Server A simple web server that shows the value of the analog input pins. using an Arduino Wiznet Ethernet shield. Circuit: * Ethernet shield attached to pins 10, 11, 12, 13 * Analog inputs attached to pins A0 through … Read more

[Solved] What is the outcome of this function? [closed]

This sets x to a value from -15 to 15 (inclusive) based on the voltage at pin analogPort. 15 means 5 volts and -15 means 0 volts. This value is then used to set a delay between 100 (-(pow(2*15,2))+1000) and 1000 (-(pow(2*0,2))+1000) since the square of 2*x and 2*-x yield the same number. In other … Read more