tenbaht / sduino

An Arduino-like programming API for the STM8
http://tenbaht.github.io/sduino/
GNU Lesser General Public License v2.1
351 stars 213 forks source link

fatal error: Servo.h: No such file or directory #55

Closed segatecm closed 6 years ago

segatecm commented 6 years ago

Windows 10, Arduino 1.6.7 Install from Boards Manager, version 0.33

test code:

include

include

Servo myservo; // just a simple unsigned char to hold the channel-ID

Please help!

zoomx commented 6 years ago

I loaded the sweep example.

There is not an #include so I believe you don't need it. You should use Servo(myservo); instead of Servo myservo;

Anyway I get an error too D:\IDE\arduino\portable\packages\sduino\hardware\stm8\0.3.3\libraries\Servo\src\stm8\Servo.c:24:22: fatal error: irqtable.h: No such file or directory

Edit: I read in Servo.c that is in the repo this fix #36: remove accidentaly added include of (non-existant) irqtable.h So the repo is not aligned with the release.

Edit2: I updated manually Servo.c and the sweep example is compiled.

segatecm commented 6 years ago

My problem is Arduino IDE can not find the Servo.h when Sduino used. Maybe the sduino path not configured right.

zoomx commented 6 years ago

Maybe it is the IDE that is now at 1.8.5 You can check easily using the portable version Go here https://www.arduino.cc/en/Main/Software download the "Windows ZIP file for non admin install" unzip in a folder maybe in C: named Arduino, for example. Go inside the folder where is the Arduino.exe executable Create a folder called portable. Launch the IDE (so all necessary files and folders will be created) then install the sduino core Check if the example compile. If it compiles you have to upgrade the IDE.

segatecm commented 6 years ago

Hi @zoomx I install the IDE 1.8.5, and reinstall the Sduino.

When I compile the Servo code, it report the other problem:

bash.exe: warning: could not find /tmp, please create! C:\Users\chenmin\AppData\Local\Arduino15\packages\sduino\tools\sdcc\build.10088/bin/sdcc C:\Users\chenmin\AppData\Local\Arduino15\packages\sduino\hardware\stm8\0.3.3\libraries\Servo\src\stm8\Servo.c preproc\ctags_target_for_gcc_minus_e.cpp re12 -c -Ddouble=float -DPROG_TYPES_COMPAT -E -MC -mstm8 -DSTM8S103 -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_STM8S_BLUE -DARDUINO_ARCH_STM8 -IC:\Users\chenmin\AppData\Local\Arduino15\packages\sduino\hardware\stm8\0.3.3\cores\sduino -IC:\Users\chenmin\AppData\Local\Arduino15\packages\sduino\hardware\stm8\0.3.3\variants\standard -IC:\Users\chenmin\AppData\Local\Arduino15\packages\sduino\hardware\stm8\0.3.3\libraries\Servo\src -IC:\Users\chenmin\AppData\Local\Arduino15\packages\sduino\hardware\stm8\0.3.3/STM8S_StdPeriph_Driver/inc -IC:\Users\chenmin\AppData\Local\Arduino15\packages\sduino\tools\sdcc\build.10088/include Mark re12:C:\Users\chenmin\AppData\Local\Arduino15\packages\sduino\tools\sdcc\build.10088/bin/sdcc -c -Ddouble=float -DPROG_TYPES_COMPAT -E -MC -mstm8 -DSTM8S103 -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_STM8S_BLUE -DARDUINO_ARCH_STM8 -IC:\Users\chenmin\AppData\Local\Arduino15\packages\sduino\hardware\stm8\0.3.3\cores\sduino -IC:\Users\chenmin\AppData\Local\Arduino15\packages\sduino\hardware\stm8\0.3.3\variants\standard -IC:\Users\chenmin\AppData\Local\Arduino15\packages\sduino\hardware\stm8\0.3.3\libraries\Servo\src -IC:\Users\chenmin\AppData\Local\Arduino15\packages\sduino\hardware\stm8\0.3.3/STM8S_StdPeriph_Driver/inc -IC:\Users\chenmin\AppData\Local\Arduino15\packages\sduino\tools\sdcc\build.10088/include C:\Users\chenmin\AppData\Local\Arduino15\packages\sduino\hardware\stm8\0.3.3\libraries\Servo\src\stm8\Servo.c -o preproc\ctags_target_for_gcc_minus_e.cpp C:\Users\chenmin\AppData\Local\Arduino15\packages\sduino\hardware\stm8\0.3.3\libraries\Servo\src\stm8\Servo.c:24:22: fatal error: irqtable.h: No such file or directory

compilation terminated.

Multiple libraries were found for "Servo.h" Used: C:\Users\chenmin\AppData\Local\Arduino15\packages\sduino\hardware\stm8\0.3.3\libraries\Servo Not used: C:\Users\chenmin\Documents\arduino-1.8.5\libraries\Servo exit status 1 Error compiling for board STM8S103F3 Breakout Board.

zoomx commented 6 years ago

As I wrote before the Servo library was not updated, in the repository there is the one that has that error fixed.

I downloaded the Servo.c from here https://github.com/tenbaht/sduino/tree/master/sduino/hardware/sduino/stm8/libraries/Servo/src/stm8 Just click on file, then on RAW or use the direct link https://raw.githubusercontent.com/tenbaht/sduino/master/sduino/hardware/sduino/stm8/libraries/Servo/src/stm8/Servo.c then save page and maybe rename it Servo.c

put here C:\Users\chenmin\AppData\Local\Arduino15\packages\sduino\hardware\stm8\0.3.3\libraries\Servo\src\stm8\ and overwrite the one that is inside.

segatecm commented 6 years ago

@zoomx , Thanks for reply. It is works now.

And I have another question, How to fix this warnning:

bash.exe: warning: could not find /tmp, please create!

zoomx commented 6 years ago

I have the same warning Unfortunately I don't know how to fix it.

Since this problem is fixed you should close this issue.

segatecm commented 6 years ago

Thanks