w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
How to automatically attach images to a post after uploading?
Yes, you can use the CKEditor API to insert that image. Check this demo it automatically inserts any image that you add through various methods (drag&drop, paste, toolbar button). But that doesn't solve your problem at all. The user can still close the page and the image will be stored but will not be used, so you should create some system to track that.

Categories : PHP

AWS S3 uploading directly and automatically making file public
Bucket policies do not apply to objects "owned" by others, even though they are within your bucket, so the only way to do this is to make public during the upload using a request header. request.AddHeader("x-amz-acl", "public-read");

Categories : Javascript

Support WinUSB in Device Firmware
That isn't what it is saying at all. You have to respond to USB requests, not place structures in specific locations of the embedded system's memory. Windows will, upon seeing a VID:PID:Serial for the first time, request the OS String Descriptor at index 0xee. The device must respond with a data packet matching the structure format you showed. If everything in the returned descriptor is right (your example looks good), Windows will then issue a device vendor request with bReq set to what you provided in the string descriptor response as MS_VendorCode (0x04 in your example). If your device responds with the correct OS Feature Descriptor, then magic happens. The magic that people usually want is for their device to use the winusb driver without providing an .inf file. Note that this re

Categories : C

Cisco 881G firmware update
It means the onboard encryption engine is damaged/malfunctioning/disabled and doesn't return the power up test results as it should. It could be the router was built for sale in an area that doesn't allow payload encryption and it was physically disabled by Cisco during manufacturing or the chip is just broke and the reseller loaded it without encryption to get it to pass POST on boot up. See the Cisco documentation here: http://www.cisco.com/en/US/prod/collateral/iosswrel/ps8802/ps5460/product_bulletin_c25-566278_ps10537_Products_Bulletin.html Universal images with the universalk9_npe" designation in the image name: The strong enforcement of encryption capabilities provided by Cisco Software Activation satisfies requirements for the export of encryption capabilities. However, some co

Categories : Misc

Image uploading using codeigniter file uploading class
try this one say your input file like <input type="file" name="image" id="image"> now change the following line !$this->upload->do_upload() with !$this->upload->do_upload('image') please let me know if you face any problem. UPDATE if you want to sent it to the template then do like this if (!$this->upload->do_upload()) { $error = array('error' => $this->upload->display_errors()); $this->session->set_flashdata('msg',$error['error']); redirect('controller_name/function_name','refresh'); } try this and let me know.

Categories : Image

Arduino and JavaScript
It appears in you data event you are concatenating the new data but then you are checking the entire string (readData). So each time you check (setting cleanData) you are starting from the beginning and hitting the first result over and over. Try chaning readData += data.toString(); to readData = data.toString(); This way you indexOf and substring matching will be looking at the new incoming data.

Categories : Javascript

From arduino to netmf
uint angle = 3000;//angle is int 500 to 5500 uint temp; byte pos_hi,pos_low; temp = angle & 0x1f80; //get bits 8 thru 13 of position pos_hi = (byte) (temp >> 7); //shift bits 8 thru 13 by 7 pos_low = (byte) (angle & 0x7f); //get lower 7 bits of position

Categories : C#

Different I2C addresses on Arduino?
There are different formats of I2C addresses - 7 or 8 bits. Arduino uses the 7-bit format, so to convert an 8-bit address to 7-bits, you just shift it right by one. That's how the 0x02 8-bit address is converted to the 0x01 7-bit address. Source: http://arduino.cc/en/reference/wire "Note: There are both 7- and 8-bit versions of I2C addresses. 7 bits identify the device, and the eighth bit determines if it's being written to or read from. The Wire library uses 7 bit addresses throughout. If you have a datasheet or sample code that uses 8 bit address, you'll want to drop the low bit (i.e. shift the value one bit to the right), yielding an address between 0 and 127."

Categories : C++

arduino class with map
The Arduino by default does not support the STL so you cannot use STL data structures. As tzerb points out. There is an implementation of the STL for the AVR (Installation directions). I have not used it so I can't tell you if it is any good.

Categories : Visual Studio 2010

Arduino with GTK/CAIRO
I don't really understand. The two programs will be on differnt machines right? So your GUI program will run on a desktop, and send serial data to Arduino. The arduino must understand the serail commands and send back data. There are serval ways to use serail port in c++, none of them are easy. The ardiuno code and the GTK code cannot be compiled together (they run on differnt machines).

Categories : C++

