我用學長同樣的電腦 同樣的ip 同樣的wifi(密碼) 那網頁設置的地方一樣,還是有錯。
第一、winserver was not declared in this scope 在跑時,我是不是Arduino內的libraries資料夾忘了安裝/放 什麼?
第二、它們怎知道按按鈕的網頁怎連結到那wifi版,我以為程式碼內會寫C:\0913\...html.之類的,結果沒有。
第三、我們老師希望我們能捨棄用網頁按按鈕的方式控制車子,
丟給我們kinect機器利用人的姿勢體感操控車,是不是只要把程式碼網頁部分(紅色)的做修改跟kinect連結就好?
至於馬達部份大概我們已經瞭解了,只是怎跟網頁互動不太懂,要懂才會改啊...。
/*
* A simple sketch that uses Web Server with Motoduino WiFi Shield.
*/
// Note: Please only define APP_WISERVER in apps-conf.h
//
#include <WiServer.h>
const int Motor_E1 = 5; // Pin 5 of Motoduino
const int Motor_E2 = 6; // Pin 6 of Motoduino
const int Motor_M1 = 7; // Pin 7 of Motoduino
const int Motor_M2 = 8; // Pin 8 of Motoduino
//1. SPI
//Slave select (SS) : Arduino pin 10 (port B, pin 2)
//Clock (SCK) : Arduino pin 13 (port B, pin 5)
//Master in, slave out (MISO) : Arduino pin 12 (port B, pin 4)
//Master out, slave in (MOSI) : Arduino pin 11 (port B, pin 3)
//2. Interrupt (Uses only one of the following, depending on jumper setting)
//INT0 : Arduino pin 2 (port D, pin 2)
//DIG8 : Arduino pin 8 (port B, pin 0)
//3. Interrupt selection jumper
//Do NOT leave it unconnected, you need select one.
//4. LED Indicator: Arduino pin 9 (port B, pin 1)
// Wireless configuration parameters ----------------------------------------
unsigned char local_ip[] = {192,168,11,8}; // IP address of WiShield
unsigned char gateway_ip[] = {192,168,11,1}; // router or gateway IP address
unsigned char subnet_mask[] = {255,255,255,0}; // subnet mask for the local network
char ssid[] = {"S409"}; // max 32 bytes
unsigned char security_type = 1; // 0 - open; 1 - WEP; 2 - WPA; 3 - WPA2
// WPA/WPA2 passphrase
const prog_char security_passphrase[] PROGMEM = {"abcde"}; // max 64 characters
byte sampledata=50;
char link[]="http://motoduino.com/"; //link data
// WEP 128-bit keys
prog_uchar wep_keys[] PROGMEM = {
0x61, 0x62, 0x63, 0x64, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Key 0
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Key 1
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Key 2
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // Key 3
};
// setup the wireless mode; infrastructure - connect to AP; adhoc - connect to another WiFi device
#define WIRELESS_MODE_INFRA 1
#define WIRELESS_MODE_ADHOC 2
unsigned char wireless_mode = WIRELESS_MODE_INFRA;
unsigned char ssid_len;
unsigned char security_passphrase_len;
// End of wireless configuration parameters ----------------------------------------
boolean mainpage()
{
// set all color leds as output pins
pinMode(Motor_M1, OUTPUT);
pinMode(Motor_M2, OUTPUT);
WiServer.init(controlpage);
// Enable Serial output and ask WiServer to generate log messages (optional)
WiServer.enableVerboseMode(true);
}
void loop(){
// Run WiServer
WiServer.server_task();