In this mode
But i Have a problem!!
I created a hardware project.
Basically I want to create an event in the box using wire potentiometers 10 laps.
For now, the 10-bit ADC of my hardware (Arduino) allows me only a variation of 1024 values, but seems to work.
Applying the change in the x-axis of the layer to move right and left position of the wall.
When I have a value in increasing the value of x grows very fluid while the value of x decreases when x goes in spurts.
Someone who can help me with this.
Below is the code that I made for the control:
- Code: Select all
/*
* Ethernet shield attached to pins 10, 11, 12, 13
created 06 Gen 2011
by Alberto Cauzzi
*/
#include <SPI.h>
#include <Ethernet.h>
// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0x08, 0xE6 };
byte ip[] = { 192,168,1,182 };
byte server[] = { 192,168,1,181 }; // Pandora's box
// Initialize the Ethernet client library
// with the IP address and port of the server
Client client(server, 8084);
void setup() {
// start the Ethernet connection:
Ethernet.begin(mac, ip);
// start the serial library:
Serial.begin(9600);
// give the Ethernet shield a second to initialize:
delay(1000);
Serial.println("connecting...");
// if you get a connection, report back via serial:
if (client.connect()) {
Serial.println("connected");
// Make a HTTP request:
client.println("GET /search?q=arduino HTTP/1.0");
client.println();
}
else {
// if you didn't get a connection to the server:
Serial.println("connection failed");
}
}
void loop()
{
int valoreA= analogRead(1);
delay(125);
client.print(valoreA);
Serial.println(valoreA);
// if the server's disconnected, stop the client:
if (!client.connected()) {
Serial.println();
Serial.println("disconnecting.");
client.stop();
}
}
ADC comes a constant value but a value fluctuating WD law down and that's why I added knots and trigger Dybanic flloor.
With these nodes improves a little but is not the solution
I hope someone can help me.
Alberto