# Upload to Arduino causes Compilererror

**URL:** <https://forum.xod.io/t/upload-to-arduino-causes-compilererror/5356>\
**Category:** Install/Upload Problems\
**Created:** [July 30, 2021, 9:24am UTC](https://forum.xod.io/t/upload-to-arduino-causes-compilererror/5356 "2021-07-30T09:24:51Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![walkingbackpack](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/walkingbackpack/32/3116_2.png) [@walkingbackpack](https://forum.xod.io/u/walkingbackpack)\
**Post date:** [July 30, 2021, 9:24am UTC](https://forum.xod.io/t/upload-to-arduino-causes-compilererror/5356/1 "2021-07-30T09:24:51Z")

</div>

Hello Guys,

I’m quite new to XOD and this is my first project.  
I’m using XOD V0.38 on Win10 64bit and I’m trying to make code for an Arduino UNO Wifi Rev2.  
The following picture shows my Patch:

 ![Bild von Patch](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/3/3502a908ffc7b39e6b78da22461c04c4a928f253.png)

For compilation I use the following settings:  
Board model: Arduino UNO Wifi Rev2  
Registers emulation: NONE (ATmega4809)

When I then hit ‘Upload’, I get the following message in the Compilerfeed:

```auto
Begin compiling code for the board Arduino Uno WiFi Rev2 📦

C:\Users\prenzel\AppData\Local\Temp\xod_temp_sketchbookXq6W2d\xod_1627634143083_sketch\xod_1627634143083_sketch.ino: In member function 'void xod::xod __gpio__ digital_write::Node<constant_input_PORT>::evaluate(xod::xod __gpio__ digital_write::Node<constant_input_PORT>::Context)':
C:\Users\prenzel\AppData\Local\Temp\xod_temp_sketchbookXq6W2d\xod_1627634143083_sketch\xod_1627634143083_sketch.ino:2533:48: error: cannot convert 'const bool' to 'PinStatus' for argument '2' to 'void digitalWrite(pin_size_t, PinStatus)'
         ::digitalWrite(constant_input_PORT, val);
                                                ^

Error during build: exit status 1

```

I really don’t know, what I might have done wrong or what else happend, to make the code try to initialize a bool with ‘2’ (that’s what I believe to understand with my not existing knowledge).

If you need any further information or have any suggestions, please let me know.  
I really like XOD so far and don’t want to change this.

Thank you and best regards.  
walkingbackpack

---

<div class="post-metadata">

**Author:** ![xodballxod](https://avatars.discourse-cdn.com/v4/letter/x/f475e1/32.png) [@xodballxod](https://forum.xod.io/u/xodballxod)\
**Post date:** [August 1, 2021, 12:54am UTC](https://forum.xod.io/t/upload-to-arduino-causes-compilererror/5356/2 "2021-08-01T00:54:47Z")

</div>

I think it’s saying you have an issue somewhere here, though, I’m not sure why  
 ![image](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/c/cecbc7eb2074dda3f5a85d3384a851b07324c4fa.png)

The “ON” pin looks like it’s supposed to be boolean. And the OR puts out boolean… Flip-Flop out is also boolean.

It could be helpful to post the actual code file, so someone can dig into the MotorStarter node to see what’s going on…

Oh, and wire up some watch nodes to all the outputs in the figure I posted.

---

<div class="post-metadata">

**Author:** ![walkingbackpack](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/walkingbackpack/32/3116_2.png) [@walkingbackpack](https://forum.xod.io/u/walkingbackpack)\
**Post date:** [August 2, 2021, 7:47am UTC](https://forum.xod.io/t/upload-to-arduino-causes-compilererror/5356/3 "2021-08-02T07:47:23Z")

</div>

I think I might have found the issue or at least kind of a workaround:  
The “Motorstarter”-node is a xod/common-hardware/relay wich I now replaced it with a xod/common-hardware/led. If that is done, the patch compiles and deploys to the board without problems.  
Now I just need to get the code to work as I want it to xD

> It could be helpful to post the actual code file, so someone can dig into the MotorStarter node to see what’s going on…

I tried to upload the .ino-file that contains the problem to this post but I didn’t find an option to do that.  
Can you please tell me how?

Thank you for your help.  
With best regards.

walkingbackpack

---

<div class="post-metadata">

**Author:** ![xodballxod](https://avatars.discourse-cdn.com/v4/letter/x/f475e1/32.png) [@xodballxod](https://forum.xod.io/u/xodballxod)\
**Post date:** [August 2, 2021, 12:40pm UTC](https://forum.xod.io/t/upload-to-arduino-causes-compilererror/5356/4 "2021-08-02T12:40:03Z")

</div>

Use the icons in the reply box…  
 ![image](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/a/af923d9a2a8307aaa7751c496c0a4683b0a22f22.png)

Hit the quotes to paste code between the makers, and it just shows up as text in code format in the reply.  
Hit the upload button, and navigate to the actual XOD file or whatever file…  
Copy and Paste screen shots, like what the error is saying.

When you hover over the icons, there’s a little help bubble that pops up describing what the icon does.

Also, it looks like you’re using a simulation… you may want to get an actual arduino to practice with. I tried the simulation, and didn’t have any luck. I’m always uploading to an actual board and using Debug/Watch/Tweak… Works great.

---

<div class="post-metadata">

**Author:** ![walkingbackpack](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/walkingbackpack/32/3116_2.png) [@walkingbackpack](https://forum.xod.io/u/walkingbackpack)\
**Post date:** [August 2, 2021, 2:02pm UTC](https://forum.xod.io/t/upload-to-arduino-causes-compilererror/5356/5 "2021-08-02T14:02:50Z")

</div>

Sorry I thought you wanted the .ino-File, so I was trying to upload an .zip-archive with the .ino-file, because it seemed to need to be in a specific folder and this wasn’t supported.

But I also realized that I’m not allowed to upload any attachments, because I’m a new user.  
And I don’t want to paste 2000+ lines of code in the text 😅.

The error is the same, that I posted in the first post.

And you don’t need to worry, I already have an UNO Wifi R2, wich I’m using for testing. But compiling the patch with a relay-node doesn’t seem to work.  
I wrote the Code I need already in Arduino IDE wich works and the XOD-solution with the led-node is fine too.

Thanks again for your help.  
Best regards.

walkingbackpack

---

<div class="post-metadata">

**Author:** ![xodballxod](https://avatars.discourse-cdn.com/v4/letter/x/f475e1/32.png) [@xodballxod](https://forum.xod.io/u/xodballxod)\
**Post date:** [August 2, 2021, 3:08pm UTC](https://forum.xod.io/t/upload-to-arduino-causes-compilererror/5356/6 "2021-08-02T15:08:54Z")

</div>

Well, then I’ll have to look into my crystal ball…  
Try changing pins, or linking done to the UPD’s to make a data flow… Also, Could be good to wire the out of OR to the ACT of Motorstarter… I’ve never seen that motor starter node, is it standard?.. so, not much I can do by looking at a black-box. Maybe dry using a different kind of node altogether to do the motor control. Your node may be messed up or incomplete, depending on where you took it from.  
I can’t help any further, unless I see a XODBALL file. Even then, I may not have the answer.

It looks like your input pin nodes are repeatedly used… Could be causing the problem. The D4 in LS\_Stopp looks bad, since it’s repeated on the loop with no flow control. Link the Done to UDP’s. Try to deleted the repeated one, and just run a wire from the output of the first. Same for D7 Q1\_Error. Use a BUS, if you want.

Good Luck!

---

<div class="post-metadata">

**Author:** ![walkingbackpack](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/walkingbackpack/32/3116_2.png) [@walkingbackpack](https://forum.xod.io/u/walkingbackpack)\
**Post date:** [August 3, 2021, 7:19am UTC](https://forum.xod.io/t/upload-to-arduino-causes-compilererror/5356/7 "2021-08-03T07:19:55Z")

</div>

I’m sorry for that.  
Thanks for the tips, I’ll try them.  
That Motorstarter-node is actually the xod/common-hardware/relay-node that is just labeled as “Motorstarter”. All the nodes I use are XOD-standard nodes, I just labeled them maybe 😅  
Replacing the relay-node with the led node (both common-hardware-library) works. I don’t know, if there are other output nodes I could try…

I’ll try to get a better memberrank wich allows me to upload files.

Thanks for that tip with the inputs, I’ll try that.

Thank you again for your help.  
Best regards.

walkingbackpack

Edit:  
I just got a higher member rank, so here is the .xodball-file:  
[Gurtförderer\_test.xodball](https://forum.xod.io/uploads/short-url/8eSkMN0Yvu1uvUz98H1XwahkD4Q.xodball) (4.6 KB)  
I changed it for testing, but the error still appears.  
I hope this helps you to find my mistake.

Thank you again.

---

<div class="post-metadata">

**Author:** ![xodballxod](https://avatars.discourse-cdn.com/v4/letter/x/f475e1/32.png) [@xodballxod](https://forum.xod.io/u/xodballxod)\
**Post date:** [August 4, 2021, 6:58pm UTC](https://forum.xod.io/t/upload-to-arduino-causes-compilererror/5356/9 "2021-08-04T18:58:29Z")

</div>

> [@walkingbackpack](#):
>
> UNO Wifi Rev2

Well, your code works fine on my Uno… The only thing that can be happening is that you haven’t selected the right board on uploading…

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/a/a13eeaf7453b43226bcc952768d464f3745f39de.png)

Now, when I switch back to my Uno, it’s actually not on the right COM until I select the COM that has my board.

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/a/a0afc6e18c81a269d15ff9449d9a2b9bf5158e35.png)

Now, both are selected properly.

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/0/04833fc4e094fd37526eed54a8c83c8ba570ee02.png)

Then, Upload.  
Works great.

If you’re having issues still. Either, a) look around on the internet for issues with the board type you’re using, b) get a different board type and see what happens, c) contact the XOD developers to report a possible bug (only after you’ve done a) and b) ). If you’re using Wi-Fi… Then, if you’re not married to arduino then you may consider ESP32.

You gotta have the Packages up-to-date, too… Check out this post, they mention selecting a particular board.

> [@Problem with upload to Arduino](https://forum.xod.io/t/problem-with-upload-to-arduino/1385/11):
>
> Upgrade Packages and Toolchains [packages]

---

<div class="post-metadata">

**Author:** ![walkingbackpack](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/walkingbackpack/32/3116_2.png) [@walkingbackpack](https://forum.xod.io/u/walkingbackpack)\
**Post date:** [August 5, 2021, 6:54am UTC](https://forum.xod.io/t/upload-to-arduino-causes-compilererror/5356/10 "2021-08-05T06:54:29Z")

</div>

Thank you for your suggestions,

I’m pretty sure that the Board and Com-Port were the right one, wit no Emulation selected.  
When I pasted the generated C++ code into the Arduino-IDE, the same Error occurred (don’t know if that tells anything good or bad).

I’ll try a) and b) but it could take a time.  
I don’t necessarily need Wifi, so I’ll try to get a “normal” UNO.  
If I have any more questions, I’ll let you know.

Thank you for your help!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/1X/eb7348baa04192c2ef932d1db54d44f09f8a7888.png) [@system](https://forum.xod.io/u/system)\
**Post date:** [September 4, 2021, 6:54am UTC](https://forum.xod.io/t/upload-to-arduino-causes-compilererror/5356/11 "2021-09-04T06:54:38Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
