Go to link using if condition using Arduino IDE - arduino

I'm just trying to get myself here "http://192.168.1.103:30000/?k=23&v=capture" when an if condition meet its requirement.
#include <ESP8266WiFi.h>
// I purposely don't include the ssid and ssid1 here
WiFiServer server(80);
void setup() {
pinMode(1, INPUT);
Serial.begin(115200);
delay(10);
Serial.println();
WiFi.softAP(ssid1, password1);
Serial.println(WiFi.localIP());
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.mode(WIFI_AP_STA);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
// Start the server
server.begin();
Serial.println("Server started");
}
void loop() {
String link = "http://192.168.1.103:30000/?k=23&v=capture";
WiFiClient client = server.available();
if (!client) {
return;
}
int var = digitalRead(1);
if (var == HIGH) {
client.print(link);
}
Let's say:
I already run Chrome.
How can that link above be called without even typing it on Chrome? I want to connect to it automatically.
Any method you could teach? I got the feeling this code itself is wrong.
Thanks.
-- EDIT --
NEW CODE FOR UNO
//language c++
#include <Servo.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#define I2C_ADDR 0x3F // Scanning address
LiquidCrystal_I2C lcd(I2C_ADDR, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Set the LCD I2C address
Servo Servo1;
int servopin = 9;
void setup() {
Serial.begin(9600);
lcd.begin(16, 2);
// initialize the lcd for 16 chars 2 lines, turn on backlight
lcd.backlight(); // finish with backlight on
lcd.setCursor(3, 0); //Start at character 4 on line 0
lcd.print("WAITING...");
pinMode(12, OUTPUT); // pin LaserLight
pinMode(11, INPUT); // pin LaserDetector
pinMode(10, INPUT); // pin PIR
pinMode(9, OUTPUT); // pin Servo
pinMode(8, OUTPUT); // MCU PIN GPIO2
Servo1.attach(servopin);
}
void loop() {
digitalWrite(12, HIGH);
boolean inputlaser = digitalRead(11);
boolean inputpir = digitalRead(10);
Serial.println(inputlaser);
Serial.println(inputpir);
if (inputlaser < 1) {
digitalWrite(8, HIGH);
lcd.setCursor(0, 0);
lcd.print("camera on");
lcd.setCursor(0, 1);
lcd.print("robber!");
delay(5000);
Servo1.write(180);
} else if (inputpir > 0) {
Servo1.write(180);
lcd.setCursor(0, 0);
lcd.print("robber inside!");
lcd.setCursor(0, 1);
lcd.print("HELP ROBBER!");
delay(500);
} else {
lcd.clear();
lcd.setCursor(3, 0);
lcd.print("standby...");
delay(500);
}
}
NEW CODE FOR MCU
#include <ESP8266WiFi.h>
char server[] = "192.168.1.103";
WiFiClient client;
void setup() {
pinMode(4, INPUT);
digitalWrite(4, LOW);
Serial.begin(115200);
delay(10);
Serial.println();
WiFi.softAP(ssid1, password1);
Serial.println(WiFi.localIP());
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.mode(WIFI_AP_STA);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
}
void loop() {
boolean var = digitalRead(4);
if (var == HIGH) {
client.connect(server, 30000);
Serial.println("connected");
// Make your API request:
client.println("GET /?k=23&v=capture");
client.println("Host: 192.168.1.103");
client.println("Connection: close");
client.println();
} else {
// if you didn't get a connection to the server:
Serial.println("connection failed");
}
Serial.println(digitalRead(4));
}

First understand a fact that you doesn't need google chrome for requesting a website.
client.println("GET /?k=23&v=capture");
client.println("Host: 192.168.1.103");
What you do in the above line is that you request for /?k=23&v=capture addressed content in the ip address 192.168.1.103, Actully this is what you do when you use a google chrome. On PC you require a google chrome (or any other browser) for web site request because its difficult to request using commands each time (Think of requesting for a single page using a hell of http commands instead of using chrome, Ohh that's mess). So understand chrome isn't needed to access a site.

Related

NodeMCU ESP8266 Client-Server communication

I am trying to connect two ESP8266 boards to communicate with each other. The client board first connects to the server and sends a message, the character 'd', after the server receives the message it replies with "Hello from server".
Server
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
char *ssid = "SSID";
char *pass = "PASS";
int stat;
WiFiServer server(8080);
void setup() {
Serial.begin(115200);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid,pass);
Serial.println("Connecting to wifi ");
while(WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
delay(500);
}
Serial.print("SSID :");
Serial.print(ssid);
Serial.println("ip: ");
Serial.print(WiFi.localIP());
server.begin();
}
void loop() {
WiFiClient client = server.available();
if(client){
if(client.connected()){
Serial.println("Client connected");
if(client.available() > 0){
delay(500);
char data = client.read();
Serial.println(data);
delay(500);
}
char d[] = "Hello from server";
client.println(d);
}
client.stop();
}
}
Client
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
char *ssid = "SSID";
char *pass = "PASS";
char *host = "ip";
WiFiClient client;
void setup() {
Serial.begin(115200);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid,pass);
Serial.println("Connecting to wifi");
while(WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
delay(500);
}
//Serial.println("Connecting to wifi network");
Serial.print("SSID: ");
Serial.print(ssid);
Serial.println("Connected");
}
void loop() {
// put your main code here, to run repeatedly:
if(client.connect(host, 8080)) {
Serial.println("Connected to server");
client.println('d');
if(client.available() > 0){
delay(500);
Serial.println(client.read());
delay(500);
}
else{
Serial.println("No data received");
}
}
else{
Serial.println("Cannot connect to server");
}
client.stop();
}
The problem is that the message from client is received by the server. But the reply is not sent. When I try to see the reply from server using serial monitor in the client it gets connected to the server and the message is sent but the reply is not received.
I'm new to this domain and would like to know whether I'm doing it correctly or not. Any suggestions and solutions will help a lot.
Thank you.

ESP8266 is not able to connect to mosquitto broker. "Attempting MQTT connection...failed, rc=-2 try again in 5 seconds"

I'm running a mosquitto broker and a node-red server in my PC , node-red is able to connect to mosquitto. The ESP8266 is able to connect to the WiFi but not to the broker a "Attempting MQTT connection...failed, rc=-2 try again in 5 seconds" message is displayed in the serial monitor. I'm also using MQTT explorer I don't know if it has something to do with it.
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
// Update these with values suitable for your network.
const char* ssid = "Milagros";
const char* password = "18095381";
const char* mqtt_server = "192.168.1.133";
WiFiClient espClient;
PubSubClient client(espClient);
unsigned long lastMsg = 0;
#define MSG_BUFFER_SIZE (50)
char msg[MSG_BUFFER_SIZE];
int value = 0;
void setup_wifi() {
delay(10);
// We start by connecting to a WiFi network
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
randomSeed(micros());
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
}
void callback(char* topic, byte* payload, unsigned int length) {
Serial.print("Message arrived [");
Serial.print(topic);
Serial.print("] ");
for (int i = 0; i < length; i++) {
Serial.print((char)payload[i]);
}
Serial.println();
// Switch on the LED if an 1 was received as first character
if ((char)payload[0] == '1') {
digitalWrite(BUILTIN_LED, LOW); // Turn the LED on (Note that LOW is the voltage level
// but actually the LED is on; this is because
// it is active low on the ESP-01)
} else {
digitalWrite(BUILTIN_LED, HIGH); // Turn the LED off by making the voltage HIGH
}
}
void reconnect() {
// Loop until we're reconnected
while (!client.connected()) {
Serial.print("Attempting MQTT connection...");
// Create a random client ID
String clientId = "ESP8266Client-";
clientId += String(random(0xffff), HEX);
// Attempt to connect
if (client.connect(clientId.c_str())) {
Serial.println("connected");
// Once connected, publish an announcement...
client.publish("data", "hello world");
// ... and resubscribe
} else {
Serial.print("failed, rc=");
Serial.print(client.state());
Serial.println(" try again in 5 seconds");
// Wait 5 seconds before retrying
delay(5000);
}
}
}
void setup() {
pinMode(BUILTIN_LED, OUTPUT); // Initialize the BUILTIN_LED pin as an output
Serial.begin(115200);
setup_wifi();
client.setServer(mqtt_server, 1883);
client.setCallback(callback);
}
void loop() {
if (!client.connected()) {
reconnect();
}
client.loop();
unsigned long now = millis();
if (now - lastMsg > 2000) {
lastMsg = now;
++value;
snprintf (msg, MSG_BUFFER_SIZE, "hello world #%ld", value);
Serial.print("Publish message: ");
Serial.println(msg);
client.publish("data", msg);
}
}```

Sending an array from one Nodemcu to another Nodemcu?

I am working on a gesture control car project and I find everyone on the internet using RF modules or Bluetooth modules to do it, I had two NodeMCU lying around so I thought why not use them and bring a change. But I am finding difficulty in sending the accelerometer values from one Nodemcu to another, For connecting the two Nodemcu I took help from here
https://www.instructables.com/id/WiFi-Communication-Between-Two-ESP8266-Based-MCU-T/
So instead of a string (which they use), I tried sending an array of two variables, but I fail to send/receive it from the transmitter to the receiver. I have spent a lot of time on it, but I think I need help.
I now know ( just this morning ) that Nodemcu has only one analog pin, I have ordered for a 74HC4051 IC. So I haven't changed the code for that, so please bear that in mind. Also, I have used the xAxis only now just to test if the data is being sent, but it is not.
If there is any other easier way of sending the two variable values, please do suggest.
This is the actual project, I asked the author for help, but no reply yet.
https://www.youtube.com/watch?v=svJwmjplm4c
I have given below the edited code that I have now
Transmitter code
#include <SPI.h>
#include <ESP8266WiFi.h>
int xAxis = A0;
int yAxis = D2;
int data[1];
int x;
int ledPin = D8;
char ssid[] = "********"; // SSID
char pass[] = "********"; // password I removed them while posting the question
WiFiServer server(80);
IPAddress ip(192, 168,1, 80); // IP address of the server
IPAddress gateway(192,168,1,1); // gateway of your network
IPAddress subnet(255,255,255,0); // subnet mask of your network
void setup() {
Serial.begin(115200); // only for debug
WiFi.config(ip, gateway, subnet); // forces to use the fix IP
WiFi.begin(ssid, pass); // connects to the WiFi router
while (WiFi.status() != WL_CONNECTED) {
Serial.print(".");
delay(500);
}
server.begin(); // starts the server
Serial.println("Connected to wifi");
Serial.print("Status: "); Serial.println(WiFi.status()); // some parameters from the network
Serial.print("IP: "); Serial.println(WiFi.localIP());
Serial.print("Subnet: "); Serial.println(WiFi.subnetMask());
Serial.print("Gateway: "); Serial.println(WiFi.gatewayIP());
Serial.print("SSID: "); Serial.println(WiFi.SSID());
Serial.print("Signal: "); Serial.println(WiFi.RSSI());
Serial.print("Networks: "); Serial.println(WiFi.scanNetworks());
pinMode(ledPin, OUTPUT);
}
void loop () {
WiFiClient client = server.available();
if (client) {
if (client.connected()) {
digitalWrite(ledPin, LOW); // to show the communication only (inverted logic)
Serial.println(".");
client.flush();
Serial.println("Data send");
x= analogRead(xAxis);
data[0]= analogRead(xAxis);
client.println(data[x,yAxis]);
Serial.println(x);
Serial.println(data[0]); //This appears on the screen only if i have the line data[0]= analogRead(xAxis);
digitalWrite(ledPin, HIGH);
}
client.stop(); // tarminates the connection with the client
}delay(2000);
}
Receiver Code
#include <SPI.h>
#include <ESP8266WiFi.h>
int ENA = D1;
int ENB = D2;
int MotorA1 = D3;
int MotorA2 = D4;
int MotorB1 = D5;
int MotorB2 = D6;
int data[1];
int xAxis;
int yAxis;
int ledPin = D8;
char ssid[] = "*****";
char pass[] = "*****";
unsigned long askTimer = 0;
IPAddress server(192,168,1,80); // the fix IP address of the server
WiFiClient client;
void setup() {
Serial.begin(115200); // only for debug
WiFi.begin(ssid, pass); // connects to the WiFi router
while (WiFi.status() != WL_CONNECTED) {
Serial.print(".");
delay(500);
}
/* Serial.println("Connected to wifi");
Serial.print("Status: "); Serial.println(WiFi.status()); // Network parameters
Serial.print("IP: "); Serial.println(WiFi.localIP());
Serial.print("Subnet: "); Serial.println(WiFi.subnetMask());
Serial.print("Gateway: "); Serial.println(WiFi.gatewayIP());
Serial.print("SSID: "); Serial.println(WiFi.SSID());
Serial.print("Signal: "); Serial.println(WiFi.RSSI());*/
pinMode(ledPin, OUTPUT);
pinMode(ENA, OUTPUT);
pinMode(ENB, OUTPUT);
pinMode(MotorA1, OUTPUT);
pinMode(MotorA2, OUTPUT);
pinMode(MotorB1, OUTPUT);
pinMode(MotorB2, OUTPUT);
digitalWrite(MotorA1, LOW);
digitalWrite(MotorA2, LOW);
digitalWrite(MotorB1, LOW);
digitalWrite(MotorB2, LOW);
analogWrite(ENA, 0);
analogWrite(ENB, 0);
}
void loop () {
client.connect(server, 80); // Connection to the server
digitalWrite(ledPin, LOW); // to show the communication only (inverted logic)
Serial.println(".");
data[xAxis,yAxis] = client.read(); // receives the answer from the sever
Serial.println(" Received from Server ");
client.flush();
digitalWrite(ledPin, HIGH);
Serial.println(xAxis);
if(yAxis > 400) {
digitalWrite(MotorA1, LOW);
digitalWrite(MotorA2, HIGH);
digitalWrite(MotorB1, HIGH);
digitalWrite(MotorB2, LOW);
analogWrite(ENA, 150);
analogWrite(ENB, 150);
}else if(yAxis < 320) {
digitalWrite(MotorA1, HIGH);
digitalWrite(MotorA2, LOW);
digitalWrite(MotorB1, LOW);
digitalWrite(MotorB2, HIGH);
analogWrite(ENA, 150);
analogWrite(ENB, 150);
} else if(xAxis < 320){
digitalWrite(MotorA1, HIGH);
digitalWrite(MotorA2, LOW);
digitalWrite(MotorB1, HIGH);
digitalWrite(MotorB2, LOW);
analogWrite(ENA, 150);
analogWrite(ENB, 150);
}else if(xAxis > 400){
digitalWrite(MotorA1, LOW);
digitalWrite(MotorA2, HIGH);
digitalWrite(MotorB1, LOW);
digitalWrite(MotorB2, HIGH);
analogWrite(ENA, 150);
analogWrite(ENB, 150);
}else {
digitalWrite(MotorA1, LOW);
digitalWrite(MotorA2, LOW);
digitalWrite(MotorB1, LOW);
digitalWrite(MotorB2, LOW);
analogWrite(ENA, 0);
analogWrite(ENB, 0);
}
delay(2000); // client will trigger the communication after two seconds
}

Arduino UNO and ESP8266 how to send http respond

i connect esp8266 to Arduino-Uno (WiFi Controlled LED using ESP8266 and Arduino) it's working well.
but, when in browser i call (http://192.168.1.***/?led=ON) i want esp8266 respond and display message like that is (Ok/No) on that page, can we do that with AT Commands? or any other way ...
void loop() {
if (esp8266.available()) {
if (esp8266.find("+IPD,")) {
String msg;
esp8266.find("?");
msg = esp8266.readStringUntil(' ');
String command1 = msg.substring(0, 3);
String command2 = msg.substring(4);
if (DEBUG) {
Serial.println(command1); // Must print "led"
Serial.println(command2); // Must print "ON" or "OFF"
}
delay(100);
if (command2 == "ON") {
digitalWrite(led_pin, HIGH);
// here i want send led is on now
} else {
digitalWrite(led_pin, LOW);
// here i want send led is off now
}
}
}
}
I would recommend using ESP8266WebServer library for this project. You can create an HTML page with two separate input buttons with arguments On and Off, You can then change the status of your URL from on to off and vice-versa. On the ESP side, You can get the status of arguments like this
if(server.hasArg("ON")==true){
digitalWrite(led_pin, HIGH);
}else if(server.hasArg("OFF")==true){
digitalWrite(led_pin, HIGH);
}
I have done a similar kind of project
https://ncd.io/thingspeak-weather-app-using-esp8266/
and https://github.com/vbshightime/ESPMeshServer
this methode:
#include <WiFi.h>
#include <WiFiClient.h>
#include <WebServer.h>
const int LED_PIN = 16;
IPAddress ip(192, 168, 0, 32);
IPAddress gateway(192, 168, 0, 1);
IPAddress subnet(255, 255, 255, 0);
WebServer server(9999);
void handleLED();
void setup(void){
WiFi.config(ip, gateway, subnet);
WiFi.begin("ssid","pw");
while (WiFi.status() != WL_CONNECTED) {
delay(500);
}
server.on("/ON", HTTP_GET, handleLED_ON);
server.on("/OFF", HTTP_GET, handleLED_OFF);
server.begin();
Serial.begin(115200);
Serial.println("Start");
}
void loop(void){
server.handleClient();
}
void handleLED_ON() {
digitalWrite(LED_PIN, HIGH);
server.send(200,"text/plan","OK");
}
void handleLED_OFF() {
digitalWrite(LED_PIN, LOW);
server.send(200,"text/plan","OK");
}

Arduino PINs not behaving equally

I have burned this code on my arduino:
#include <SPI.h>
#include <Ethernet.h>
#include <stdlib.h>
using namespace std;
#define BUFFSIZE 16
#define PIN0 0
#define PIN1 1
#define PIN2 2
#define PIN3 3
#define PIN4 4
#define PIN5 5
#define PIN6 6
#define PIN7 7
#define PIN8 8
#define PIN9 9
#define PIN10 10
#define PIN11 11
#define PIN12 12
#define PIN13 13
// For mac address please view the Ethernet shield.
byte mac[] = {0x90, 0xA2, 0xDA, 0x0D, 0x85, 0xD5};
IPAddress server(192, 168, 0, 61); // IP address of RAAS server
// Set the static IP address to use if the DHCP fails to assign
IPAddress ip(192, 168, 0, 62);
// Initialize the Ethernet client library
// with the IP address and port of the server
// that you want to connect to (port 8 is selected for RAAS):
EthernetClient client;
String GetNextCommand()
{
int count,i;
int temp;
String command;
Serial.println("Waiting for next Command.");
while((count = client.available()) < 1 );
for(i = 0; i < count ; i++)
command += (char) client.read();
command.replace("\r","");
command.replace("\n","");
Serial.println(command);
return command;
}
bool ConnectServer() {
int resCount,i;
String response;
Serial.println("Trying to connect...");
// if you get a connection, report back via serial:
if (client.connect(server, 8)) {
Serial.println("connected");
// Make a Handshake request:
client.println("EHLO");
response = GetNextCommand();
if (response == "EHLO" ) {
Serial.println("Server Response OKAY");
return true;
}
} else {
// kf you didn't get a connection to the server:
Serial.println("connection failed");
}
return false;
}
void InitializeBoard() {
pinMode(PIN1, OUTPUT);
pinMode(PIN2, OUTPUT);
pinMode(PIN3, OUTPUT);
pinMode(PIN4, OUTPUT);
pinMode(PIN5, OUTPUT);
pinMode(PIN6, OUTPUT);
pinMode(PIN7, OUTPUT);
pinMode(PIN8, OUTPUT);
pinMode(PIN9, OUTPUT);
pinMode(PIN10, OUTPUT);
pinMode(PIN11, OUTPUT);
pinMode(PIN12, OUTPUT);
pinMode(PIN13, OUTPUT);
digitalWrite(PIN1, LOW);
digitalWrite(PIN2, LOW);
digitalWrite(PIN3, LOW);
digitalWrite(PIN4, LOW);
digitalWrite(PIN5, LOW);
digitalWrite(PIN6, LOW);
digitalWrite(PIN7, LOW);
digitalWrite(PIN8, LOW);
digitalWrite(PIN9, LOW);
digitalWrite(PIN10, LOW);
digitalWrite(PIN11, LOW);
digitalWrite(PIN12, LOW);
digitalWrite(PIN13, LOW);
}
void ParseCommand(String str) {
int pinNum;
int pinState = LOW;
String switchNo,operation;
int temp;
temp=0;
temp = str.indexOf(':',temp);
switchNo = str.substring(0,temp);
operation = str.substring(temp+1);//,str.length()-temp-2);
Serial.println("Port: " + switchNo);
Serial.println("Operation: " + operation);
if(operation == "OFF;")
pinState = LOW;
else if(operation == "ON;")
pinState = HIGH;
else Serial.println("Invalid Command from server!");
pinNum = str.toInt();
Serial.print("Setting ");
Serial.print( pinNum);
Serial.print( " to ");
Serial.println( pinState);
switch (pinNum){
case PIN1:
digitalWrite(PIN1, pinState);
break;
case PIN2:
digitalWrite(PIN2, pinState);
break;
case PIN3:
digitalWrite(PIN3, pinState);
break;
case PIN4:
digitalWrite(PIN4, pinState);
break;
case PIN5:
digitalWrite(PIN5, pinState);
break;
case PIN6:
digitalWrite(PIN6, pinState);
break;
case PIN7:
digitalWrite(PIN7, pinState);
break;
case PIN8:
digitalWrite(PIN8, pinState);
break;
case PIN9:
digitalWrite(PIN9, pinState);
break;
case PIN10:
digitalWrite(PIN10, pinState);
break;
case PIN11:
digitalWrite(PIN11, pinState);
break;
case PIN12:
digitalWrite(PIN12, pinState);
break;
case PIN13:
digitalWrite(PIN13, pinState);
break;
default:
Serial.println("Invalid Pin Address!");
}
}
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
// start the Ethernet connection:
if (Ethernet.begin(mac) == 0) {
Serial.println("Failed to configure Ethernet using DHCP");
// no point in carrying on, so do nothing forevermore:
// try to congifure using IP address instead of DHCP:
Ethernet.begin(mac, ip);
} else {
Serial.println("Bound on given Mac");
}
// give the Ethernet shield a second to initialize:
delay(1000);
}
void loop() {
//Keep trying to connect to the server until the server response okay!
while (!ConnectServer());
//While Server is connected, keep listening for incoming commands from server.
while (client.connected()) {
String command;
command = GetNextCommand();
ParseCommand(command);
}
// if the server's disconnected, stop the client:
if (!client.connected()) {
Serial.println();
Serial.println("Server Disconnected.");
client.stop();
}
}
Now I have to connect Relays on all the pins from 1-13. But pins are not behaving properly. When I send command 13:ON; or 13:OFF; pins on my Ethernet shield does not change its state in each case. But when I send 03:ON; or 03:OFF; it changes its state exactly w.r.t the command. Similarly some pins are responding like pin 3 and other pins are not (like pin13). Is this some thing to do with the code?
The issue is the Ethernet shield uses pins 13, 12, 11, as SPI . Also 10 and 4, to select SD or ethernet.
pinNum = str.toInt();
And then you have a switch statement to mach pinNum with the correct operation.
I would like to see how the value of str looks before "ParseCommand()" function. Can you show me what prints in the "GetNextCommand()"

Resources