Recent Posts

Pages: [1] 2 3 ... 10
1
Deutsch / Re: Mit Arduino PC Kaltstart
Last post by Tommy56 - Today at 10:46 pm
Vermute ich auch aber ich weiß es nicht.

Gruß Tommy
2
Microcontrollers / Re: Can Arduino read a PWM sig...
Last post by DrAzzy - Today at 10:46 pm
What is the frequency of the PWM you're reading?

Why not do this in hardware? There are many simple ways to invert a PWM signal...
3
Deutsch / Re: Mit Arduino PC Kaltstart
Last post by HotSystems - Today at 10:45 pm
Er sollte erst mal die Ströme messen, um den OK zu dimensionieren.

Gruß Tommy
Ja, ok...da wird aber nicht viel fließen.

4
Hi LamySae,

That was very generous of you to research and provide all those links. Thank you.

I tried to copy and modify the MudbusWiFi example, as I have used Mudbus with the Ethernet shield in the past and like it.

I substituted the #include <WiFi.h> with #include <WiFi101.h> and a few other related changes, but got lots of compile errors.
eg.

In file included from /Users/anthonywatts/Documents/Arduino/libraries/WiFi101/src/WiFi101.h:35:0,
                from /Users/anthonywatts/Dropbox/arduino/Modbus/test2/test2.ino:4:
