# Coding Questions

**URL:** https://discourse.processing.org/c/processing/processing-questions/15.md?page=179

[Latest](https://discourse.processing.org/latest.md) · [Categories](https://discourse.processing.org/categories.md) · [Tags](https://discourse.processing.org/tags.md)

**Page:** 180

---

## [How can i convert textbox value to integer?](https://discourse.processing.org/t/how-can-i-convert-textbox-value-to-integer/834)

<div class="topic-metadata">

**Author:** [@BeyzaK](https://discourse.processing.org/u/BeyzaK)\
**Replies:** 2\
**Last updated:** [August 7, 2018, 12:28am UTC](https://discourse.processing.org/t/how-can-i-convert-textbox-value-to-integer/834 "2018-08-07T00:28:07Z")

</div>

I’m trying to control stepper motor by arduino and processing. I want to control the step value of motor which I entered the interface textbox but it doesnt work and program give error always. Arduino Code #include \<AF…

---

## [Fibonacci spiral](https://discourse.processing.org/t/fibonacci-spiral/2358)

<div class="topic-metadata">

**Author:** [@AbuYazid](https://discourse.processing.org/u/AbuYazid)\
**Replies:** 6\
**Last updated:** [August 6, 2018, 7:26pm UTC](https://discourse.processing.org/t/fibonacci-spiral/2358 "2018-08-06T19:26:40Z")

</div>

Hi geeks, can you guys help to draw a fibonacci spiral ?

---

## [Easiest way to map 0 to 360 degrees with 0 at 12 o’clock](https://discourse.processing.org/t/easiest-way-to-map-0-to-360-degrees-with-0-at-12-o-clock/2372)

<div class="topic-metadata">

**Author:** [@ddownn](https://discourse.processing.org/u/ddownn)\
**Replies:** 6\
**Last updated:** [August 6, 2018, 6:21pm UTC](https://discourse.processing.org/t/easiest-way-to-map-0-to-360-degrees-with-0-at-12-o-clock/2372 "2018-08-06T18:21:15Z")

</div>

I want to make an interface for rotation when mouseX, mouseY are rotated around a circle it will output 0 - 360 degrees with 0 being at 12 o’clock. I have tried a few ways to do this but it’s not working. This is the cl…

---

## [Switching javascript neural network to java](https://discourse.processing.org/t/switching-javascript-neural-network-to-java/1857)

<div class="topic-metadata">

**Author:** [@ctrembla](https://discourse.processing.org/u/ctrembla)\
**Replies:** 17\
**Last updated:** [August 6, 2018, 6:17pm UTC](https://discourse.processing.org/t/switching-javascript-neural-network-to-java/1857 "2018-08-06T18:17:24Z")

</div>

OK, I’m trying to convert javascript code from coding train 10.13 neural network to java & having trouble. here my code in java NeuralNetwork nn; void setup(){ nn = new NeuralNetwork(2,2,1); float \[\] input = new fl…

---

## [Display Teapot and Graph](https://discourse.processing.org/t/display-teapot-and-graph/2413)

<div class="topic-metadata">

**Author:** [@DragosMDx](https://discourse.processing.org/u/DragosMDx)\
**Replies:** 2\
**Last updated:** [August 6, 2018, 2:01pm UTC](https://discourse.processing.org/t/display-teapot-and-graph/2413 "2018-08-06T14:01:17Z")

</div>

Hi, I have the Teapot code https://gist.github.com/cooperaj/10965142 and I would like to know how can I create a graph in the right side with the values that the air plane receives ? Any indications will be very helpfu…

---

## [Help a newbie with Penrose tilling](https://discourse.processing.org/t/help-a-newbie-with-penrose-tilling/2392)

<div class="topic-metadata">

**Author:** [@Tonchii](https://discourse.processing.org/u/Tonchii)\
**Replies:** 3\
**Last updated:** [August 5, 2018, 10:16pm UTC](https://discourse.processing.org/t/help-a-newbie-with-penrose-tilling/2392 "2018-08-05T22:16:34Z")

</div>

Hello guys, i have been trying to draw this Penrose tile, I already got the pentagon but now i’m stuck with the other figure. Any help? I’m new to this. By the way here’s the code: void setup(){ size(400,400); } …

---

## [Monkey catching game where one monkey is stuck in an corner (should be falling down)](https://discourse.processing.org/t/monkey-catching-game-where-one-monkey-is-stuck-in-an-corner-should-be-falling-down/2384)

<div class="topic-metadata">

**Author:** [@sokuv](https://discourse.processing.org/u/sokuv)\
**Replies:** 7\
**Last updated:** [August 5, 2018, 9:13pm UTC](https://discourse.processing.org/t/monkey-catching-game-where-one-monkey-is-stuck-in-an-corner-should-be-falling-down/2384 "2018-08-05T21:13:10Z")

</div>

In the game, 2 monkeys or 1 (that already works) should be falling down but with my code one monkey is stuck in the top left corner flickering (blinking) int monkeyaY = -50; int monkeybY = -50; int monkeya\_X = 0; int m…

---

## [Processing : drawing radar with sensor](https://discourse.processing.org/t/processing-drawing-radar-with-sensor/2192)

<div class="topic-metadata">

**Author:** [@Charlie](https://discourse.processing.org/u/Charlie)\
**Replies:** 7\
**Last updated:** [August 5, 2018, 5:19pm UTC](https://discourse.processing.org/t/processing-drawing-radar-with-sensor/2192 "2018-08-05T17:19:16Z")

</div>

Hi ! Description I have some problem while doing my project. I am trying to draw radar with incoming values which is variable(value from two potentiometer) I got two variable value from my sensor and its form is like…

---

## [Wont display my second set of numbers](https://discourse.processing.org/t/wont-display-my-second-set-of-numbers/2371)

<div class="topic-metadata">

**Author:** [@magic\_moose](https://discourse.processing.org/u/magic_moose)\
**Replies:** 3\
**Last updated:** [August 5, 2018, 6:49am UTC](https://discourse.processing.org/t/wont-display-my-second-set-of-numbers/2371 "2018-08-05T06:49:02Z")

</div>

I am trying to use a TSV data file to plot on a graph however the second collum of data isnt being recognized. Can someone Help? Here is my Code so far: PFont font; float x1, y1, x2, y2; int\[\]fireData; int\[\]years; i…

---

## [Trouble with graph](https://discourse.processing.org/t/trouble-with-graph/2373)

<div class="topic-metadata">

**Author:** [@magic\_moose](https://discourse.processing.org/u/magic_moose)\
**Replies:** 3\
**Last updated:** [August 5, 2018, 2:04am UTC](https://discourse.processing.org/t/trouble-with-graph/2373 "2018-08-05T02:04:30Z")

</div>

So I have 2 questions. First is how to get rid of the black on my graph line. The second is how to flip my graph line around so the highest part is on the left. Here is my code: PFont font; float x1, y1, x2, y2; in…

---

## [I am having an Issue](https://discourse.processing.org/t/i-am-having-an-issue/2367)

<div class="topic-metadata">

**Author:** [@magic\_moose](https://discourse.processing.org/u/magic_moose)\
**Replies:** 5\
**Last updated:** [August 4, 2018, 7:32pm UTC](https://discourse.processing.org/t/i-am-having-an-issue/2367 "2018-08-04T19:32:54Z")

</div>

I am trying to make a bar graph for the following data however my “i” integer is not being recognized. String\[\] name = { “1997:”, “1998:”, “1999:”, “2000:”, “2001:”, “2002:”, “2003:”, “2004:”, “2005:”, “2006:…

---

## [Negative Noise problem](https://discourse.processing.org/t/negative-noise-problem/2297)

<div class="topic-metadata">

**Author:** [@imaginativeCODE](https://discourse.processing.org/u/imaginativeCODE)\
**Replies:** 26\
**Last updated:** [August 4, 2018, 7:09pm UTC](https://discourse.processing.org/t/negative-noise-problem/2297 "2018-08-04T19:09:45Z")

</div>

I found that when you put negative numbers into the noise function like xoff or yoff the noise function converts them to positive numbers. Why?? And how do I solve this to be able to put negative numbers into the noise f…

---

## [SelectOutput() minimizing both rendering window and file select?](https://discourse.processing.org/t/selectoutput-minimizing-both-rendering-window-and-file-select/2364)

<div class="topic-metadata">

**Author:** [@TheZipCreator](https://discourse.processing.org/u/TheZipCreator)\
**Replies:** 0\
**Last updated:** [August 4, 2018, 2:26pm UTC](https://discourse.processing.org/t/selectoutput-minimizing-both-rendering-window-and-file-select/2364 "2018-08-04T14:26:46Z")

</div>

So when I call selectOutput() it minimizes the rendering window and the file select window. I have surface.setSize(512, 512) in draw, and I am using P2D. The reason I have that in draw is because I’m making a game for …

---

## [Help with making a Quiz in Processing](https://discourse.processing.org/t/help-with-making-a-quiz-in-processing/2333)

<div class="topic-metadata">

**Author:** [@Haven](https://discourse.processing.org/u/Haven)\
**Replies:** 7\
**Last updated:** [August 4, 2018, 12:58pm UTC](https://discourse.processing.org/t/help-with-making-a-quiz-in-processing/2333 "2018-08-04T12:58:46Z")

</div>

How to create questions buttons so the programm knows from the position which answer is correct. Also don’t know how to set up the question class correctly. Second big problem: how to shrink the code. Not very familiar …

---

## [Multi Bat One Player Pong](https://discourse.processing.org/t/multi-bat-one-player-pong/2354)

<div class="topic-metadata">

**Author:** [@Pudwig23](https://discourse.processing.org/u/Pudwig23)\
**Replies:** 1\
**Last updated:** [August 4, 2018, 5:52am UTC](https://discourse.processing.org/t/multi-bat-one-player-pong/2354 "2018-08-04T05:52:14Z")

</div>

Hey guys, I am currently making a single player pong game where every time the ball hits all the bats on the screen (only once otherwise the user dies), it moves to the next level where it is one extra bat from the last…

---

## [Plot grafica in Pgraphics?](https://discourse.processing.org/t/plot-grafica-in-pgraphics/2334)

<div class="topic-metadata">

**Author:** [@jimbojohn](https://discourse.processing.org/u/jimbojohn)\
**Replies:** 2\
**Last updated:** [August 4, 2018, 1:02am UTC](https://discourse.processing.org/t/plot-grafica-in-pgraphics/2334 "2018-08-04T01:02:40Z")

</div>

Dear enthusiasts, I was wondering if any of you would know of a easy and nice way to show grafica plots on Pgraphics without having to hack pgraphics as i have already done that. Moreover if the answer is no, does anyo…

---

## [Creating Arc if you know center start and end point](https://discourse.processing.org/t/creating-arc-if-you-know-center-start-and-end-point/2338)

<div class="topic-metadata">

**Author:** [@rebin](https://discourse.processing.org/u/rebin)\
**Replies:** 2\
**Last updated:** [August 3, 2018, 6:54pm UTC](https://discourse.processing.org/t/creating-arc-if-you-know-center-start-and-end-point/2338 "2018-08-03T18:54:59Z")

</div>

Hi all; This is my first question so apologize if I do not follow the rule properly. I need to create an arc in processing. but I believe ( maybe I am wrong) the way I wanted the arc function arc( x , y , width , heigh…

---

## [How to do this kind of gradient on shapes](https://discourse.processing.org/t/how-to-do-this-kind-of-gradient-on-shapes/799)

<div class="topic-metadata">

**Author:** [@helloscoopz](https://discourse.processing.org/u/helloscoopz)\
**Replies:** 6\
**Last updated:** [August 3, 2018, 3:41pm UTC](https://discourse.processing.org/t/how-to-do-this-kind-of-gradient-on-shapes/799 "2018-08-03T15:41:17Z")

</div>

here are bunch of shapes floating here and there. so i need to apply this kind of a gradient on them. can anyone tell me how to do these kind of thing will be appreciated. Here is the SS: \[shapesmasksexample\] Many Tha…

---

## [How to I make something darker?](https://discourse.processing.org/t/how-to-i-make-something-darker/2326)

<div class="topic-metadata">

**Author:** [@MNLHMBS](https://discourse.processing.org/u/MNLHMBS)\
**Replies:** 5\
**Last updated:** [August 3, 2018, 9:05am UTC](https://discourse.processing.org/t/how-to-i-make-something-darker/2326 "2018-08-03T09:05:01Z")

</div>

I have this code that switches a square from white to black when the mouse is clicked: int value = 255; void draw() { fill(value); rect(25, 25, 50, 50); } void mouseClicked() { if (value == 255) { value = 0; } e…

---

## [Dimming and brightening ledstrip using processing](https://discourse.processing.org/t/dimming-and-brightening-ledstrip-using-processing/2269)

<div class="topic-metadata">

**Author:** [@morganruben](https://discourse.processing.org/u/morganruben)\
**Replies:** 7\
**Last updated:** [August 3, 2018, 7:00am UTC](https://discourse.processing.org/t/dimming-and-brightening-ledstrip-using-processing/2269 "2018-08-03T07:00:35Z")

</div>

Hi Everyone! I am kind of new to processing and I am trying to figure out the following: I want to dim and brighten a ledstrip using a slider button in processing. Now I made the slider yet somehow I cannot make it to …

---

## [saveFrame cuts off top and left side of frame](https://discourse.processing.org/t/saveframe-cuts-off-top-and-left-side-of-frame/2026)

<div class="topic-metadata">

**Author:** [@aigos](https://discourse.processing.org/u/aigos)\
**Replies:** 27\
**Last updated:** [August 2, 2018, 11:44pm UTC](https://discourse.processing.org/t/saveframe-cuts-off-top-and-left-side-of-frame/2026 "2018-08-02T23:44:29Z")

</div>

Hey yall, I am using an interpolation algorithm to smooth an image of a heatmap im making from an 8x8 array of thermisistors. It displays an 8x8 picture of circles, but the top row and left column are cut in half for som…

---

## [Maze generation problem](https://discourse.processing.org/t/maze-generation-problem/2319)

<div class="topic-metadata">

**Author:** [@relix](https://discourse.processing.org/u/relix)\
**Replies:** 4\
**Last updated:** [August 2, 2018, 8:52pm UTC](https://discourse.processing.org/t/maze-generation-problem/2319 "2018-08-02T20:52:49Z")

</div>

So here’s what I already have: https://pastebin.com/BpUshpKY (this is the relevant function) The maze is divided into invidiual blocks, the maze this code will generate is 9x9 “blocks”. My maze is defined using an X an…

---

## [Creating a graph - Error: Graph is bunched together](https://discourse.processing.org/t/creating-a-graph-error-graph-is-bunched-together/2286)

<div class="topic-metadata">

**Author:** [@sjames2](https://discourse.processing.org/u/sjames2)\
**Replies:** 1\
**Last updated:** [August 2, 2018, 4:35pm UTC](https://discourse.processing.org/t/creating-a-graph-error-graph-is-bunched-together/2286 "2018-08-02T16:35:26Z")

</div>

Hello! I’m recently new to java-processing, and we’re curently working on creating graphs. My program loads, but it bunches my graph up together. If anyone could help me it would be greatly appreciated! int\[\] Private; …

---

## [Spread infection to other cells (help with a school assignment)](https://discourse.processing.org/t/spread-infection-to-other-cells-help-with-a-school-assignment/2110)

<div class="topic-metadata">

**Author:** [@the-junk](https://discourse.processing.org/u/the-junk)\
**Replies:** 9\
**Last updated:** [August 2, 2018, 1:44pm UTC](https://discourse.processing.org/t/spread-infection-to-other-cells-help-with-a-school-assignment/2110 "2018-08-02T13:44:12Z")

</div>

Can someone please help me spread the infection to other cells? I am able to spread it to the left neighbouring cell. But when I spread in other directions, the infection goes out of bounds of myth array and crashes the…

---

## [Math for translating mouse coordinates](https://discourse.processing.org/t/math-for-translating-mouse-coordinates/2284)

<div class="topic-metadata">

**Author:** [@shawnlau](https://discourse.processing.org/u/shawnlau)\
**Replies:** 8\
**Last updated:** [August 2, 2018, 3:54am UTC](https://discourse.processing.org/t/math-for-translating-mouse-coordinates/2284 "2018-08-02T03:54:44Z")

</div>

This is a very simplified program showing my problem. I need to draw to an image that is rotated. I can’t use any of processing’s line or point functions because of different type brushes in the real program. I have to …

---

## [Cannot find a class or type name Circle](https://discourse.processing.org/t/cannot-find-a-class-or-type-name-circle/1951)

<div class="topic-metadata">

**Author:** [@sjames2](https://discourse.processing.org/u/sjames2)\
**Replies:** 2\
**Last updated:** [August 1, 2018, 8:40pm UTC](https://discourse.processing.org/t/cannot-find-a-class-or-type-name-circle/1951 "2018-08-01T20:40:41Z")

</div>

Hello! I’m recently new to java -processing, and we’re curently working on an animation assignment. I keep getting a class error message, that states "Cannot find a class or type named “Circle”. If anyone could help me …

---

## [Code for saving the sketch as an image for printing](https://discourse.processing.org/t/code-for-saving-the-sketch-as-an-image-for-printing/2131)

<div class="topic-metadata">

**Author:** [@haschdl](https://discourse.processing.org/u/haschdl)\
**Replies:** 2\
**Last updated:** [August 1, 2018, 1:00pm UTC](https://discourse.processing.org/t/code-for-saving-the-sketch-as-an-image-for-printing/2131 "2018-08-01T13:00:13Z")

</div>

Anyone else creating art for print? :smiley: I’m currently working on a project where I create images for printing, by drawing to an off-screen buffer (a PGraphics variable), and calling save() on the PGraphics. This a…

---

## [Use other sockets with Processing network client](https://discourse.processing.org/t/use-other-sockets-with-processing-network-client/2203)

<div class="topic-metadata">

**Author:** [@0x5e](https://discourse.processing.org/u/0x5e)\
**Replies:** 3\
**Last updated:** [August 1, 2018, 10:23am UTC](https://discourse.processing.org/t/use-other-sockets-with-processing-network-client/2203 "2018-08-01T10:23:34Z")

</div>

I have written a game server in Python (it’s more fit for the job, with async and all). Now I’m working to integrate its functionality with Processing. I’m using Client from processing.net.\* Here’s an example of my issu…

---

## [Using pow() for non-integers](https://discourse.processing.org/t/using-pow-for-non-integers/2246)

<div class="topic-metadata">

**Author:** [@stevenette](https://discourse.processing.org/u/stevenette)\
**Replies:** 6\
**Last updated:** [August 1, 2018, 12:00am UTC](https://discourse.processing.org/t/using-pow-for-non-integers/2246 "2018-08-01T00:00:17Z")

</div>

I am trying to raise X ^ 0.026 using float X = 2.0; float Y = pow(X,0.026); This returns 0.0 when it should return 1.018. Does pow() require an integer? Is there a way around this? I have also tried float Y = exp(0.0…

---

## [Framedrops when displaying PImage at negative coords](https://discourse.processing.org/t/framedrops-when-displaying-pimage-at-negative-coords/2215)

<div class="topic-metadata">

**Author:** [@Bottom](https://discourse.processing.org/u/Bottom)\
**Replies:** 2\
**Last updated:** [July 31, 2018, 9:17pm UTC](https://discourse.processing.org/t/framedrops-when-displaying-pimage-at-negative-coords/2215 "2018-07-31T21:17:44Z")

</div>

Hi, I noticed that when I call the image() function with negative coordinates but part of the image is still visible, I get massive framedrops from the set framerate(60) to around 30 to 45. Does anyone know if this is a…

[Previous page](https://discourse.processing.org/c/processing/processing-questions/15.md?page=178)

[Next page](https://discourse.processing.org/c/processing/processing-questions/15.md?page=180)
