Hello,
I've been using arduino Uno without much issues in the past and I'm working on a bigger project using an Arduino Due at the moment.
Unfortunately, I'm blocked at a very basic step with the Due and I haven't found anything on the matter on the internet, so, it's probably me being retarded, but you guys will tell me.
I've done a bunch of code that works but I found out that if I write "pinMode(WhateverPin, INPUT or OUTPUT or INPUT_PULLUP)", the code will compile, but the Due just won't do anything...
I tried pressing the reset before, meanwhile and after transmitting the code to the Due but nothing worked.
An instance of code that works :
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
//pinMode(1,INPUT_PULLUP);
Serial.println("Hello");
}
void loop() {
// put your main code here, to run repeatedly:
Serial.println("kikoo");
Serial.println(digitalRead(1));
}
It outputs once "hello" and then endlessly "kikoo" and "0" or "1", as expected.
An instance of code that doesn't work :
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(1,INPUT_PULLUP);
Serial.println("Hello");
}
void loop() {
// put your main code here, to run repeatedly:
Serial.println("kikoo");
Serial.println(digitalRead(1));
}
It outputs absolutely nothing as the Due seems to sleep deeply. wtf.
I tried different board so it's unlikely that it is due to a faulty board.
I googled it for half an hour and found nothing on the subject. It doesn't seem that they are peculiar libraries for these simple and basic functions.
Also, on a side note, when getting reset or in default mode (when you upload code in the board), all the digital pin are set as OUTPUT and HIGH, which is pretty stupid and inconvenient. (but I can work around that).
Please help, it's starting to annoy me deeply.
Thanks in advance,
EDIT : Found out, looking at example of code, that a lot of people are coding in C++ on the due. Is the arduino IDE fully supported on the Due (with SAM architecture) ?