/Users/anthonywatts/Documents/Arduino/libraries/WiFi101/src/WiFiClient.h:31:7: error: redefinition of 'class WiFiClient'
class WiFiClient : public Client {
      ^
In file included from /Users/anthonywatts/Documents/Arduino/libraries/WiFi/src/WiFi.h:31:0,
                from /Users/anthonywatts/Documents/Arduino/libraries/MudbusWiFi/MudbusWiFi.h:25,
                from /Users/anthonywatts/Dropbox/arduino/Modbus/test2/test2.ino:2:
/Users/anthonywatts/Documents/Arduino/libraries/WiFi/src/WiFiClient.h:27:7: error: previous definition of 'class WiFiClient'
class WiFiClient : public Client {
      ^



Here is a copy of the code I tried to compile
#include <SPI.h>
#include <MudbusWiFi.h>
#include <avr/pgmspace.h>
#include <WiFi101.h>
#include <WiFiUdp.h>
int status = WL_IDLE_STATUS;

MudbusWiFi Mb;
//Lamps
int Out2 = 2;
int Out3 = 3;
int Out4 = 4;

void setup()
{
 Serial.begin(9600);

 char ssid[] = "xxxx";    // your network SSID (name)
 char pass[] = "yyyy";    // your network password (use for WPA, or use as key for WEP)
 int keyIndex = 0;            // your network key Index number (needed only for WEP)

 delay(200);
 Serial.println(". ");
 Serial.println("------------------------------------------------------------------");
 Serial.println(" WiFi Modbus control  -test2");
 Serial.println("------------------------------------------------------------------");
 Serial.println(" ");
 
 // Assign a fixed IP -------------------------------------------
 IPAddress ip(192,168,54,18);
 // Load the fixed IP address -----------------------------------
 WiFi.config(ip);
 
 // Attempt to connect to WiFi network:--------------------------
 while ( status != WL_CONNECTED)
 {
   Serial.print("Attempting to connect to SSID: ");
   Serial.println(ssid);
   // Connect to WPA/WPA2 network. Change this line if using open or WEP network:
   status = WiFi.begin(ssid, pass);

   // wait 10 seconds for connection:
   delay(10000);
 }
 Serial.println("Connected to wifi");
 printWiFiStatus();



 pinMode(Out2, OUTPUT);               // assign Pin 2 as Output
 pinMode(Out3, OUTPUT);               // assign Pin 3 as Output
 pinMode(Out4, OUTPUT);               // assign Pin 4 as Output

}

void loop()
{
   Mb.Run(); // start MbTcp subroutine
   delay(1000);
   // Digital OUT 2 (as  Modbus Coil 1)
 if   (Mb.C[0] == HIGH) {
   digitalWrite(Out2, HIGH);
 }
 else {
   digitalWrite(Out2, LOW);
 }
 // Digital OUT 3 (as  Modbus Coil 2)
 if   (Mb.C[1] == HIGH) {
   digitalWrite(Out3, HIGH);
 }
 else {
   digitalWrite(Out3, LOW);
 }
 // Digital OUT 4 (as  Modbus Coil 3)
 if   (Mb.C[2] == HIGH) {
   digitalWrite(Out4, HIGH);
 }
 else {
   digitalWrite(Out4, LOW);
 }
}
//
//void printWifiData() {
//  // print your WiFi shield's IP address:
//  IPAddress ip = WiFi.localIP();
//  Serial.print("IP Address: ");
//  Serial.println(ip);
//
//  // print your MAC address:
//  byte mac[6];
//  WiFi.macAddress(mac);
//  Serial.print("MAC address: ");
//  Serial.print(mac[5], HEX);
//  Serial.print(":");
//  Serial.print(mac[4], HEX);
//  Serial.print(":");
//  Serial.print(mac[3], HEX);
//  Serial.print(":");
//  Serial.print(mac[2], HEX);
//  Serial.print(":");
//  Serial.print(mac[1], HEX);
//  Serial.print(":");
//  Serial.println(mac[0], HEX);
//
//}
//
//void printCurrentNet() {
//  // print the SSID of the network you're attached to:
//  Serial.print("SSID: ");
//  Serial.println(WiFi.SSID());
//
//  // print the MAC address of the router you're attached to:
//  byte bssid[6];
//  WiFi.BSSID(bssid);
//  Serial.print("BSSID: ");
//  Serial.print(bssid[5], HEX);
//  Serial.print(":");
//  Serial.print(bssid[4], HEX);
//  Serial.print(":");
//  Serial.print(bssid[3], HEX);
//  Serial.print(":");
//  Serial.print(bssid[2], HEX);
//  Serial.print(":");
//  Serial.print(bssid[1], HEX);
//  Serial.print(":");
//  Serial.println(bssid[0], HEX);
//
//  // print the received signal strength:
//  long rssi = WiFi.RSSI();
//  Serial.print("signal strength (RSSI):");
//  Serial.println(rssi);
//
//  // print the encryption type:
//  byte encryption = WiFi.encryptionType();
//  Serial.print("Encryption Type:");
//  Serial.println(encryption, HEX);
//  Serial.println();
//}

//----------------------------------------------------------------------------------------------------
void printWiFiStatus()
{
 // print the SSID of the network you're attached to:
 Serial.print("SSID: ");
 Serial.println(WiFi.SSID());

 // print your WiFi shield's IP address:
 IPAddress ip = WiFi.localIP();
 Serial.print("IP Address: ");
 Serial.println(ip);

 // print the received signal strength:
 long rssi = WiFi.RSSI();
 Serial.print("signal strength (RSSI):");
 Serial.print(rssi);
 Serial.println(" dBm");
}
//----------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------

5
Deutsch / Re: Stromsparen oder Standby m...
Last post by postmaster-ino - Today at 10:44 pm
Hi

Powerbank 2600mAh (1000mah gemessen), ebay
Noch keinerlei Abschaltung aufgrund der Stromaufnahme festgestellt.
Allerdings sind mir bei zwei der PowerBanks wohl die Regler verstorben - da kommen nur noch 3,7V raus (was für den Arduino ja auch noch reichen würde ... Idee - wo ich die3,7 gerade lese ... denke, Die werde ich dafür Mal antesten)

MfG
6
Deutsch / Re: Arduino einfach so defekt?...
Last post by agmue - Today at 10:43 pm
Es bleibt natürlich die Möglichkeit, den UNO per ISP anzusprechen und mal den Bootloader und die Fuses neu zu laden. Dann den Blink-Sketch drauf. Möglicherweise hat sich ja der Bootloader verwuselt.
7
Gigs and Collaborations / Re: photoresistor
Last post by pert - Today at 10:42 pm
Code: [Select]
const byte analogInPin = A0;  // Analog input pin that the potentiometer is attached to

void setup() {
  // initialize serial communications at 9600 bps:
  Serial.begin(9600);
}

void loop() {
  Serial.print("sensor = ");
  Serial.print(analogRead(analogInPin));
  // wait 2 milliseconds before the next loop for the analog-to-digital
  // converter to settle after the last reading:
  delay(2);
}


If your photoresistor is connected to a different analog pin you just need to change the definition of analogInPin.
8
Generale / Re: Presentazioni nuovi iscrit...
Last post by Fulvio_ai - Today at 10:41 pm
Ciao a tutti,
dato che sono nuovo nel forum mi presento:
Mi chiamo Fulvio, sono di Milano e studio ingegneria dei materiali, pertanto le poche conoscenze che ho di elettronica e di programmazione le ho apprese da autodidatta. Finora i problemi che ho incontrato durante i vari "esperimenti" con Arduino sono riuscito a risolverli sfogliando vecchi topic di gente con difficoltà simili. Ma ahimè questa volta sono a secco di risposte, pertanto eccomi qui!

Buona serata a tutti!
9
Deutsch / Re: Mit Arduino PC Kaltstart
Last post by Tommy56 - Today at 10:40 pm
Er sollte erst mal die Ströme messen, um den OK zu dimensionieren.

Gruß Tommy
10
Deutsch / Re: Mit Arduino PC Kaltstart
Last post by HotSystems - Today at 10:38 pm
Einen Transistor oder besser Optokoppler solltest du dem "Schalter" schon gönnen.
Wie das mit dem Sketch funktionieren soll, weiß ich def. nicht.
Pages: [1] 2 3 ... 10