Blink an LED on my Arduino ADK
If you replace imports com.android.future.usb.UsbAccessory; com.android.future.usb.UsbManager; to android.hardware.usb.*; Your code will start working. (you may need to fix some more things)

Categories : Android

How run avr-gcc Arduino on Android
You can cross-compile the avr toolchain for android with the arm toolchain (codesourcery?) I've never tried that, but I really want to. Also, there is a way to program arduino via bt (with hc-05 module, google it), so if you cross-compile avrdude for android, you can fully program an arduino from your android. I'll definetly do that... :)

Categories : Android

Arduino udp ping
I don't know your network stack, but ES_packetloop_icmp_tcp does not sound like it will work on UDP traffic. I'd assume it processes ICMP and/or TCP packets. ICMP is the type of packets used by the common ping command and ICMP is not the same as UDP. Edit: Maybe this helps to get you started.

Categories : C#

Using a web server to control an arduino
Either connect via RS232 to arduino. I don't know wheter this is possible at all from node.js. The other option is to put a ethernet shield on your arduino, implement a simple web service and call this from node.js. With the second option it's just calling an URL to connect to the arduino.

Categories : Node Js

Visual C++ Serial Out to Arduino
WriteFile is definitely going to write only one byte per call, and you can confirm that by looking at byteswritten after the call. I wonder if you are writing what you intend to write, since CString is a strange choice of types to use when you seem to intend to write an int. Are you trying to send binary 6 (which you are) or the character '6' ?

Categories : Visual C++

Arduino Algorithm For "multitasking"
The basic psuedo-code outline is something like: int PWM; int minute_ctr; loop() { if (minute_ctr > 1000) { minute_ctr = 0; check HTML page for 1/0 } if (page == 1) PWM++; set PWM for LED (analogWrite) change direction when PWM = 0 or 255 else set LED off end if delay(10) minute_ctr += 10; } You will need to fill-in all of the details.

Categories : C

Arduino wireless and Node.js
While the monitor is running no other program can read the serial port. In case you do not open both at the same time then things are more tricky. My suggestion would be to spy on the wire. That is: install Wireshark and have a look at the data on the serial connection / USB bus. You might also want to check how the serial port of the APC220 and the Arduino differ with regard to their serial/USB converters. Another idea would be to analyze this issue under Linux since may allow more insights into the low-level differences of the chip sets / USB activity. Of course if you do not have Linux experience this is hard to do, but maybe you know some Linux enthusiasts.

Categories : Node Js

Two Dimensional Array in arduino
You should not use dynamically sized arrays on AVR's / Arduinos. Initialize the array outside the for() with a fixed size (e.g. the maximum y and SCREEN_WIDTH you are expecting). e.g.: uint16_t buf[128][128]; And take care not to exceed the available RAM (it's just something like 2kByte).

Categories : Arrays

Arduino RF sensor network
Those will be by far the cheapest method. As for the best method, there are a variety of choices much better, but more expensive. A network of Xbee modules comes to mind, but those are much more expensive than $1.25 a pair. Using the RF modules is very do-able however. To prevent communication overlapping, put a RF transmitter and receiver on each sensor node and the main hub. The main hub can send "hey sensor1 give me your data", which gets broadcasted to all of the sensors. However, only sensor1 will realize "hey I am sensor 1, here is my data" which the hub will listen for. Then, the hub will go on and say "hey sensor2 send me your data" and so on and so forth.

Categories : Networking

Arduino & twitter can I connect?
I had a project earlier in the year where we used the Twitter API from a PC to get the data. Then we manipulated the data and pumped the resultant data to the arduino via the serial port. In this scenario the arduino is basically a display driver and the program on the PC does the heavy lifting.

Categories : Twitter

Unexpected output on Arduino
The problem was that your code looking for '>' always looked at character 0 and you were appending to your string, so after getting a first non '>' character you could never get to a condition in which you would print. String txtMsg = ""; // a string for incoming text void setup() { Serial.begin(9600); while (!Serial); // wait for serial port to connect. Needed for Leonardo only } void loop() { // add any incoming characters to the String: int got_start = 0; while (Serial.available() > 0) { char inChar = Serial.read(); if (inChar == '>' && !got_start) { got_start = 1; } if (got_start) { txtMsg += inChar; } if (inChar == '<' && got_start) { got_start = 0;

Categories : C

