The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 864 - File: showthread.php PHP 7.2.25 (Linux)
File Line Function
/showthread.php 864 errorHandler->error




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] println() doesn't print anything
03-11-2013, 01:02 AM, (This post was last modified: 04-11-2013, 06:58 PM by FlacoDev.)
#1
[SOLVED] println() doesn't print anything
Hello guys,
I've got a problem with the Serial function println().
I don't know where it should be displayed but println() does not print anything in the terminal where the Pinguino IDE was launched or in the IDE's console.

I have tested my the current flow on my breadboard and everything seems okay (I did it with a led).

OS + distro: GNU/Linux Arch Linux (updated 2 days ago)
Board: PIC32-Pinguino-MX220 (from Olimex)
Additional info: The pins 7 & 8 are respectively the Trigger & Echo of my HC-SR04 ultrasonic module.

Here's the code :

main.pde :
Code:
#define trigPin 7
#define echoPin 8

long duration;
long distance;

void setup()
{
  Serial.begin(9600);
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);
}

void loop()
{
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);

  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);

  digitalWrite(trigPin, LOW);
  duration = pulseIn(echoPin, HIGH, 1000);

  distance = duration/58.2;

  Serial.println(distance);

  delay(50);
}

(Based on this example)
Where did I failed ?

Thanks,
Flaco Smile
Reply


Messages In This Thread
[SOLVED] println() doesn't print anything - by FlacoDev - 03-11-2013, 01:02 AM
RE: println() doesn't print anything - by iyahdub - 03-11-2013, 02:56 AM
RE: println() doesn't print anything - by pingotg - 03-11-2013, 05:30 PM
RE: println() doesn't print anything - by pingotg - 03-11-2013, 07:34 PM
RE: println() doesn't print anything - by pingotg - 04-11-2013, 12:05 AM
RE: println() doesn't print anything - by pingotg - 04-11-2013, 09:40 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)