Using the new Arduino IDE for ESP8266 and found bugs, report them here

Moderator: igrr

User avatar
By juanpintom
#17986 I loaded the function on my Souliss sketch using the function before (without delays) and don't works, I tried on PIN 15 maybe it works on pins 12 -14, I'll test tonight.

Anyway if you follow this steps you can use the standard analogWrite and it works:

•Install Arduino 1.6.4 from the Arduino website.
•Start Arduino and open Perferences window.
•Enter http://arduino.esp8266.com/package_esp8 ... index.json into Additional Board Manager URLs field. You can add multiple URLs, separating them with commas.
•Open Boards Manager from Tools > Board menu and install esp8266 platform (and don't forget to select your ESP8266 board from Tools > Board menu after installation).

Regards
User avatar
By holla2040
#18014 I figured this out. I had old versions of code in hidden directories.

Code: Select allhere are my notes on getting ubuntu 14.04 32-bite arduino 1.6.4 ide to compile for esp8266 esp-12
    add http://arduino.esp8266.com/package_esp8266com_index.json board managers in preferences
    install under board manager
    might need to remove ~/Arduino, .arduino and .arduino15 for this to work

esp-12 programming
    using itead foca board or equivalent, foca I/O runs at 3.3V if switch at 3.3V
    foca        esp8266
    GND         GND
    VCCIO       VCC
    TXD         RXD
    RXD         TXD
    DTR         GPIO0   with pull up to VCC
    RTS         REST    with pull up to VCC
    GND         GPIO15  won't bootload if not GNDed
    VCCIO       CH_PD

    on linux, microcom/minicom opening /dev/ttyUSB0 drops DTR and RTS,
        forcing bootload mode to be entered. Can't disable hardware flowcontrol
        with stty. had to use pythons miniterm.py
        python -m serial.tools.miniterm  -p /dev/ttyUSB0 -b 115200 --dtr=0 --rts=0
User avatar
By Solo Pilot
#18317 I tried release 1.6.4 just now and analogRead() now does something. However, it didn't quite look right so I hooked a scope to it and found that it expects an input value in the range 0 - 1023, UNLIKE the Arduino default of 0 - 255. Other than that, it looks OK. The duty cycle is 1 ms.

There is a convenient Arduino function called map(value, fromLow, fromHigh, toLow, toHigh) that would have been ideal. BUT it has a bug. I tried:
Code: Select all    int value = map(val, 0, 255, 0, 1023);

the function returns 1027 when the input val is 255. I expected it to return 1023. If you try analogWrite(pin, 1027) it flatlines at 0, as if you called analogWrite(pin, 0).

So I ended with
Code: Select all    val = (val < 255)? val*4 : 1023;    // val is in range 0 to 255