lines.ino 518 B

1234567891011121314151617181920212223242526272829
  1. #include <EEPROM.h>
  2. #include <SPI.h>
  3. #include <GD2.h>
  4. void setup()
  5. {
  6. Serial.begin(1000000); // JCB
  7. GD.begin();
  8. }
  9. static void zigzag(int x) //' a{
  10. {
  11. GD.Vertex2ii(x - 10, 10); GD.Vertex2ii(x + 10, 60);
  12. GD.Vertex2ii(x - 10, 110); GD.Vertex2ii(x + 10, 160);
  13. GD.Vertex2ii(x - 10, 210); GD.Vertex2ii(x + 10, 260);
  14. }
  15. void loop()
  16. {
  17. GD.Clear();
  18. GD.Begin(LINES);
  19. zigzag(140);
  20. GD.Begin(LINE_STRIP);
  21. zigzag(240);
  22. GD.LineWidth(16 * 10);
  23. GD.Begin(LINE_STRIP);
  24. zigzag(340);
  25. GD.swap();
  26. } //' }a