Skip to content

Commit

Permalink
Merge pull request #2 from mule1972/32U4-Test
Browse files Browse the repository at this point in the history
Integrate ATmega32U4-CPU
  • Loading branch information
mule1972 authored Jan 2, 2020
2 parents 58469c7 + 8455572 commit 52a2d4c
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions NeoPixel_BLV.ino
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,11 @@ void GetSerialMessage(){
#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__)
while(SerialMessageComplete==false && Serial.available() > 0)
#endif

//Arduino-Leonardo only
#if defined(__AVR_ATmega32U4__)
while(SerialMessageComplete==false && Serial1.available() > 0)
#endif
{
//Arduino-Mega only
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
Expand All @@ -310,6 +315,11 @@ void GetSerialMessage(){
#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__)
char inChar = Serial.read();
#endif

//Arduino-Leonardo only
#if defined(__AVR_ATmega32U4__)
char inChar = Serial1.read();
#endif

if(BeginMessage==false){
if(inChar=='{')
Expand Down Expand Up @@ -360,6 +370,13 @@ void setup()
while(!Serial)
{;}
#endif

//Arduino-Leonardo only
#if defined(__AVR_ATmega32U4__)
Serial1.begin(57600);
while(!Serial1)
{;}
#endif

//Default start values for animations
NeoPixelTempHotendAnimation.Position = 0;
Expand Down Expand Up @@ -444,6 +461,13 @@ void loop()
}
#endif

//Arduino-Leonardo only
#if defined(__AVR_ATmega32U4__)
if (Serial1.available() > 0){
GetSerialMessage();
}
#endif

//NeopixelRefresh?
if ((millis() - NeoPixelTimerRefresh) >= NeopixelRefreshSpeed){
NeoPixelTimerRefresh = millis();
Expand Down

0 comments on commit 52a2d4c

Please sign in to comment.