How to address Firebase from an Arduino?
If you figure out a way, let us (support@firebase.com) know. That would be an awesome hack! Some thoughts: You might want to look into the Spark Core (available for pre-order). They mention SSL support, though it's unclear to me what that means exactly. You could proxy the requests through a server that can speak SSL. For instance, you could run a tiny node.js service on an Amazon EC2 box that just proxies REST requests to Firebase (e.g. using http-proxy). If you're hardcore, you could try to get the Arduino talking to an external ethernet controller that has built-in SSL support (e.g. this one), but that's probably a big project. :-) Longer-term, we might expose a non-SSL endpoint for Firebase requests that's specifically for this sort of low-end hardware use-case. Ping us at sup

Categories : Ssl

Arduino fading details
If fade is a byte: fade goes to 256 -> 00! so the second loop would be "very short" :-) I suggest in the first loop use only: while(fade < 255) then it stops at 255 e.g. 0xff and the second while should run correctly.

Categories : C++

philips hue arduino control
I'm not sure if that library will actually work. For example in this file: https://github.com/bsalinas/ArduinoHue/blob/master/SerialHue/SerialHue.cpp#L20 there is a hardcoded username (the 22a82 thing). You might be better off asking the owner of that library directly on his github page how to use it or use another library. Here is a list of them: https://github.com/q42/hue-libs

Categories : C++

arduino c++ issues regarding class name
check the compiler settings...it might be possible that it tries to compile c++ code with a c compiler about the format: class X : public Y { } is the syntax of extending a class in C++ plus: check that ArduinoHue.h really defines ArduinoHue class ...if you can't figure it out: take a look at the precompiled sourcefile (g++ -E)

Categories : C++

Arduino Local DNS Problems
Many routers will provide their LAN side IP address as the DNS address -- that is typical behavior for DHCP setups. That does not necessarily mean they are actually the server. Some simply forward the DNS requests to the WAN side servers and return the response. This type of configuration where the router is only a proxy explains your symptoms. When the router is a proxy, the Arduino DNS requests are just being forwarded to the external DNS server which does not know your local names. The Linux machine is using other network protocols to discover local names. The same thing happens with Windows machines where local computer names are known. If you run a network monitor like Wireshark, you will see computers regularly announcing their presence to other computers. The Arduino only ha

Categories : Networking

C++ Arduino, running two loops at once?
Something like: int timekeeper=0; while (1) { do_fade(timekeeper); if (timekeeper%100==0) { do_blink_off(); } if (timekeeper%100==50) { do_blink_on(); } delay(10); timekeeper++; } This is done from memory, so your mileage may vary. I've passed timekeeper to do_fade(), so you can figure out how far along the fade you are. do_fade() would update the fade, then immediately return. do_blink_on() and do_blink_off() would be similar - change what you need to change, then return. In this example, do_fade() would be called every 10 milliseconds, do_blink_off() once per second, with do_blink_on() 1/2 a second after (so on, 1/2 second, off, 1/2 second, on, 1/2 second...)

Categories : C++

Arduino Ports Bitschift
Say you want to turn on the n'th bit of PORTD. PORTD |= (1<<n); Where the bits are numbered 0, 1, 2, etc from right to left. To turn off the 4th bit you would do PORTD &= ~(1<<4);

Categories : C++

Arduino char *name from string
As it so happens while reviewing my code after a long time I discovered the problem to be in my parsing function applied to the data received from the serial. There was garbage coming in from the serial comms that I wasn't filtering and thus blowing stuff up.

Categories : C

Arduino I2C DS1621 commands
Tout is "Thermostat output. Active when temperature exceeds TH; will reset when temperature falls below TL." So you must set TL and TH. The control byte must be sent for the value is send [A1h] [value for TH] [A2h] [value for TL] Luckily for us 25 degrees is a value they gave as 0x19 or 00011001 so my code would look like this Wire.begin(); Wire.beginTransmission(DEV_ID); //I am talking to you Wire.send(0xA1); //I want to change TH Wire.send(0x19); //Value of 25 Wire.endTransmission(); Wire.beginTransmission(DEV_ID); //I am talking to you wire.send(0xA2); //I want to change TL Wire.send(0x19); //value of 25 Wire.endTransmission(); Yo

Categories : C++

What is a char* declaration in arduino?
The * (Asterisk) indicates the variable is a pointer. As for a small example: int x = 0; int *y = &x; //y is pointing to x const char* myText = "Text"; You might however be interested in learning a bit more about what pointers are.

Categories : Misc

Android Bluetooth Arduino
I can try concatenate your data in a "buffer" and check this buffer for the new line/carriage return character. Once it is found, you asign the data to your real variable, clear the buffer and starts all over again. That should do the trick. Hope it helps! :)

Categories : Android

Arduino Look-alikes and Ubuntu
Yes, they will work exactly the same. The source code for the bootloader chip and the main mega328 is available, so the people who copy the designs just flash those on directly. Just make sure the board you are getting is the correct version you want. Some clones may use the older FT232 chip to convert USB<->UART, where the newer boards have another atmega chip that can both act as a USB<->UART, and as a USB slave itself.

Categories : Ubuntu

Cherrypy and JSON Arduino web interface
First of all, I did'nt think about telling you about that in your previous question, but a while back I wrote a software called pyaler that does exactly what you want (except it did not support long polling requests, as it is (was?) a wsgi limitation). To answer your question, why don't you make your form a javascript query that sends the action, and gets the result as JSON that you can parse and update your current page with the result? That's way more elegant, simple and 2013... Sadly I can't really tell, given your code, why you're not getting the result. It's too much over-sophisticated to understand if it really does what you want it to do... KISS! Avoid doing anything at the module scope, except if you put it in if __name__ == "__main__", or the day you'll want to extend your modu

Categories : Python

Low latency Android & Arduino bluetooth
The OutputStream.write(); lines returned immediately, but the amount of delay increased over time. Clearly data was getting backed up somewhere in the bluetooth stack, which was why I put in the Thread.sleep(10), to try and slow things down. That caused other problems around blocking though, and I replaced it with a couple of lines that check when the last write() was before sending any new data. If it was less than a configured time (call it timeDelay), then it skips the new write(). Manually tuning the value of timeDelay then enabled me to avoid flooding the bluetooth stack. For in

Categories : Android

Using String function is not outputting Using Arduino
Your setup routine needs to open or define the serial line. The following code was copied from the Arduino web site and then modified: void setup() { // open the serial port: Serial.begin(9600); // initialize control over the keyboard: // Keyboard.begin(); // or use Serial.println("Hello World, Goodnight moon!"); // can do "one" time work here } What you code next begins on what you want to do! That is, approach this problem in increments. First get something simple like just a setup() routine to work. Then add code to a loop() routine, etc. In this method, if you have a problem you can always fall back to a previous version of the code that worked.

Categories : C

I can't send UDP packet from Android to Arduino
have you set the following Permissions in your Manifest file? uses-permission android:name="android.permission.INTERNET" uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE"

Categories : Android

Using class inheritance and malloc (on an arduino)
I agree the C++ version with new works fine. That is because new allocates the memory for the instance of the class and then calls the constructor(s). malloc does not do that it just allocates memory and so the class is never properly formed which is why the malloc version crashes. Always use new and delete for classes.

Categories : C++

Communicating with Arduino over ethernet using Node.js
Here is a sketch that works for me. #include <SPI.h> #include <Ethernet.h> #include <EthernetUdp.h> byte arduinoMac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; IPAddress arduinoIP(10, 0, 0, 19); // desired IP for Arduino unsigned int arduinoPort = 8888; // port of Arduino IPAddress receiverIP(10, 0, 0, 13); // IP of udp packets receiver unsigned int receiverPort = 6000; // port to listen on my PC EthernetUDP Udp; void setup() { Ethernet.begin(arduinoMac,arduinoIP); Udp.begin(arduinoPort); } void loop() { Udp.beginPacket(receiverIP, receiverPort); //start udp packet Udp.print(String(analogRead(A0), DEC)); //write sensor data to udp packet Udp.write(","); Udp.print(String(analogRead(A1), DEC)); //write sensor data to udp packet Udp.endPacket(); //

Categories : Node Js

Reading and writing to arduino at the same time
The key to do several things "at the same time" is to understand that the Arduino has only one core. Thus it will process stuff only one step after the other. Now suppose you want to perform three functions "action1()", "action2()" and "action3()" at "the same time. In order to achieve this you must ensure that all actions can be performed as fast as possible, preferably sub milliseconds none of them "blocks" Then the desired effect is achieved by just putting them into succession like so void loop() { action1(); action2(); action3(); } This is the basic idea of "cooperative multitasking". It follows that none of the actions must utilize delay() or blocking waits. For example while(Serial.available() == 0); is a blocking wait and must be avoided. Things get more com

Categories : C#



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.