Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
mohammad.abdelkhalek
mohammad.abdelkhalek's Profile
2
Posts
0
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
trying to send sensor data to pachube
[0 Replies]
07-Dec-2011 01:29 PM
Forum:
Integration and Hardware
hello all!
i'm trying to follow thius tutorial
http://community.pachube.com/?q=node/13
but my light sensor value is 0.0 all the time
i tested my circuit using firmata test app
any help??
thanks
out of memory error
[1 Reply]
13-Sep-2011 12:53 PM
Forum:
Programming Questions
i'm trying to do some tutorial and i did everything but when i try to run the sketch it gives me this error
//declare class
ArrayList ballCollection;
void setup() {
size(600, 600);
smooth();
//initialize class
ballCollection = new ArrayList();
for (int i = 0; 0 < 100; i++){
Ball myBall = new Ball(random(0,width), random(0, 200));
ballCollection.add(myBall);
}
}
void draw() {
background(0);
//call functionality of class
for (int i = 0; 0 < 100; i++){
Ball myBall = (Ball)ballCollection.get(i);
myBall.run();
}
}
class Ball {
//global variables
float x = 0;
float y = 0;
float speedX = 4;
float speedY = 0.5;
//constructor
Ball(float _x, float _y) {
x = _x;
y = _y;
}
//functions
void run() {
display();
move();
bounce();
gravity();
}
void gravity() {
speedY += 0.2;
}
void bounce() {
if (x > width) {
speedX = speedX * -1;
}
if (x < 0) {
speedX = speedX * -1;
}
if (y > height) {
speedY = speedY * -1;
}
if (y < 0) {
speedY = speedY * -1;
}
}
void move() {
x = x + speedX;
y = y + speedY;
}
void display() {
ellipse(x, y, 20, 20);
}
}
«Prev
Next »
Moderate user : mohammad.abdelkhalek
Forum