-
PROHARDVER!
Arduino hardverrel és szoftverrel foglakozó téma. Minden mikrovezérlő ami arduinoval programozható, és minden arduino program, board, és hardverrel kapcsolatos kérdések helye.
Új hozzászólás Aktív témák
-
Szita1
tag
Sziasztok, egy kicsit elakadtam, egy kódsorban, azt szeretném, hogy a linkről érkező számsort küldené el :
myswitch.send(filename, 32);
a monitorra kiírja, de a myswitchbe beillesztve nem jó.
hibát ír ki: invalid conversion from 'char*' to 'long unsigned int'
Mi lehet a probléma? Tudtok segíteni? itt a teljes kód.
#include <SPI.h>
#include <SdFatUtil.h>
#include <Ethernet.h>
#include <RCSwitch.h>
#include <RemoteTransmitter.h>
#include <stdio.h>
#include <stdint.h>
#include <Wire.h>
byte mac[] = {
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xEE };
byte ip[] = {
192, 168, 1, 200 };
EthernetServer server(80);
#define BUFSIZ 70
String querystring;
RCSwitch RCSend = RCSwitch();
boolean Redirect = false;
char BUFFER[BUFSIZ];
char clientline[BUFSIZ];
unsigned long code;
char *filename;
RCSwitch mySwitch = RCSwitch();
RemoteTransmitter tele = RemoteTransmitter(10,125,8);
void setup() {
Serial.begin(9600);
PgmPrintln("-start begin-");
mySwitch.enableTransmit(10);
mySwitch.setProtocol(2);
pinMode(10, OUTPUT);
digitalWrite(10, HIGH);
Ethernet.begin(mac, ip);
server.begin();
RCSend.enableReceive(0);
PgmPrintln("-start finish-");
PgmPrint("Free RAM: ");
Serial.println(FreeRam());
}
void loop()
{
int index = 0;
EthernetClient client = server.available();
if (RCSend.available()) {
Serial.println(RCSend.getReceivedValue());
if (RCSend.getReceivedValue() == 0){
RCSend.resetAvailable();
}
else{
RCSend.resetAvailable();
}
}
if (client) {
PgmPrint("Free RAM: ");
Serial.println(FreeRam());
boolean current_line_is_blank = true;
index = 0;
while (client.connected()) {
if (client.available()) {
char c = client.read();
if (c != '\n' && c != '\r') {
clientline[index] = c;
index++;
if (index >= BUFSIZ)
index = BUFSIZ -1;
continue;
}
clientline[index] = 0;
if (strstr(clientline, "GET /") != 0) {
if (!filename) filename = clientline + 5;
(strstr(clientline, " HTTP"))[0] = 0;
if (strstr(filename, "restart") != 0){
client.println("Restart");
}
Serial.println(filename);
mySwitch.send(filename,32);
delay(1000);
//tele.sendTelegram(code,10);
client.stop();
break;
}
}
break;
}
}
delay(100);
client.stop();
if (strstr(filename, "restart") != 0 || strstr(filename, "chgIP") != 0){
asm volatile (" jmp 0");
}
}
Új hozzászólás Aktív témák
- Eladó számítógép
- Új! Számla + 1-3ÉV Gari! Áfás! Gamer PC - Számítógép! I5 14400F / RTX 5060 / 32GB DDR5 / 1TB M.2 SSD
- Dobozos gamer MSI Prestige 14 /i7-1185G7/16GB/512 SSD/GTX 1650 4GB GB/FHD/IPS/Gari/
- HP Spectre x360 Érintős Hajtogatós Laptop Tab 16" -60% i7-1360P 32/2TB Intel Arc A370M 4GB UHD OLED
- Szép! Lenovo Thinkpad T14s G2 Üzleti "Golyóálló" Laptop 14" -60% i5-1135G7 4Mag 16GB /512GB FHD IPS
Állásajánlatok
Cég: Promenade Publishing House Kft.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest