Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'
Use code tags (the < CODE/ > icon above the compose window) to make it easier to read and copy for examination
Please post your full sketch, using code tags when you do
Posting your code using code tags prevents parts of it being interpreted as HTML coding and makes it easier to copy for examination
In my experience the easiest way to tidy up the code and add the code tags is as follows
Start by tidying up your code by using Tools/Auto Format in the IDE to make it easier to read. Then use Edit/Copy for Forum and paste what was copied in a new reply. Code tags will have been added to the code to make it easy to read in the forum thus making it easier to provide help.
It is also helpful to post error messages in code tags as it makes it easier to scroll through them and copy them for examination
I’m not sure why it is formatted the way it is. There aren’t any spaces in the sketch but I can’t seem to merge everything into one code grouping on the forum.
In my experience the easiest way to tidy up the code and add the code tags is as follows
Start by tidying up your code by using Tools/Auto Format in the IDE to make it easier to read. Then use Edit/Copy for Forum and paste what was copied in a new reply. Code tags will have been added to the code to make it easy to read in the forum thus making it easier to provide help.
Yes, I auto-formatted in the IDE. When pasting, it skips each line, and when applying code tags, it separates each individual line. Trying to delete lines in between doesn’t work either.
Hi @mfusco. The drawPixel function only adds the pixel data to the graphics buffer. The display won't be updated until you call the endWrite() function.
So you can make your sketch work as expected by adding a call to the startWrite function before, and a call to the endWrite() function after:
The reason the drawPixel function doesn't do this internally is for the sake of performance in some applications. The drawPixel function is often a helper function which is called many times while constructing graphics objects. In that use case, it is more efficient to store the graphic data only in memory until it has been completely generated, then use a single display update instead of a separate update for drawing each individual pixel.